@app-studio/web 0.9.54 → 0.9.56

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.
@@ -9556,6 +9556,181 @@ var SwitchComponent = props => {
9556
9556
  // Exports the SwitchComponent as 'Switch' for use in other parts of the application.
9557
9557
  var Switch = SwitchComponent;
9558
9558
 
9559
+ // Initializes the custom hook 'useSelectorState' for managing the state of the Selector component
9560
+ var useSelectorState = _ref => {
9561
+ var {
9562
+ placeholder,
9563
+ isMulti,
9564
+ options,
9565
+ id = "selector-" + Math.random().toString(36).substr(2, 9)
9566
+ } = _ref;
9567
+ // Determines the default value based on the 'placeholder' and 'isMulti' props, setting to an empty array for multi-select or an empty string/single default option
9568
+ var defaultValue = placeholder ? isMulti ? [] : '' // If there's a placeholder, set default to empty array for multi-select or empty string for single select
9569
+ : Array.isArray(options) && options.length > 0 ? options[0].value : isMulti ? [] : ''; // If no placeholder, use the first option value if available, otherwise empty array for multi-select or empty string for single select
9570
+ // State hook for tracking mouse hover status over the Selector component
9571
+ var [isHovered, setIsHovered] = React__default.useState(false);
9572
+ // State hook for tracking focus status of the Selector input field
9573
+ var [isFocused, setIsFocused] = React__default.useState(false);
9574
+ // State hook for managing the value(s) selected by the user, initialized with the default value
9575
+ var [value, setValue] = React__default.useState(defaultValue);
9576
+ // State hook for keeping track of the currently highlighted index in the options list
9577
+ var [highlightedIndex, setHighlightedIndex] = React__default.useState(0);
9578
+ // State hook for managing visibility of the Selector dropdown, initially set to hidden
9579
+ var [hide, setHide] = React__default.useState(true);
9580
+ // Returns an object containing all stateful values and their associated setters to manage the Selector component's state
9581
+ return {
9582
+ id,
9583
+ value,
9584
+ setValue,
9585
+ hide,
9586
+ setHide,
9587
+ isHovered,
9588
+ setIsHovered,
9589
+ isFocused,
9590
+ setIsFocused,
9591
+ highlightedIndex,
9592
+ setHighlightedIndex
9593
+ };
9594
+ };
9595
+
9596
+ var _excluded$u = ["id", "name", "label", "value", "size", "views", "options", "onChange", "setValue"];
9597
+ /**
9598
+ * SelectorView Component
9599
+ *
9600
+ * Renders a segmented control style selector.
9601
+ */
9602
+ var SelectorView = _ref => {
9603
+ var {
9604
+ id,
9605
+ name,
9606
+ label,
9607
+ value,
9608
+ size,
9609
+ views = {},
9610
+ options = [],
9611
+ onChange = () => {},
9612
+ setValue = () => {}
9613
+ } = _ref,
9614
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$u);
9615
+ var {
9616
+ getColor
9617
+ } = appStudio.useTheme();
9618
+ var handleCallback = React.useCallback(option => {
9619
+ setValue(option.value);
9620
+ if (onChange) onChange(option.value);
9621
+ }, [setValue, onChange]);
9622
+ return /*#__PURE__*/React__default.createElement(FieldContainer, {
9623
+ id: id,
9624
+ width: "100%",
9625
+ views: views
9626
+ }, label && (/*#__PURE__*/React__default.createElement(appStudio.Horizontal, {
9627
+ fontSize: "10px",
9628
+ letterSpacing: "wider",
9629
+ color: "color.black.500",
9630
+ fontWeight: "bold",
9631
+ marginBottom: 12,
9632
+ alignItems: "center",
9633
+ gap: 6,
9634
+ //Text transform uppercase
9635
+ style: {
9636
+ textTransform: 'uppercase'
9637
+ }
9638
+ }, /*#__PURE__*/React__default.createElement(InfoIcon, {
9639
+ widthHeight: 14
9640
+ }), " ", /*#__PURE__*/React__default.createElement(appStudio.Text, null, label))), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, {
9641
+ gap: 0
9642
+ }, options.map((option, index, arr) => {
9643
+ var isSelected = value === option.value;
9644
+ var borderColor = getColor('color.gray.200');
9645
+ var textColor = getColor('color.gray.500');
9646
+ var bgColor = 'transparent';
9647
+ if (isSelected) {
9648
+ if (option.color) {
9649
+ // We need a way to get related colors (50, 500, 700 etc) from a base color if we want full fidelity.
9650
+ // But passing full style strings is easier.
9651
+ borderColor = getColor(option.color);
9652
+ textColor = getColor(option.color);
9653
+ // Try to approximate background color if possible, or just use white/transparent.
9654
+ // Simplification: if color provided, use it for border/text.
9655
+ // Background is hard to derive without more specific props.
9656
+ // Let's try to use a very light opacity of the color for background.
9657
+ bgColor = 'rgba(0,0,0,0.05)'; // Generic active background
9658
+ } else {
9659
+ // Default active style
9660
+ var primary = getColor('theme.primary');
9661
+ borderColor = primary;
9662
+ textColor = primary;
9663
+ bgColor = 'color.gray.50';
9664
+ }
9665
+ // Specific overrides based on user request "ComplexitySelector" style
9666
+ // If the values match 'High', 'Medium', 'Low' we can hardcode for *demo* fidelity if generic logic fails.
9667
+ // But let's try to make it generic.
9668
+ // The user simply pasted code.
9669
+ if (option.color) {
9670
+ // Fallback for customized options
9671
+ borderColor = getColor(option.color);
9672
+ textColor = getColor(option.color);
9673
+ bgColor = 'transparent';
9674
+ } else {
9675
+ // Default fallback
9676
+ borderColor = getColor('theme.primary');
9677
+ textColor = getColor('theme.primary');
9678
+ bgColor = 'transparent';
9679
+ }
9680
+ }
9681
+ return /*#__PURE__*/React__default.createElement(Button, Object.assign({
9682
+ key: option.value,
9683
+ onClick: () => handleCallback(option),
9684
+ flex: 1
9685
+ }, size ? {
9686
+ size
9687
+ } : {
9688
+ // Legacy default: keep existing compact look when `size` isn't specified.
9689
+ paddingVertical: 6,
9690
+ fontSize: '12px'
9691
+ }, {
9692
+ fontWeight: isSelected ? 'bold' : 'normal',
9693
+ style: {
9694
+ borderTop: "1px solid " + (isSelected ? borderColor : getColor('color.gray.200')),
9695
+ borderBottom: "1px solid " + (isSelected ? borderColor : getColor('color.gray.200')),
9696
+ borderLeft: "1px solid " + (isSelected ? borderColor : getColor('color.gray.200')),
9697
+ borderRight: index === arr.length - 1 || isSelected ? "1px solid " + (isSelected ? borderColor : getColor('color.gray.200')) : 'none',
9698
+ backgroundColor: bgColor,
9699
+ color: textColor,
9700
+ borderRadius: index === 0 ? '6px 0 0 6px' : index === arr.length - 1 ? '0 6px 6px 0' : '0',
9701
+ zIndex: isSelected ? 1 : 0,
9702
+ boxShadow: 'none'
9703
+ }
9704
+ }, views.item), option.label);
9705
+ })), /*#__PURE__*/React__default.createElement("input", {
9706
+ type: "hidden",
9707
+ id: id,
9708
+ name: name,
9709
+ value: Array.isArray(value) ? value.join(',') : value,
9710
+ onChange: () => {}
9711
+ }));
9712
+ };
9713
+
9714
+ // Defines a functional component named 'SelectorComponent', which is expected to receive 'SelectorProps' as properties.
9715
+ var SelectorComponent = props => {
9716
+ // Ensure options is always an array
9717
+ var safeProps = Object.assign({}, props, {
9718
+ options: props.options || []
9719
+ });
9720
+ // Invokes the 'useSelectorState' hook with props to obtain stateful logic for the Selector component.
9721
+ var selectorStates = useSelectorState(safeProps);
9722
+ // Renders the 'SelectorView' component, passing along any states controlled by 'useSelectorState' and all properties passed to 'SelectorComponent'.
9723
+ return /*#__PURE__*/React__default.createElement(SelectorView, Object.assign({}, selectorStates, safeProps, {
9724
+ onClick: e => {
9725
+ // Stop propagation to prevent the global click handler from closing other dropdowns
9726
+ e.stopPropagation();
9727
+ if (props.onClick) props.onClick(e);
9728
+ }
9729
+ }));
9730
+ };
9731
+ // Exports 'SelectorComponent' as 'Selector', making it available for import in other parts of the application.
9732
+ var Selector = SelectorComponent;
9733
+
9559
9734
  // Declaration of the useTextAreaState custom hook for managing the text area component state.
9560
9735
  var useTextAreaState = _ref => {
9561
9736
  var {
@@ -9588,7 +9763,7 @@ var useTextAreaState = _ref => {
9588
9763
  // Export of the useTextAreaState hook for external usage.
9589
9764
  };
9590
9765
 
9591
- var _excluded$u = ["id", "name", "hint", "error", "value", "label", "shadow", "helperText", "placeholder", "size", "shape", "variant", "isHovered", "isFocused", "isEditable", "isReadOnly", "isDisabled", "isAutoFocus", "isMultiline", "maxRows", "maxCols", "onBlur", "onChange", "onFocus", "setHint", "setValue", "setIsFocused", "setIsHovered", "views"];
9766
+ var _excluded$v = ["id", "name", "hint", "error", "value", "label", "shadow", "helperText", "placeholder", "size", "shape", "variant", "isHovered", "isFocused", "isEditable", "isReadOnly", "isDisabled", "isAutoFocus", "isMultiline", "maxRows", "maxCols", "onBlur", "onChange", "onFocus", "setHint", "setValue", "setIsFocused", "setIsHovered", "views"];
9592
9767
  var TextAreaView = _ref => {
9593
9768
  var {
9594
9769
  id,
@@ -9623,7 +9798,7 @@ var TextAreaView = _ref => {
9623
9798
  helperText: {}
9624
9799
  }
9625
9800
  } = _ref,
9626
- props = _objectWithoutPropertiesLoose(_ref, _excluded$u);
9801
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$v);
9627
9802
  var showLabel = !!(isFocused && label);
9628
9803
  /**
9629
9804
  * Styles for the textarea field
@@ -9762,7 +9937,7 @@ var useTextFieldState = _ref => {
9762
9937
  };
9763
9938
  };
9764
9939
 
9765
- var _excluded$v = ["id", "name", "label", "hint", "value", "onChange", "left", "right", "helperText", "placeholder", "onChangeText", "shadow", "views", "size", "shape", "variant", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isClearable", "isAutoFocus", "setHint", "setIsFocused", "setIsHovered", "setValue", "onClick", "onFocus", "onBlur", "themeMode"];
9940
+ var _excluded$w = ["id", "name", "label", "hint", "value", "onChange", "left", "right", "helperText", "placeholder", "onChangeText", "shadow", "views", "size", "shape", "variant", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isClearable", "isAutoFocus", "setHint", "setIsFocused", "setIsHovered", "setValue", "onClick", "onFocus", "onBlur", "themeMode"];
9766
9941
  /**
9767
9942
  * Input component for text fields
9768
9943
  */
@@ -9808,7 +9983,7 @@ var TextFieldView = _ref => {
9808
9983
  onBlur = () => {},
9809
9984
  themeMode: elementMode
9810
9985
  } = _ref,
9811
- props = _objectWithoutPropertiesLoose(_ref, _excluded$v);
9986
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$w);
9812
9987
  var {
9813
9988
  getColor,
9814
9989
  themeMode
@@ -10087,7 +10262,7 @@ var StateStyles = {
10087
10262
  }
10088
10263
  };
10089
10264
 
10090
- var _excluded$w = ["id", "icon", "name", "label", "isChecked", "onChange", "onValueChange", "shadow", "labelPosition", "size", "error", "isSelected", "isHovered", "isDisabled", "isReadOnly", "isIndeterminate", "defaultIsSelected", "setIsSelected", "setIsHovered", "views", "infoText", "helperText"];
10265
+ var _excluded$x = ["id", "icon", "name", "label", "isChecked", "onChange", "onValueChange", "shadow", "labelPosition", "size", "error", "isSelected", "isHovered", "isDisabled", "isReadOnly", "isIndeterminate", "defaultIsSelected", "setIsSelected", "setIsHovered", "views", "infoText", "helperText"];
10091
10266
  var CheckboxView = _ref => {
10092
10267
  var {
10093
10268
  id,
@@ -10114,7 +10289,7 @@ var CheckboxView = _ref => {
10114
10289
  },
10115
10290
  infoText
10116
10291
  } = _ref,
10117
- props = _objectWithoutPropertiesLoose(_ref, _excluded$w);
10292
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$x);
10118
10293
  var handleHover = () => setIsHovered(!isHovered);
10119
10294
  var handleChange = () => {
10120
10295
  if (!isReadOnly && !isDisabled) {
@@ -10572,7 +10747,7 @@ var DefaultColorPalette = [
10572
10747
  value: 'transparent'
10573
10748
  }];
10574
10749
 
10575
- var _excluded$x = ["id", "name", "label", "placeholder", "helperText", "views", "size", "shape", "variant", "shadow", "error", "isDisabled", "isReadOnly", "isFocused", "isHovered", "predefinedColors", "showCustomInput", "showRecentColors", "isOpen", "selectedColor", "recentColors", "customColor", "handleToggle", "handleColorSelect", "handleCustomColorChange", "handleCustomColorSubmit", "setIsFocused", "setIsHovered", "triggerRef", "dropdownRef"];
10750
+ var _excluded$y = ["id", "name", "label", "placeholder", "helperText", "views", "size", "shape", "variant", "shadow", "error", "isDisabled", "isReadOnly", "isFocused", "isHovered", "predefinedColors", "showCustomInput", "showRecentColors", "isOpen", "selectedColor", "recentColors", "customColor", "handleToggle", "handleColorSelect", "handleCustomColorChange", "handleCustomColorSubmit", "setIsFocused", "setIsHovered", "triggerRef", "dropdownRef"];
10576
10751
  var ColorInputView = _ref => {
10577
10752
  var {
10578
10753
  // Basic props
@@ -10613,7 +10788,7 @@ var ColorInputView = _ref => {
10613
10788
  dropdownRef
10614
10789
  // Other props
10615
10790
  } = _ref,
10616
- props = _objectWithoutPropertiesLoose(_ref, _excluded$x);
10791
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
10617
10792
  var {
10618
10793
  getColor
10619
10794
  } = appStudio.useTheme();
@@ -12252,11 +12427,11 @@ var IconSizes$4 = {
12252
12427
  xl: 16
12253
12428
  };
12254
12429
 
12255
- var _excluded$y = ["size"],
12430
+ var _excluded$z = ["size"],
12256
12431
  _excluded2$9 = ["size"],
12257
12432
  _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"];
12258
12433
  var CountryList = _ref => {
12259
- var props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
12434
+ var props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
12260
12435
  return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
12261
12436
  as: "ul"
12262
12437
  }, props));
@@ -12494,7 +12669,7 @@ var useDatePickerState = () => {
12494
12669
  };
12495
12670
  };
12496
12671
 
12497
- var _excluded$z = ["id", "icon", "name", "label", "date", "children", "helperText", "shadow", "size", "variant", "shape", "views", "error", "isHovered", "isFocused", "isDisabled", "isReadOnly", "setDate", "setIsFocused", "setIsHovered", "onChange", "onChangeText"];
12672
+ var _excluded$A = ["id", "icon", "name", "label", "date", "children", "helperText", "shadow", "size", "variant", "shape", "views", "error", "isHovered", "isFocused", "isDisabled", "isReadOnly", "setDate", "setIsFocused", "setIsHovered", "onChange", "onChangeText"];
12498
12673
  var DatePickerContent = props => /*#__PURE__*/React__default.createElement(appStudio.Input, Object.assign({
12499
12674
  type: "date"
12500
12675
  }, props));
@@ -12527,7 +12702,7 @@ var DatePickerView = _ref => {
12527
12702
  onChange,
12528
12703
  onChangeText
12529
12704
  } = _ref,
12530
- props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
12705
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
12531
12706
  var showLabel = !!(isFocused && label);
12532
12707
  var handleHover = () => setIsHovered(!isHovered);
12533
12708
  var handleFocus = () => setIsFocused(true);
@@ -12614,7 +12789,7 @@ var usePasswordState = props => {
12614
12789
  }, props, textFieldStates);
12615
12790
  };
12616
12791
 
12617
- var _excluded$A = ["visibleIcon", "hiddenIcon"],
12792
+ var _excluded$B = ["visibleIcon", "hiddenIcon"],
12618
12793
  _excluded2$a = ["isVisible", "setIsVisible"];
12619
12794
  var PasswordComponent = _ref => {
12620
12795
  var {
@@ -12625,7 +12800,7 @@ var PasswordComponent = _ref => {
12625
12800
  widthHeight: 14
12626
12801
  })
12627
12802
  } = _ref,
12628
- props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
12803
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
12629
12804
  var _usePasswordState = usePasswordState(props),
12630
12805
  {
12631
12806
  isVisible,
@@ -12679,7 +12854,7 @@ var useComboBoxState = (items, placeholder, searchPlaceholder) => {
12679
12854
  };
12680
12855
  };
12681
12856
 
12682
- var _excluded$B = ["placeholder", "items", "showTick", "onSelect", "searchEnabled", "left", "right", "label", "filteredItems", "setSelectedItem", "selectedItem", "highlightedIndex", "setHighlightedIndex", "searchQuery", "setSearchQuery", "setFilteredItems", "views", "isDropdownVisible", "setIsDropdownVisible"];
12857
+ var _excluded$C = ["placeholder", "items", "showTick", "onSelect", "searchEnabled", "left", "right", "label", "filteredItems", "setSelectedItem", "selectedItem", "highlightedIndex", "setHighlightedIndex", "searchQuery", "setSearchQuery", "setFilteredItems", "views", "isDropdownVisible", "setIsDropdownVisible"];
12683
12858
  // Defines the functional component 'ComboBoxView' with destructured props.
12684
12859
  var ComboBoxView = _ref => {
12685
12860
  var {
@@ -12704,7 +12879,7 @@ var ComboBoxView = _ref => {
12704
12879
  setIsDropdownVisible
12705
12880
  // Collects all further props not destructured explicitly.
12706
12881
  } = _ref,
12707
- props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
12882
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
12708
12883
  var {
12709
12884
  ref: triggerRef,
12710
12885
  relation
@@ -12883,7 +13058,7 @@ var ComboBoxView = _ref => {
12883
13058
  }, "No items found")))))));
12884
13059
  };
12885
13060
 
12886
- var _excluded$C = ["id", "name", "items", "placeholder", "searchPlaceholder"];
13061
+ var _excluded$D = ["id", "name", "items", "placeholder", "searchPlaceholder"];
12887
13062
  // Defines the ComboBoxComponent functional component with ComboBoxProps
12888
13063
  var ComboBoxComponent = _ref => {
12889
13064
  var {
@@ -12899,7 +13074,7 @@ var ComboBoxComponent = _ref => {
12899
13074
  searchPlaceholder
12900
13075
  // Destructures the rest of the props not explicitly defined
12901
13076
  } = _ref,
12902
- props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
13077
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$D);
12903
13078
  // Initializes ComboBox state using custom hook with items and placeholders
12904
13079
  var state = useComboBoxState(items, placeholder, searchPlaceholder);
12905
13080
  return (
@@ -13108,7 +13283,7 @@ var useTagInputState = props => {
13108
13283
  };
13109
13284
  };
13110
13285
 
13111
- var _excluded$D = ["id", "name", "label", "placeholder", "helperText", "error", "inputValue", "tags", "left", "right", "shadow", "views", "size", "shape", "variant", "isDisabled", "isReadOnly", "isAutoFocus", "isRemovable", "isFocused", "isHovered", "maxTags", "handleInputChange", "handleKeyDown", "handleFocus", "handleBlur", "removeTag", "setIsHovered", "onClick"];
13286
+ var _excluded$E = ["id", "name", "label", "placeholder", "helperText", "error", "inputValue", "tags", "left", "right", "shadow", "views", "size", "shape", "variant", "isDisabled", "isReadOnly", "isAutoFocus", "isRemovable", "isFocused", "isHovered", "maxTags", "handleInputChange", "handleKeyDown", "handleFocus", "handleBlur", "removeTag", "setIsHovered", "onClick"];
13112
13287
  /**
13113
13288
  * Individual tag chip component
13114
13289
  */
@@ -13233,7 +13408,7 @@ var TagInputView = _ref2 => {
13233
13408
  setIsHovered,
13234
13409
  onClick
13235
13410
  } = _ref2,
13236
- props = _objectWithoutPropertiesLoose(_ref2, _excluded$D);
13411
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded$E);
13237
13412
  var {
13238
13413
  getColor,
13239
13414
  themeMode
@@ -13316,7 +13491,7 @@ var TagInputView = _ref2 => {
13316
13491
  }, views == null ? void 0 : views.placeholder), "Maximum ", maxTags, " tags reached")))), right));
13317
13492
  };
13318
13493
 
13319
- var _excluded$E = ["tags"];
13494
+ var _excluded$F = ["tags"];
13320
13495
  /**
13321
13496
  * TagInput Component
13322
13497
  *
@@ -13328,7 +13503,7 @@ var TagInputComponent = props => {
13328
13503
  // Initialize state management with the custom hook
13329
13504
  var tagInputState = useTagInputState(props);
13330
13505
  // Separate the tags prop to avoid type conflicts
13331
- var restProps = _objectWithoutPropertiesLoose(props, _excluded$E);
13506
+ var restProps = _objectWithoutPropertiesLoose(props, _excluded$F);
13332
13507
  // Render the view component with combined props and state
13333
13508
  return /*#__PURE__*/React__default.createElement(TagInputView, Object.assign({}, tagInputState, restProps));
13334
13509
  };
@@ -13641,7 +13816,7 @@ var useOTPInputState = _ref => {
13641
13816
  };
13642
13817
  };
13643
13818
 
13644
- var _excluded$F = ["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"];
13819
+ var _excluded$G = ["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"];
13645
13820
  // Create a context for OTP input slots
13646
13821
  var OTPInputContext = /*#__PURE__*/React.createContext({
13647
13822
  slots: [],
@@ -13695,7 +13870,7 @@ var OTPInputView = _ref => {
13695
13870
  onFocus = () => {}
13696
13871
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
13697
13872
  } = _ref,
13698
- props = _objectWithoutPropertiesLoose(_ref, _excluded$F);
13873
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$G);
13699
13874
  appStudio.useTheme(); // Initialize theme context
13700
13875
  var showLabel = !!label;
13701
13876
  // Create context value for slots
@@ -13927,7 +14102,7 @@ var OTPInputComponent = props => {
13927
14102
  };
13928
14103
  var OTPInput = OTPInputComponent;
13929
14104
 
13930
- var _excluded$G = ["children", "autoFocus", "initFocus", "onChange"];
14105
+ var _excluded$H = ["children", "autoFocus", "initFocus", "onChange"];
13931
14106
  var FocusContext = /*#__PURE__*/React.createContext({
13932
14107
  active: false,
13933
14108
  focusNextInput: () => {},
@@ -13943,7 +14118,7 @@ var FormikForm = _ref => {
13943
14118
  initFocus,
13944
14119
  onChange = () => {}
13945
14120
  } = _ref,
13946
- props = _objectWithoutPropertiesLoose(_ref, _excluded$G);
14121
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$H);
13947
14122
  var formik$1 = formik.useFormikContext();
13948
14123
  React.useEffect(() => {
13949
14124
  onChange(formik$1.values);
@@ -13991,7 +14166,7 @@ var FormikForm = _ref => {
13991
14166
  }, /*#__PURE__*/React__default.createElement(appStudio.Form, Object.assign({}, props), children));
13992
14167
  };
13993
14168
 
13994
- var _excluded$H = ["name", "type"];
14169
+ var _excluded$I = ["name", "type"];
13995
14170
  var getInputTypeProps = type => {
13996
14171
  switch (type) {
13997
14172
  case 'email':
@@ -14030,7 +14205,7 @@ var useFormikInput = _ref => {
14030
14205
  name,
14031
14206
  type
14032
14207
  } = _ref,
14033
- props = _objectWithoutPropertiesLoose(_ref, _excluded$H);
14208
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$I);
14034
14209
  var focus = useFormFocus();
14035
14210
  var {
14036
14211
  touched,
@@ -14074,13 +14249,13 @@ var useFormikInput = _ref => {
14074
14249
  } : {});
14075
14250
  };
14076
14251
 
14077
- var _excluded$I = ["value"];
14252
+ var _excluded$J = ["value"];
14078
14253
  var CheckboxComponent$1 = props => {
14079
14254
  var _useFormikInput = useFormikInput(props),
14080
14255
  {
14081
14256
  value
14082
14257
  } = _useFormikInput,
14083
- formProps = _objectWithoutPropertiesLoose(_useFormikInput, _excluded$I);
14258
+ formProps = _objectWithoutPropertiesLoose(_useFormikInput, _excluded$J);
14084
14259
  formProps.isChecked = value;
14085
14260
  var checkboxStates = useCheckboxState(props);
14086
14261
  return /*#__PURE__*/React__default.createElement(CheckboxView, Object.assign({}, checkboxStates, formProps));
@@ -14800,7 +14975,7 @@ var useHoverCardState = function useHoverCardState(_temp) {
14800
14975
  };
14801
14976
  };
14802
14977
 
14803
- var _excluded$J = ["children", "views", "asChild"],
14978
+ var _excluded$K = ["children", "views", "asChild"],
14804
14979
  _excluded2$b = ["children", "views", "side", "align", "sideOffset", "style", "backgroundColor", "borderRadius", "boxShadow", "padding", "minWidth", "maxWidth"];
14805
14980
  // Create context for the HoverCard
14806
14981
  var HoverCardContext = /*#__PURE__*/React.createContext({
@@ -14839,7 +15014,7 @@ var HoverCardTrigger = _ref2 => {
14839
15014
  views,
14840
15015
  asChild = false
14841
15016
  } = _ref2,
14842
- props = _objectWithoutPropertiesLoose(_ref2, _excluded$J);
15017
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded$K);
14843
15018
  var {
14844
15019
  openCard,
14845
15020
  closeCard,
@@ -15009,7 +15184,7 @@ var HoverCardContent = _ref3 => {
15009
15184
  }, views == null ? void 0 : views.container, props), children);
15010
15185
  };
15011
15186
 
15012
- var _excluded$K = ["children", "views", "openDelay", "closeDelay"];
15187
+ var _excluded$L = ["children", "views", "openDelay", "closeDelay"];
15013
15188
  /**
15014
15189
  * HoverCard component displays floating content when hovering over a trigger element.
15015
15190
  * Supports configurable open and close delays for a smoother user experience.
@@ -15021,7 +15196,7 @@ var HoverCardComponent = _ref => {
15021
15196
  openDelay,
15022
15197
  closeDelay
15023
15198
  } = _ref,
15024
- props = _objectWithoutPropertiesLoose(_ref, _excluded$K);
15199
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$L);
15025
15200
  var hoverCardState = useHoverCardState({
15026
15201
  openDelay,
15027
15202
  closeDelay
@@ -15633,7 +15808,7 @@ var AudioRecorder = _ref => {
15633
15808
  }))));
15634
15809
  };
15635
15810
 
15636
- var _excluded$L = ["onSubmit", "placeholder", "loading", "disabled", "isAgentRunning", "enableAudioRecording", "leftButtons", "rightButtons", "onStopAgent", "loadingText", "autoFocus", "sandboxId", "hideAttachments", "attachmentText", "promptExamples", "suggestions", "errorMessage", "size", "shape", "variant", "views", "mentionData", "mentionTrigger", "onMentionSelect", "onAudioRecordingStart", "onAudioRecordingStop", "value", "handleChange", "handleSubmit", "editableRef", "fileInputRef", "isUploading", "uploadProgress", "isDraggingOver", "uploadedFiles", "removeUploadedFile", "setPendingFiles", "setUploadedFiles", "setIsUploading", "startUpload", "selectedModel", "handleModelChange", "modelOptions", "subscriptionStatus", "canAccessModel", "isGuideTipShown", "hideGuideTip", "handlePromptExampleSelect", "handleDragOver", "handleDragLeave"];
15811
+ var _excluded$M = ["onSubmit", "placeholder", "loading", "disabled", "isAgentRunning", "enableAudioRecording", "leftButtons", "rightButtons", "onStopAgent", "loadingText", "autoFocus", "sandboxId", "hideAttachments", "attachmentText", "promptExamples", "suggestions", "errorMessage", "size", "shape", "variant", "views", "mentionData", "mentionTrigger", "onMentionSelect", "onAudioRecordingStart", "onAudioRecordingStop", "value", "handleChange", "handleSubmit", "editableRef", "fileInputRef", "isUploading", "uploadProgress", "isDraggingOver", "uploadedFiles", "removeUploadedFile", "setPendingFiles", "setUploadedFiles", "setIsUploading", "startUpload", "selectedModel", "handleModelChange", "modelOptions", "subscriptionStatus", "canAccessModel", "isGuideTipShown", "hideGuideTip", "handlePromptExampleSelect", "handleDragOver", "handleDragLeave"];
15637
15812
  var ChatInputView = _ref => {
15638
15813
  var _value$trim$length;
15639
15814
  var {
@@ -15678,7 +15853,7 @@ var ChatInputView = _ref => {
15678
15853
  handleDragLeave
15679
15854
  // Other props
15680
15855
  } = _ref,
15681
- props = _objectWithoutPropertiesLoose(_ref, _excluded$L);
15856
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$M);
15682
15857
  var {} = appStudio.useTheme();
15683
15858
  // Combine styles
15684
15859
  var containerStyles = Object.assign({}, DefaultChatInputStyles.container, Shapes$2[shape], views == null ? void 0 : views.container);
@@ -15905,13 +16080,13 @@ var ChatInputView = _ref => {
15905
16080
  }, views == null ? void 0 : views.bottomTip), errorMessage)));
15906
16081
  };
15907
16082
 
15908
- var _excluded$M = ["name", "onSubmit"];
16083
+ var _excluded$N = ["name", "onSubmit"];
15909
16084
  var ChatInputComponent = props => {
15910
16085
  var {
15911
16086
  name,
15912
16087
  onSubmit
15913
16088
  } = props,
15914
- chatInputProps = _objectWithoutPropertiesLoose(props, _excluded$M);
16089
+ chatInputProps = _objectWithoutPropertiesLoose(props, _excluded$N);
15915
16090
  // State for managing pending files
15916
16091
  var [pendingFiles, setPendingFiles] = React.useState([]);
15917
16092
  // Get Formik integration props
@@ -16008,7 +16183,7 @@ var SwitchComponent$1 = props => {
16008
16183
  };
16009
16184
  var FormikSwitch = SwitchComponent$1;
16010
16185
 
16011
- var _excluded$N = ["name"],
16186
+ var _excluded$O = ["name"],
16012
16187
  _excluded2$c = ["tags"];
16013
16188
  /**
16014
16189
  * Formik-integrated TagInput component
@@ -16017,7 +16192,7 @@ var TagInputComponent$1 = props => {
16017
16192
  var {
16018
16193
  name
16019
16194
  } = props,
16020
- restProps = _objectWithoutPropertiesLoose(props, _excluded$N);
16195
+ restProps = _objectWithoutPropertiesLoose(props, _excluded$O);
16021
16196
  // Get Formik context directly for better control
16022
16197
  var {
16023
16198
  values,
@@ -16075,11 +16250,11 @@ var TextAreaComponent$1 = props => {
16075
16250
  */
16076
16251
  var FormikTextArea = TextAreaComponent$1;
16077
16252
 
16078
- var _excluded$O = ["value"];
16253
+ var _excluded$P = ["value"];
16079
16254
  var TextFieldComponent$1 = props => {
16080
16255
  var formProps = useFormikInput(props);
16081
16256
  var _useTextFieldState = useTextFieldState(props),
16082
- textFieldStates = _objectWithoutPropertiesLoose(_useTextFieldState, _excluded$O);
16257
+ textFieldStates = _objectWithoutPropertiesLoose(_useTextFieldState, _excluded$P);
16083
16258
  return /*#__PURE__*/React__default.createElement(TextFieldView, Object.assign({}, textFieldStates, formProps));
16084
16259
  };
16085
16260
  /**
@@ -16087,7 +16262,7 @@ var TextFieldComponent$1 = props => {
16087
16262
  */
16088
16263
  var FormikTextField = TextFieldComponent$1;
16089
16264
 
16090
- var _excluded$P = ["visibleIcon", "hiddenIcon"],
16265
+ var _excluded$Q = ["visibleIcon", "hiddenIcon"],
16091
16266
  _excluded2$d = ["isVisible", "setIsVisible"];
16092
16267
  var PasswordComponent$1 = _ref => {
16093
16268
  var {
@@ -16098,7 +16273,7 @@ var PasswordComponent$1 = _ref => {
16098
16273
  widthHeight: 14
16099
16274
  })
16100
16275
  } = _ref,
16101
- props = _objectWithoutPropertiesLoose(_ref, _excluded$P);
16276
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$Q);
16102
16277
  var formProps = useFormikInput(props);
16103
16278
  var _usePasswordState = usePasswordState(formProps),
16104
16279
  {
@@ -16123,14 +16298,14 @@ var PasswordComponent$1 = _ref => {
16123
16298
  */
16124
16299
  var FormikPassword = PasswordComponent$1;
16125
16300
 
16126
- var _excluded$Q = ["items", "placeholder", "searchPlaceholder"];
16301
+ var _excluded$R = ["items", "placeholder", "searchPlaceholder"];
16127
16302
  var ComboBoxComponent$1 = _ref => {
16128
16303
  var {
16129
16304
  items,
16130
16305
  placeholder,
16131
16306
  searchPlaceholder
16132
16307
  } = _ref,
16133
- props = _objectWithoutPropertiesLoose(_ref, _excluded$Q);
16308
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$R);
16134
16309
  var formProps = useFormikInput(props);
16135
16310
  var ComboBoxStates = useComboBoxState(items, placeholder, searchPlaceholder);
16136
16311
  // Ensure the onChange function from formProps is being called when an item is selected
@@ -16413,7 +16588,7 @@ var OrientationStyles = {
16413
16588
  }
16414
16589
  };
16415
16590
 
16416
- var _excluded$R = ["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"];
16591
+ var _excluded$S = ["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"];
16417
16592
  var SliderView = _ref => {
16418
16593
  var _views$tooltip, _views$tooltip2;
16419
16594
  var {
@@ -16456,7 +16631,7 @@ var SliderView = _ref => {
16456
16631
  tooltip: {}
16457
16632
  }
16458
16633
  } = _ref,
16459
- props = _objectWithoutPropertiesLoose(_ref, _excluded$R);
16634
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$S);
16460
16635
  var {
16461
16636
  getColor,
16462
16637
  themeMode
@@ -16779,7 +16954,7 @@ var OTPInputComponent$1 = props => {
16779
16954
  */
16780
16955
  var FormikOTPInput = OTPInputComponent$1;
16781
16956
 
16782
- var _excluded$S = ["name", "uploadFile", "onUploadSuccess", "onUploadError", "transformResponse", "onMultipleFileSelect", "onFileSelect", "multiple"];
16957
+ var _excluded$T = ["name", "uploadFile", "onUploadSuccess", "onUploadError", "transformResponse", "onMultipleFileSelect", "onFileSelect", "multiple"];
16783
16958
  var defaultUploadFile = (file, onProgress) => {
16784
16959
  return api.UploadService.uploadControllerFile({
16785
16960
  file
@@ -16805,7 +16980,7 @@ var FormikUploader = _ref => {
16805
16980
  onFileSelect,
16806
16981
  multiple = true
16807
16982
  } = _ref,
16808
- props = _objectWithoutPropertiesLoose(_ref, _excluded$S);
16983
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$T);
16809
16984
  var {
16810
16985
  setFieldValue,
16811
16986
  setFieldTouched,
@@ -16875,156 +17050,7 @@ var FormikUploader = _ref => {
16875
17050
  };
16876
17051
  FormikUploader.displayName = 'FormikUploader';
16877
17052
 
16878
- // Initializes the custom hook 'useSelectorState' for managing the state of the Selector component
16879
- var useSelectorState = _ref => {
16880
- var {
16881
- placeholder,
16882
- isMulti,
16883
- options,
16884
- id = "selector-" + Math.random().toString(36).substr(2, 9)
16885
- } = _ref;
16886
- // Determines the default value based on the 'placeholder' and 'isMulti' props, setting to an empty array for multi-select or an empty string/single default option
16887
- var defaultValue = placeholder ? isMulti ? [] : '' // If there's a placeholder, set default to empty array for multi-select or empty string for single select
16888
- : Array.isArray(options) && options.length > 0 ? options[0].value : isMulti ? [] : ''; // If no placeholder, use the first option value if available, otherwise empty array for multi-select or empty string for single select
16889
- // State hook for tracking mouse hover status over the Selector component
16890
- var [isHovered, setIsHovered] = React__default.useState(false);
16891
- // State hook for tracking focus status of the Selector input field
16892
- var [isFocused, setIsFocused] = React__default.useState(false);
16893
- // State hook for managing the value(s) selected by the user, initialized with the default value
16894
- var [value, setValue] = React__default.useState(defaultValue);
16895
- // State hook for keeping track of the currently highlighted index in the options list
16896
- var [highlightedIndex, setHighlightedIndex] = React__default.useState(0);
16897
- // State hook for managing visibility of the Selector dropdown, initially set to hidden
16898
- var [hide, setHide] = React__default.useState(true);
16899
- // Returns an object containing all stateful values and their associated setters to manage the Selector component's state
16900
- return {
16901
- id,
16902
- value,
16903
- setValue,
16904
- hide,
16905
- setHide,
16906
- isHovered,
16907
- setIsHovered,
16908
- isFocused,
16909
- setIsFocused,
16910
- highlightedIndex,
16911
- setHighlightedIndex
16912
- };
16913
- };
16914
-
16915
- var _excluded$T = ["id", "name", "label", "value", "views", "options", "onChange", "setValue"];
16916
- /**
16917
- * SelectorView Component
16918
- *
16919
- * Renders a segmented control style selector.
16920
- */
16921
- var SelectorView = _ref => {
16922
- var {
16923
- id,
16924
- name,
16925
- label,
16926
- value,
16927
- views = {},
16928
- options = [],
16929
- onChange = () => {},
16930
- setValue = () => {}
16931
- } = _ref,
16932
- props = _objectWithoutPropertiesLoose(_ref, _excluded$T);
16933
- var {
16934
- getColor
16935
- } = appStudio.useTheme();
16936
- var handleCallback = React.useCallback(option => {
16937
- setValue(option.value);
16938
- if (onChange) onChange(option.value);
16939
- }, [setValue, onChange]);
16940
- return /*#__PURE__*/React__default.createElement(FieldContainer, {
16941
- id: id,
16942
- width: "100%",
16943
- views: views
16944
- }, label && (/*#__PURE__*/React__default.createElement(appStudio.Horizontal, {
16945
- fontSize: "10px",
16946
- letterSpacing: "wider",
16947
- color: "color.black.500",
16948
- fontWeight: "bold",
16949
- marginBottom: 12,
16950
- alignItems: "center",
16951
- gap: 6,
16952
- //Text transform uppercase
16953
- style: {
16954
- textTransform: 'uppercase'
16955
- }
16956
- }, /*#__PURE__*/React__default.createElement(InfoIcon, {
16957
- widthHeight: 14
16958
- }), " ", /*#__PURE__*/React__default.createElement(appStudio.Text, null, label))), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, {
16959
- gap: 0
16960
- }, options.map((option, index, arr) => {
16961
- var isSelected = value === option.value;
16962
- var borderColor = getColor('color.gray.200');
16963
- var textColor = getColor('color.gray.500');
16964
- var bgColor = 'transparent';
16965
- if (isSelected) {
16966
- if (option.color) {
16967
- // We need a way to get related colors (50, 500, 700 etc) from a base color if we want full fidelity.
16968
- // But passing full style strings is easier.
16969
- borderColor = getColor(option.color);
16970
- textColor = getColor(option.color);
16971
- // Try to approximate background color if possible, or just use white/transparent.
16972
- // Simplification: if color provided, use it for border/text.
16973
- // Background is hard to derive without more specific props.
16974
- // Let's try to use a very light opacity of the color for background.
16975
- bgColor = 'rgba(0,0,0,0.05)'; // Generic active background
16976
- } else {
16977
- // Default active style
16978
- var primary = getColor('theme.primary');
16979
- borderColor = primary;
16980
- textColor = primary;
16981
- bgColor = 'color.gray.50';
16982
- }
16983
- // Specific overrides based on user request "ComplexitySelector" style
16984
- // If the values match 'High', 'Medium', 'Low' we can hardcode for *demo* fidelity if generic logic fails.
16985
- // But let's try to make it generic.
16986
- // The user simply pasted code.
16987
- if (option.color) {
16988
- // Fallback for customized options
16989
- borderColor = getColor(option.color);
16990
- textColor = getColor(option.color);
16991
- bgColor = 'transparent';
16992
- } else {
16993
- // Default fallback
16994
- borderColor = getColor('theme.primary');
16995
- textColor = getColor('theme.primary');
16996
- bgColor = getColor('color.blue.50');
16997
- }
16998
- }
16999
- return /*#__PURE__*/React__default.createElement(Button, Object.assign({
17000
- key: option.value,
17001
- onClick: () => handleCallback(option),
17002
- flex: 1,
17003
- paddingVertical: 6,
17004
- fontSize: "12px",
17005
- fontWeight: isSelected ? 'bold' : 'normal',
17006
- style: {
17007
- borderTop: "1px solid " + (isSelected ? borderColor : getColor('color.gray.200')),
17008
- borderBottom: "1px solid " + (isSelected ? borderColor : getColor('color.gray.200')),
17009
- borderLeft: "1px solid " + (isSelected ? borderColor : getColor('color.gray.200')),
17010
- borderRight: index === arr.length - 1 || isSelected ? "1px solid " + (isSelected ? borderColor : getColor('color.gray.200')) : 'none',
17011
- backgroundColor: bgColor,
17012
- color: textColor,
17013
- borderRadius: index === 0 ? '6px 0 0 6px' : index === arr.length - 1 ? '0 6px 6px 0' : '0',
17014
- zIndex: isSelected ? 1 : 0,
17015
- boxShadow: 'none'
17016
- }
17017
- }, views.item), option.label);
17018
- })), /*#__PURE__*/React__default.createElement("input", {
17019
- type: "hidden",
17020
- id: id,
17021
- name: name,
17022
- value: Array.isArray(value) ? value.join(',') : value,
17023
- onChange: () => {}
17024
- }));
17025
- };
17026
-
17027
- var SelectorComponent = props => {
17053
+ var SelectorComponent$1 = props => {
17028
17054
  var formProps = useFormikInput(props);
17029
17055
  formProps.selected = formProps.value;
17030
17056
  var selectorStates = useSelectorState(props);
@@ -17033,7 +17059,7 @@ var SelectorComponent = props => {
17033
17059
  /**
17034
17060
  * Selector provides a dropdown list of options for the user to choose from.
17035
17061
  */
17036
- var FormikSelector = SelectorComponent;
17062
+ var FormikSelector = SelectorComponent$1;
17037
17063
 
17038
17064
  var AttachmentPreview = _ref => {
17039
17065
  var {
@@ -28382,6 +28408,7 @@ exports.RotateIcon = RotateIcon;
28382
28408
  exports.SaveIcon = SaveIcon;
28383
28409
  exports.SearchIcon = SearchIcon;
28384
28410
  exports.Select = Select;
28411
+ exports.Selector = Selector;
28385
28412
  exports.SendIcon = SendIcon;
28386
28413
  exports.Separator = Separator;
28387
28414
  exports.SettingsIcon = SettingsIcon;