cr-ui-lib 1.1.96 → 1.1.97

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.
package/dist/index.d.mts CHANGED
@@ -250,9 +250,10 @@ declare type SingleSelectDropdownProps = {
250
250
  iconClass?: string;
251
251
  displayContainerClass?: string;
252
252
  selectedColorDropdownItem?: string;
253
+ uniqueSearch?: boolean;
253
254
  };
254
255
  declare function SingleSelectDropdown({ label, value, onChange, options, placeholder, onScrollToEnd, onSearch, hasMore, isLoading, searchable, searchDebounceMs, requiresSearch, minSearchLength, emptyMessage, loadingMessage, searchPlaceholder, disabled, hasIcon, buttonClass, labelClass, displayItemClass, displayMainClass, hasSearchIcon, searchInputClass, placeholderSearchClass, usePortal, // default true
255
- iconClass, placeholderClass, displayContainerClass, selectedColorDropdownItem, }: SingleSelectDropdownProps): JSX.Element;
256
+ iconClass, placeholderClass, displayContainerClass, selectedColorDropdownItem, uniqueSearch }: SingleSelectDropdownProps): JSX.Element;
256
257
 
257
258
  interface SelectionButton {
258
259
  data: string[];
package/dist/index.d.ts CHANGED
@@ -250,9 +250,10 @@ declare type SingleSelectDropdownProps = {
250
250
  iconClass?: string;
251
251
  displayContainerClass?: string;
252
252
  selectedColorDropdownItem?: string;
253
+ uniqueSearch?: boolean;
253
254
  };
254
255
  declare function SingleSelectDropdown({ label, value, onChange, options, placeholder, onScrollToEnd, onSearch, hasMore, isLoading, searchable, searchDebounceMs, requiresSearch, minSearchLength, emptyMessage, loadingMessage, searchPlaceholder, disabled, hasIcon, buttonClass, labelClass, displayItemClass, displayMainClass, hasSearchIcon, searchInputClass, placeholderSearchClass, usePortal, // default true
255
- iconClass, placeholderClass, displayContainerClass, selectedColorDropdownItem, }: SingleSelectDropdownProps): JSX.Element;
256
+ iconClass, placeholderClass, displayContainerClass, selectedColorDropdownItem, uniqueSearch }: SingleSelectDropdownProps): JSX.Element;
256
257
 
257
258
  interface SelectionButton {
258
259
  data: string[];
package/dist/index.js CHANGED
@@ -3484,7 +3484,8 @@ function SingleSelectDropdown({
3484
3484
  iconClass = "",
3485
3485
  placeholderClass = "",
3486
3486
  displayContainerClass = "",
3487
- selectedColorDropdownItem = "text-[#131414]"
3487
+ selectedColorDropdownItem = "text-[#131414]",
3488
+ uniqueSearch = false
3488
3489
  }) {
3489
3490
  const [isOpen, setIsOpen] = React.useState(false);
3490
3491
  const [searchTerm, setSearchTerm] = React.useState("");
@@ -3642,16 +3643,70 @@ function SingleSelectDropdown({
3642
3643
  ),
3643
3644
  children: [
3644
3645
  searchable && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
3645
- /* @__PURE__ */ jsxRuntime.jsx(
3646
+ uniqueSearch ? /* @__PURE__ */ jsxRuntime.jsxs(
3647
+ "div",
3648
+ {
3649
+ onClick: handleToggle,
3650
+ className: tailwindMerge.twMerge(
3651
+ `border-[1.5px] rounded-md h-[40px] pl-3 pr-2 py-2 bg-[#F8F8F8] cursor-pointer flex items-center justify-between ${disabled ? "bg-gray-100 cursor-not-allowed border-gray-200" : isOpen ? "border-[#4683B4]" : "border-[#E2E2E2]"}`,
3652
+ buttonClass
3653
+ ),
3654
+ children: [
3655
+ /* @__PURE__ */ jsxRuntime.jsx(
3656
+ "span",
3657
+ {
3658
+ className: `text-sm ${disabled ? "text-gray-400" : selectedOption ? "text-gray-700" : "text-gray-[#757575]"} ${placeholderClass}`,
3659
+ children: (selectedOption == null ? void 0 : selectedOption.name) || placeholder
3660
+ }
3661
+ ),
3662
+ /* @__PURE__ */ jsxRuntime.jsx(
3663
+ "div",
3664
+ {
3665
+ className: `transition-transform duration-200 ${!isOpen ? "rotate-180" : ""} ${disabled ? "text-gray-400" : ""} ${hasIcon ? "block" : "hidden"} ${iconClass}`,
3666
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
3667
+ "svg",
3668
+ {
3669
+ width: "20",
3670
+ height: "20",
3671
+ viewBox: "0 0 20 20",
3672
+ fill: "none",
3673
+ xmlns: "http://www.w3.org/2000/svg",
3674
+ children: [
3675
+ /* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip0_10508_5931)", children: /* @__PURE__ */ jsxRuntime.jsx(
3676
+ "path",
3677
+ {
3678
+ d: "M5.83333 11.6665L10 7.49984L14.1667 11.6665H5.83333Z",
3679
+ fill: "currentColor"
3680
+ }
3681
+ ) }),
3682
+ /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip0_10508_5931", children: /* @__PURE__ */ jsxRuntime.jsx(
3683
+ "rect",
3684
+ {
3685
+ width: "20",
3686
+ height: "20",
3687
+ fill: "white",
3688
+ transform: "matrix(1 0 0 -1 0 20)"
3689
+ }
3690
+ ) }) })
3691
+ ]
3692
+ }
3693
+ )
3694
+ }
3695
+ )
3696
+ ]
3697
+ }
3698
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
3646
3699
  "input",
3647
3700
  {
3648
3701
  type: "text",
3702
+ onClick: handleToggle,
3649
3703
  autoFocus: true,
3650
3704
  className: tailwindMerge.twMerge(
3651
3705
  "input-placeholder-ellipsis w-full pr-[30px] h-[40px] px-2 py-1 rounded-md border border-gray-300 text-sm focus:border-1 focus:border-[#4683B4] focus:outline-none",
3652
3706
  searchInputClass
3653
3707
  ),
3654
3708
  value: searchTerm,
3709
+ placeholder: "Required",
3655
3710
  onChange: (e) => handleSearchChange(e.target.value)
3656
3711
  }
3657
3712
  ),