@hexure/ui 1.14.4 → 1.14.6

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.
@@ -0,0 +1,39 @@
1
+ import { FC } from 'react';
2
+ import { AccessibleProps } from '../../utils/Accessibility';
3
+ import { CSSProperties } from 'styled-components';
4
+ export interface OptionProps {
5
+ label?: string;
6
+ value: string | number;
7
+ color?: string;
8
+ disabled?: boolean;
9
+ }
10
+ export interface OptionGroupProps {
11
+ options: OptionProps[];
12
+ label: string;
13
+ }
14
+ export interface styleProps {
15
+ borderRadius?: string;
16
+ flexGrow?: number;
17
+ width?: number | string;
18
+ }
19
+ export interface CustomSelectProps extends AccessibleProps {
20
+ options?: OptionProps[];
21
+ optionGroups?: OptionGroupProps[];
22
+ placeholder?: string;
23
+ searchable?: boolean;
24
+ readOnly?: boolean;
25
+ invalid?: boolean;
26
+ value?: string;
27
+ style?: CSSProperties;
28
+ onChange?: (value: string | number) => void;
29
+ onFocus?: (e: any) => void;
30
+ onBlur?: (e: any) => void;
31
+ onSearch?: (searchTerm: string) => void;
32
+ /** Optional ID for automation purposes */
33
+ dataItemid?: string;
34
+ isInvalidRedBackground?: boolean;
35
+ isWarningError?: boolean;
36
+ innerRef?: any;
37
+ }
38
+ declare const CustomSelect: FC<CustomSelectProps>;
39
+ export default CustomSelect;
@@ -0,0 +1,2 @@
1
+ export { default } from './CustomSelect';
2
+ export type { CustomSelectProps, OptionProps, OptionGroupProps } from './CustomSelect';
@@ -34,6 +34,7 @@ export interface SelectProps extends AccessibleProps {
34
34
  isInvalidRedBackground?: boolean;
35
35
  isWarningError?: boolean;
36
36
  innerRef?: any;
37
+ isCustomSelect?: boolean;
37
38
  }
38
39
  declare const Select: FC<SelectProps>;
39
40
  export default Select;
package/dist/esm/index.js CHANGED
@@ -2689,7 +2689,7 @@ const q = ({
2689
2689
  });
2690
2690
  });
2691
2691
 
2692
- const Wrapper$h = styled.div(props => ({
2692
+ const Wrapper$i = styled.div(props => ({
2693
2693
  display: 'inline-block',
2694
2694
  position: 'relative',
2695
2695
  height: props.$height || '16px',
@@ -2737,7 +2737,7 @@ const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, d
2737
2737
  const [show_content, toggleContent] = useState(false);
2738
2738
  const baseId = dataItemid || `tooltip-${Math.random().toString(36).slice(2, 9)}`;
2739
2739
  if (auto) {
2740
- return (React.createElement(Wrapper$h, { "data-itemid": `${baseId}-wrapper` },
2740
+ return (React.createElement(Wrapper$i, { "data-itemid": `${baseId}-wrapper` },
2741
2741
  React.createElement("style", null, `
2742
2742
  .custom-tooltip-arrow {
2743
2743
  box-shadow: 1px 1px 0 0 #0193D7; /* top border for arrow (matches border) */
@@ -2754,6 +2754,7 @@ const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, d
2754
2754
  z-index: 9999; /* Ensure tooltip is above other elements */
2755
2755
  position: absolute; /* Ensure z-index works */
2756
2756
  word-break: break-word; /* Prevents overflow of long words */
2757
+ opacity: 1;
2757
2758
  }
2758
2759
 
2759
2760
  `),
@@ -2761,7 +2762,7 @@ const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, d
2761
2762
  React.createElement(TooltipPortal, null,
2762
2763
  React.createElement(M, { className: 'custom-tooltip', classNameArrow: 'custom-tooltip-arrow', "data-itemid": `${baseId}-content`, id: `${baseId}-auto-tooltip-data-html`, render: () => React.createElement("p", { "data-itemid": `${baseId}-text` }, children) }))));
2763
2764
  }
2764
- return (React.createElement(Wrapper$h, { "$height": height, "data-itemid": `${baseId}-wrapper`, onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
2765
+ return (React.createElement(Wrapper$i, { "$height": height, "data-itemid": `${baseId}-wrapper`, onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
2765
2766
  trigger || React.createElement(StyledIcon$6, { "data-itemid": `${baseId}-icon`, path: mdiInformationOutline }),
2766
2767
  show_content ? (React.createElement(Content$3, { "$position": position, "$width": width, "data-itemid": `${baseId}-content` }, children && (React.createElement(Copy, { "data-itemid": `${baseId}-text`, type: 'small' }, children)))) : null));
2767
2768
  };
@@ -2989,7 +2990,7 @@ Heading.defaultProps = {
2989
2990
  type: 'primary',
2990
2991
  };
2991
2992
 
2992
- const Wrapper$g = styled.div `
2993
+ const Wrapper$h = styled.div `
2993
2994
  position: fixed;
2994
2995
  top: 0;
2995
2996
  right: 0;
@@ -3014,7 +3015,7 @@ const Buttons$1 = styled.div `
3014
3015
  const ActionDialog = (_a) => {
3015
3016
  var { description, title, primaryButton, secondaryButton, tertiaryButton, style = {}, dataItemid } = _a, accessibleProps = __rest(_a, ["description", "title", "primaryButton", "secondaryButton", "tertiaryButton", "style", "dataItemid"]);
3016
3017
  const baseId = dataItemid || 'action-dialog';
3017
- return (React.createElement(Wrapper$g, Object.assign({}, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
3018
+ return (React.createElement(Wrapper$h, Object.assign({}, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
3018
3019
  React.createElement(Container$5, { "$customStyle": style, "data-itemid": `${baseId}-container`, open: true },
3019
3020
  title ? (React.createElement(Heading, { "data-itemid": `${baseId}-title`, margin: '0px 0px 20px 0px', type: 'secondary' }, title)) : null,
3020
3021
  description ? (React.createElement(Copy, { align: 'center', "data-itemid": `${baseId}-description` }, description)) : null,
@@ -3024,7 +3025,7 @@ const ActionDialog = (_a) => {
3024
3025
  primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { "data-itemid": primaryButton.children || `${baseId}-${primaryButton.children}`, dataItemid: primaryButton.children || `${baseId}-${primaryButton.children}`, format: primaryButton.format || 'primary' }))) : null)) : null)));
3025
3026
  };
3026
3027
 
3027
- const Wrapper$f = styled.div `
3028
+ const Wrapper$g = styled.div `
3028
3029
  border: 1px solid #f1f1f1;
3029
3030
  border-radius: 4px;
3030
3031
  border-left-width: 4px;
@@ -3069,7 +3070,7 @@ const Alert = (_a) => {
3069
3070
  icon: mdiCheckboxMarkedCircleOutline,
3070
3071
  },
3071
3072
  };
3072
- return (React.createElement(Wrapper$f, Object.assign({}, accessibleProps, { "$small": small, "data-itemid": `${baseId}-wrapper`, style: { borderLeftColor: type_mapping[type].color } }),
3073
+ return (React.createElement(Wrapper$g, Object.assign({}, accessibleProps, { "$small": small, "data-itemid": `${baseId}-wrapper`, style: { borderLeftColor: type_mapping[type].color } }),
3073
3074
  React.createElement(StyledIcon$4, { color: type_mapping[type].color, "data-itemid": `${baseId}-icon`, path: type_mapping[type].icon, size: small ? '20px' : '30px' }),
3074
3075
  React.createElement("div", { "data-itemid": `${baseId}-content` },
3075
3076
  title && !small ? (React.createElement(Heading, { bold: true, "data-itemid": `${baseId}-title`, margin: '2px 0 0 0', type: 'tertiary' }, title)) : null,
@@ -3154,7 +3155,7 @@ const AppHeader = ({ logoUrl, buttons = [], dataItemid }) => {
3154
3155
  React.createElement(Buttons, { "data-itemid": `${baseId}-buttons` }, buttons.map((b, i) => (React.createElement(Button, Object.assign({ key: i }, b, { "data-itemid": `${baseId}-button-${i}` })))))));
3155
3156
  };
3156
3157
 
3157
- const Wrapper$e = styled.div `
3158
+ const Wrapper$f = styled.div `
3158
3159
  display: inline-block;
3159
3160
  border-radius: 4px;
3160
3161
  padding: 4px 6px;
@@ -3191,7 +3192,7 @@ const Remove$1 = styled.div `
3191
3192
  const Tag = (_a) => {
3192
3193
  var { children, color = 'PRIMARY', removable, onClick, dataItemid, rotate, dataSectionName } = _a, accessibleProps = __rest(_a, ["children", "color", "removable", "onClick", "dataItemid", "rotate", "dataSectionName"]);
3193
3194
  const baseId = dataItemid || 'tag';
3194
- return (React.createElement(Wrapper$e, Object.assign({ "$color": color, "$removable": removable, "$rotate": rotate, onClick: onClick }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
3195
+ return (React.createElement(Wrapper$f, Object.assign({ "$color": color, "$removable": removable, "$rotate": rotate, onClick: onClick }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
3195
3196
  React.createElement(Content$2, { "data-itemid": `${baseId}-content`, "data-section-name": dataSectionName },
3196
3197
  React.createElement(Label$4, { "$color": color, "data-itemid": `${baseId}-label` }, children),
3197
3198
  removable ? (React.createElement(Remove$1, { "data-itemid": `${baseId}-remove` },
@@ -3327,7 +3328,7 @@ const AppMenu = ({ menu, isCollapsed, footerTag, defaultWidth = '280px', dataIte
3327
3328
  }, small: true, type: 'button' }))));
3328
3329
  };
3329
3330
 
3330
- const Wrapper$d = styled.div `
3331
+ const Wrapper$e = styled.div `
3331
3332
  border: 1px solid ${props => props.theme.PRIMARY_COLOR.Hex};
3332
3333
  border-radius: 8px;
3333
3334
  box-sizing: border-box;
@@ -3336,7 +3337,7 @@ const Wrapper$d = styled.div `
3336
3337
  justify-content: space-between;
3337
3338
  padding: 16px 20px;
3338
3339
  `;
3339
- Wrapper$d.defaultProps = { theme: EditableTheme };
3340
+ Wrapper$e.defaultProps = { theme: EditableTheme };
3340
3341
  const Left = styled.div `
3341
3342
  box-sizing: border-box;
3342
3343
  display: flex;
@@ -3398,7 +3399,7 @@ const ErrorMsg = styled.span `
3398
3399
  const BulkActionBar = (_a) => {
3399
3400
  var { actions = [], errorMsg, onClear, selectedCount = 0, dataItemid } = _a, accessibleProps = __rest(_a, ["actions", "errorMsg", "onClear", "selectedCount", "dataItemid"]);
3400
3401
  const baseId = dataItemid || 'bulk-action-bar';
3401
- return (React.createElement(Wrapper$d, Object.assign({}, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
3402
+ return (React.createElement(Wrapper$e, Object.assign({}, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
3402
3403
  React.createElement(Left, { "data-itemid": `${baseId}-left` },
3403
3404
  React.createElement(Info$1, { "data-itemid": `${baseId}-info` },
3404
3405
  React.createElement(Selected, { "data-itemid": `${baseId}-selected` },
@@ -3411,7 +3412,7 @@ const BulkActionBar = (_a) => {
3411
3412
  React.createElement(ErrorMsg, { "data-itemid": `${baseId}-error-msg` }, errorMsg))) : null));
3412
3413
  };
3413
3414
 
3414
- const Wrapper$c = styled.div `
3415
+ const Wrapper$d = styled.div `
3415
3416
  background: #fff;
3416
3417
  border-radius: 8px;
3417
3418
  box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
@@ -3458,7 +3459,7 @@ Title$1.defaultProps = {
3458
3459
  const MoreMenu = (_a) => {
3459
3460
  var { maxHeight, menuItems = [], dataItemid } = _a, accessibleProps = __rest(_a, ["maxHeight", "menuItems", "dataItemid"]);
3460
3461
  const baseId = dataItemid || 'more-menu';
3461
- return (React.createElement(Wrapper$c, Object.assign({ "$maxHeight": maxHeight }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }), menuItems.map((item, i) => {
3462
+ return (React.createElement(Wrapper$d, Object.assign({ "$maxHeight": maxHeight }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }), menuItems.map((item, i) => {
3462
3463
  var _a;
3463
3464
  const itemId = `${baseId}`;
3464
3465
  return (React.createElement(MenuItem, { className: item === null || item === void 0 ? void 0 : item.className, "data-itemid": `${itemId}-menu-item`, key: i, onClick: item.onClick },
@@ -3554,7 +3555,7 @@ const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = '
3554
3555
  showMenu && (React.createElement(StyledMoreMenu, { "$left": menuPosition.left, "$menuWidth": menuWidth, "$top": menuPosition.top, dataItemid: `${baseId}-more-menu`, maxHeight: maxHeight, menuItems: menuItems }))));
3555
3556
  };
3556
3557
 
3557
- const Wrapper$b = styled.label `
3558
+ const Wrapper$c = styled.label `
3558
3559
  border-radius: 4px;
3559
3560
  padding: 4px 0px 4px 6px;
3560
3561
  margin-left: -6px;
@@ -3570,7 +3571,7 @@ const Wrapper$b = styled.label `
3570
3571
  background: ${props => `rgba(${props.theme.PRIMARY_COLOR.Rgb}, 0.05)`};
3571
3572
  }
3572
3573
  `;
3573
- Wrapper$b.defaultProps = { theme: EditableTheme };
3574
+ Wrapper$c.defaultProps = { theme: EditableTheme };
3574
3575
  const Input$2 = styled.input `
3575
3576
  font-size: 20px;
3576
3577
  margin: 0px;
@@ -3597,7 +3598,7 @@ const Input$2 = styled.input `
3597
3598
  display: block;
3598
3599
  }
3599
3600
  `;
3600
- const getBackgroundColor$3 = (props) => {
3601
+ const getBackgroundColor$4 = (props) => {
3601
3602
  if (props.$isWarningError) {
3602
3603
  return '#fcf1c9';
3603
3604
  }
@@ -3608,7 +3609,7 @@ const getBackgroundColor$3 = (props) => {
3608
3609
  return '#ffffff';
3609
3610
  }
3610
3611
  };
3611
- const getBorderColor$3 = (props) => {
3612
+ const getBorderColor$4 = (props) => {
3612
3613
  if (props.$isWarningError) {
3613
3614
  return 'Orange';
3614
3615
  }
@@ -3626,8 +3627,8 @@ const Check$1 = styled.span `
3626
3627
  background-color: #fff;
3627
3628
  border-width: 2px;
3628
3629
  border-style: solid;
3629
- border-color: ${props => getBorderColor$3(props)};
3630
- background-color: ${props => getBackgroundColor$3(props)};
3630
+ border-color: ${props => getBorderColor$4(props)};
3631
+ background-color: ${props => getBackgroundColor$4(props)};
3631
3632
  box-sizing: border-box;
3632
3633
  position: relative;
3633
3634
  &:after {
@@ -3658,7 +3659,7 @@ const Label$3 = styled.span `
3658
3659
  const Checkbox = (_a) => {
3659
3660
  var { children, color, disabled, checked, onChange, invalid, tooltip, tabIndex, dataItemid, isInvalidRedBackground = false, isWarningError = false, dataSectionName, isLabelBold = false } = _a, accessibleProps = __rest(_a, ["children", "color", "disabled", "checked", "onChange", "invalid", "tooltip", "tabIndex", "dataItemid", "isInvalidRedBackground", "isWarningError", "dataSectionName", "isLabelBold"]);
3660
3661
  const baseId = dataItemid || 'checkbox';
3661
- return (React.createElement(Wrapper$b, Object.assign({ "$disabled": disabled }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
3662
+ return (React.createElement(Wrapper$c, Object.assign({ "$disabled": disabled }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
3662
3663
  React.createElement(Input$2, { "$invalid": invalid, checked: checked, "data-itemid": `${baseId}-input`, "data-section-name": dataSectionName, disabled: disabled, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'checkbox' }),
3663
3664
  React.createElement(Check$1, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$isWarningError": isWarningError, "data-itemid": `${baseId}-check` }),
3664
3665
  children ? (React.createElement(Label$3, { "$isLabelBold": isLabelBold, color: color, "data-itemid": `${baseId}-label` },
@@ -3714,6 +3715,230 @@ const Checklist = (_a) => {
3714
3715
  }))));
3715
3716
  };
3716
3717
 
3718
+ const getBackgroundColor$3 = (props) => {
3719
+ if (props.$isWarningError) {
3720
+ return '#fcf1c9';
3721
+ }
3722
+ else if (props.$invalid && props.$isInvalidRedBackground) {
3723
+ return '#ffe5e5';
3724
+ }
3725
+ else {
3726
+ return props.$readOnly ? '#f5f5f5' : '#ffffff';
3727
+ }
3728
+ };
3729
+ const getBorderColor$3 = (props) => {
3730
+ if (props.$isWarningError) {
3731
+ return 'Orange';
3732
+ }
3733
+ else if (props.$invalid) {
3734
+ return Colors.RED.Hex;
3735
+ }
3736
+ else {
3737
+ return '#cccccc';
3738
+ }
3739
+ };
3740
+ const Wrapper$b = styled.div `
3741
+ border-radius: 4px;
3742
+ height: 40px;
3743
+ background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
3744
+ position: relative;
3745
+ cursor: ${props => (props.$readOnly ? 'default' : 'pointer')};
3746
+ border-width: 1px;
3747
+ border-style: solid;
3748
+ border-color: ${props => getBorderColor$3(props)};
3749
+ background-color: ${props => getBackgroundColor$3(props)};
3750
+ border-radius: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.borderRadius) || '4px'};
3751
+ flex-grow: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.flexGrow) || 0};
3752
+ box-sizing: border-box;
3753
+ padding: 10px 0px;
3754
+ display: flex;
3755
+ align-items: center;
3756
+ width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
3757
+
3758
+ &:focus-within {
3759
+ border-color: ${props => (props.$readOnly ? '#cccccc' : props.theme.PRIMARY_COLOR.Hex)};
3760
+ }
3761
+ `;
3762
+ Wrapper$b.defaultProps = { theme: EditableTheme };
3763
+ const Trigger$2 = styled.div `
3764
+ appearance: none;
3765
+ box-shadow: none;
3766
+ outline: none;
3767
+ border: none;
3768
+ color: ${props => (props.$searchableOpen ? 'transparent' : Colors.BLACK.Hex)};
3769
+ font-size: ${FontSizes.DEFAULT};
3770
+ font-weight: 400;
3771
+ font-family: ${FontStyles.DEFAULT};
3772
+ line-height: normal;
3773
+ background-color: transparent;
3774
+ background-image: none;
3775
+ width: 100%;
3776
+ box-sizing: border-box;
3777
+ padding: 0px 30px 0px 10px;
3778
+ box-sizing: border-box;
3779
+ position: relative;
3780
+ z-index: 2;
3781
+ cursor: ${props => (props.$readOnly ? 'default' : 'pointer')};
3782
+ user-select: none;
3783
+ overflow: hidden;
3784
+ text-overflow: ellipsis;
3785
+ white-space: nowrap;
3786
+ `;
3787
+ const IconWrapper$3 = styled(Icon) `
3788
+ position: absolute;
3789
+ right: 9px;
3790
+ z-index: 1;
3791
+ transition: transform 0.2s ease;
3792
+ transform: ${props => (props.$isOpen ? 'rotate(180deg)' : 'rotate(0deg)')};
3793
+ pointer-events: none;
3794
+ `;
3795
+ const SearchInput$2 = styled.input `
3796
+ position: absolute;
3797
+ left: 0;
3798
+ top: 0;
3799
+ z-index: 999;
3800
+ width: 100%;
3801
+ height: 100%;
3802
+ border: none;
3803
+ outline: none;
3804
+ background-color: transparent;
3805
+ color: ${Colors.BLACK.Hex};
3806
+ font-family: ${FontStyles.DEFAULT};
3807
+ font-size: ${FontSizes.DEFAULT};
3808
+ font-weight: 400;
3809
+ line-height: normal;
3810
+ padding: 0px 30px 0px 10px;
3811
+ box-sizing: border-box;
3812
+ overflow: hidden;
3813
+ white-space: nowrap;
3814
+ pointer-events: ${props => (props.$isOpen ? 'auto' : 'none')};
3815
+ opacity: ${props => (props.$isOpen ? 1 : 0)};
3816
+
3817
+ &::placeholder {
3818
+ color: #999999;
3819
+ opacity: 1;
3820
+ }
3821
+ `;
3822
+ const DropdownContainer = styled.div `
3823
+ position: absolute;
3824
+ top: 100%;
3825
+ left: 0;
3826
+ right: 0;
3827
+ margin-top: 4px;
3828
+ background: white;
3829
+ border: 1px solid #cccccc;
3830
+ border-radius: 4px;
3831
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
3832
+ max-height: 300px;
3833
+ overflow-y: auto;
3834
+ z-index: 1000;
3835
+ display: ${props => (props.$isOpen ? 'block' : 'none')};
3836
+ `;
3837
+ const OptionGroupLabel = styled.div `
3838
+ padding: 6px 10px;
3839
+ font-weight: 600;
3840
+ font-size: ${FontSizes.DEFAULT};
3841
+ font-family: ${FontStyles.DEFAULT};
3842
+ color: ${Colors.BLACK.Hex};
3843
+ `;
3844
+ const OptionItem = styled.span `
3845
+ display: block;
3846
+ padding: 8px 10px;
3847
+ padding-left: ${props => (props.$isGrouped ? '20px' : '10px')};
3848
+ font-size: ${FontSizes.DEFAULT};
3849
+ font-family: ${FontStyles.DEFAULT};
3850
+ color: ${props => props.$color || Colors.BLACK.Hex};
3851
+ cursor: ${props => (props.$disabled ? 'not-allowed' : 'pointer')};
3852
+ opacity: ${props => (props.$disabled ? 0.5 : 1)};
3853
+ background-color: ${props => (props.$isSelected ? '#e8f4fd' : 'transparent')};
3854
+ user-select: none;
3855
+ line-height: 1.3em;
3856
+
3857
+ &:hover {
3858
+ background-color: ${props => (props.$disabled ? 'transparent' : '#f5f5f5')};
3859
+ }
3860
+ `;
3861
+ const CustomSelect = (_a) => {
3862
+ var { options, optionGroups, placeholder = '--Select-One--', readOnly, invalid, searchable = false, value: propValue, onChange, style, tabIndex, dataItemid, isInvalidRedBackground = false, isWarningError = false, innerRef = null } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "searchable", "value", "onChange", "style", "tabIndex", "dataItemid", "isInvalidRedBackground", "isWarningError", "innerRef"]);
3863
+ const [searchTerm, setSearchTerm] = useState('');
3864
+ const [value, setValue] = useState(propValue || '');
3865
+ const [isOpen, setIsOpen] = useState(false);
3866
+ const wrapperRef = useRef(null);
3867
+ const baseId = dataItemid || 'custom-select';
3868
+ // Update the value when the prop changes
3869
+ useEffect(() => {
3870
+ setValue(propValue || '');
3871
+ }, [propValue]);
3872
+ // Close dropdown when clicking outside
3873
+ useEffect(() => {
3874
+ const handleClickOutside = (event) => {
3875
+ if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
3876
+ setIsOpen(false);
3877
+ }
3878
+ };
3879
+ document.addEventListener('mousedown', handleClickOutside);
3880
+ return () => {
3881
+ document.removeEventListener('mousedown', handleClickOutside);
3882
+ };
3883
+ }, []);
3884
+ const handleSearch = (event) => {
3885
+ setSearchTerm(event.target.value);
3886
+ setIsOpen(true);
3887
+ };
3888
+ const handleToggle = () => {
3889
+ if (!readOnly) {
3890
+ setIsOpen(!isOpen);
3891
+ }
3892
+ };
3893
+ const handleOptionClick = (optionValue, disabled) => {
3894
+ if (disabled || readOnly)
3895
+ return;
3896
+ setValue(optionValue.toString());
3897
+ setIsOpen(false);
3898
+ setSearchTerm('');
3899
+ if (onChange) {
3900
+ onChange(optionValue);
3901
+ }
3902
+ };
3903
+ const getSelectedLabel = () => {
3904
+ if (!value || value === '')
3905
+ return placeholder;
3906
+ // Check in options
3907
+ if (options) {
3908
+ const found = options.find(opt => opt.value.toString() === value.toString());
3909
+ if (found)
3910
+ return found.label || found.value;
3911
+ }
3912
+ // Check in optionGroups
3913
+ if (optionGroups) {
3914
+ for (const group of optionGroups) {
3915
+ const found = group.options.find(opt => opt.value.toString() === value.toString());
3916
+ if (found)
3917
+ return found.label || found.value;
3918
+ }
3919
+ }
3920
+ return value;
3921
+ };
3922
+ const filteredOptions = searchable
3923
+ ? options === null || options === void 0 ? void 0 : options.filter(option => { var _a; return (_a = option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm.toLowerCase()); })
3924
+ : options;
3925
+ const filteredOptionGroups = searchable
3926
+ ? optionGroups === null || optionGroups === void 0 ? void 0 : optionGroups.map(group => (Object.assign(Object.assign({}, group), { options: group.options.filter(option => { var _a; return (_a = option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm.toLowerCase()); }) })))
3927
+ : optionGroups;
3928
+ return (React.createElement(Wrapper$b, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$isWarningError": isWarningError, "$readOnly": readOnly, "$style": style, "data-itemid": `${baseId}-wrapper`, ref: wrapperRef, style: style },
3929
+ searchable && (React.createElement(SearchInput$2, Object.assign({ "$isOpen": isOpen, autoFocus: isOpen, "data-itemid": `${baseId}-search-input`, onChange: handleSearch, placeholder: placeholder, tabIndex: readOnly ? -1 : tabIndex, type: 'text', value: searchTerm }, accessibleProps))),
3930
+ React.createElement(Trigger$2, Object.assign({ "$readOnly": readOnly, "$searchableOpen": searchable && isOpen, "data-itemid": `${baseId}-trigger`, id: `${baseId}-trigger`, onClick: handleToggle, ref: innerRef, tabIndex: readOnly ? -1 : tabIndex }, accessibleProps), getSelectedLabel()),
3931
+ React.createElement(IconWrapper$3, { "$isOpen": isOpen, color: Colors.BLACK.Hex, "data-itemid": `${baseId}-icon`, path: mdiChevronDown, size: '22px' }),
3932
+ React.createElement(DropdownContainer, { "$isOpen": isOpen, "data-itemid": `${baseId}-dropdown` },
3933
+ !value && placeholder && (React.createElement(OptionItem, { "$disabled": true, "$isSelected": false, "data-itemid": `${baseId}-placeholder` }, placeholder)),
3934
+ filteredOptionGroups &&
3935
+ filteredOptionGroups.map((group, i) => (React.createElement("div", { "data-itemid": `${baseId}-optgroup-${i}`, key: i },
3936
+ React.createElement(OptionGroupLabel, null, group.label || `Group ${i}`),
3937
+ group.options.map((option, j) => (React.createElement(OptionItem, { "$color": option.color, "$disabled": option.disabled, "$isGrouped": true, "$isSelected": !!(value && value !== '' && value.toString() === option.value.toString()), "data-itemid": `${baseId}-option-${i}-${j}`, key: j, onClick: () => handleOptionClick(option.value, option.disabled) }, option.label || option.value)))))),
3938
+ filteredOptions &&
3939
+ filteredOptions.map((option, i) => (React.createElement(OptionItem, { "$color": option.color, "$disabled": option.disabled, "$isSelected": !!(value && value !== '' && value.toString() === option.value.toString()), "data-itemid": `${baseId}-option-${i}`, key: i, onClick: () => handleOptionClick(option.value, option.disabled) }, option.label || option.value))))));
3940
+ };
3941
+
3717
3942
  const getBackgroundColor$2 = (props) => {
3718
3943
  if (props.$isWarningError) {
3719
3944
  return '#fcf1c9';
@@ -3801,7 +4026,7 @@ const SearchInput$1 = styled.input `
3801
4026
  white-space: nowrap;
3802
4027
  `;
3803
4028
  const Select = (_a) => {
3804
- var { options, optionGroups, placeholder = '--Select-One--', readOnly, invalid, searchable = false, value: propValue, onChange, style, tabIndex, dataItemid, isInvalidRedBackground = false, isWarningError = false, innerRef = null } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "searchable", "value", "onChange", "style", "tabIndex", "dataItemid", "isInvalidRedBackground", "isWarningError", "innerRef"]);
4029
+ var { options, optionGroups, placeholder = '--Select-One--', readOnly, invalid, searchable = false, value: propValue, onChange, style, tabIndex, dataItemid, isInvalidRedBackground = false, isWarningError = false, innerRef = null, isCustomSelect = false } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "searchable", "value", "onChange", "style", "tabIndex", "dataItemid", "isInvalidRedBackground", "isWarningError", "innerRef", "isCustomSelect"]);
3805
4030
  const [searchTerm, setSearchTerm] = useState('');
3806
4031
  const [value, setValue] = useState(propValue || '');
3807
4032
  const baseId = dataItemid || 'select';
@@ -3824,6 +4049,9 @@ const Select = (_a) => {
3824
4049
  const filteredOptionGroups = searchable
3825
4050
  ? optionGroups === null || optionGroups === void 0 ? void 0 : optionGroups.map(group => (Object.assign(Object.assign({}, group), { options: group.options.filter(option => { var _a; return (_a = option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm.toLowerCase()); }) })))
3826
4051
  : optionGroups;
4052
+ if (isCustomSelect) {
4053
+ return (React.createElement(CustomSelect, Object.assign({ dataItemid: dataItemid, innerRef: innerRef, invalid: invalid, isInvalidRedBackground: isInvalidRedBackground, isWarningError: isWarningError, onChange: onChange, optionGroups: optionGroups, options: options, placeholder: placeholder, readOnly: readOnly, searchable: searchable, style: style, tabIndex: tabIndex, value: propValue }, accessibleProps)));
4054
+ }
3827
4055
  return (React.createElement(Wrapper$a, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$isWarningError": isWarningError, "$readOnly": readOnly, "$style": style, "data-itemid": `${baseId}-wrapper`, style: style },
3828
4056
  searchable && (React.createElement(SearchInput$1, Object.assign({ "data-itemid": `${baseId}-search-input`, onChange: handleSearch, placeholder: placeholder, tabIndex: readOnly ? -1 : tabIndex, type: 'text', value: searchTerm }, accessibleProps))),
3829
4057
  React.createElement(Trigger$1, Object.assign({ "data-itemid": `${baseId}-trigger`, disabled: readOnly, id: `${baseId}-trigger`, name: baseId, onChange: handleChange, placeholder: placeholder, ref: innerRef, tabIndex: readOnly ? -1 : tabIndex, value: value }, accessibleProps),