@ews-admin/global-design-system 1.1.5 → 1.1.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.
package/dist/index.js CHANGED
@@ -620,14 +620,14 @@ function SearchAutocomplete({ onSelect, selectedId, searchFunction, getEntityByI
620
620
  className: "w-10 h-10 text-neutral-400 mr-3",
621
621
  })), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("div", { className: "font-medium text-neutral-900", children: getDisplayValue(selectedEntity) }), getSecondaryText && getSecondaryText(selectedEntity) && (jsxRuntime.jsx("div", { className: "text-sm text-neutral-500", children: getSecondaryText(selectedEntity) }))] })] }), jsxRuntime.jsx("button", { type: "button", onClick: handleClearSelection, className: "transition-colors text-neutral-400 hover:text-neutral-600", disabled: disabled, children: jsxRuntime.jsx(X, { className: "w-4 h-4" }) })] }) })), showDropdown && entities?.length > 0 && (jsxRuntime.jsx("div", { className: "overflow-auto absolute z-10 mt-1 w-full max-h-60 bg-white rounded-md shadow-lg", children: jsxRuntime.jsx("ul", { className: "py-1", children: entities.map((entity) => (jsxRuntime.jsx("li", { className: "px-4 py-2 cursor-pointer hover:bg-gray-100", onClick: () => handleEntitySelect(entity), children: jsxRuntime.jsxs("div", { className: "flex items-center", children: [React.createElement(icon, {
622
622
  className: "w-4 h-4 text-gray-400",
623
- }), jsxRuntime.jsxs("div", { className: "ml-2", children: [jsxRuntime.jsx("div", { className: "font-medium", children: getDisplayValue(entity) }), getSecondaryText && getSecondaryText(entity) && (jsxRuntime.jsx("div", { className: "text-xs text-gray-500", children: getSecondaryText(entity) }))] })] }) }, entity.id))) }) })), showDropdown && searchError && (jsxRuntime.jsx("div", { className: "absolute z-10 p-4 mt-1 w-full text-center text-red-600 bg-white rounded-md shadow-lg border border-red-200", children: jsxRuntime.jsxs("div", { className: "flex items-center justify-center", children: [jsxRuntime.jsx(X, { className: "w-4 h-4 mr-2" }), "Error: ", searchError] }) })), showDropdown && error && !searchError && (jsxRuntime.jsx("div", { className: "absolute z-10 p-4 mt-1 w-full text-center text-red-600 bg-white rounded-md shadow-lg border border-red-200", children: jsxRuntime.jsxs("div", { className: "flex items-center justify-center", children: [jsxRuntime.jsx(X, { className: "w-4 h-4 mr-2" }), error] }) })), showDropdown &&
623
+ }), jsxRuntime.jsxs("div", { className: "ml-2", children: [jsxRuntime.jsx("div", { className: "font-medium", children: getDisplayValue(entity) }), getSecondaryText && getSecondaryText(entity) && (jsxRuntime.jsx("div", { className: "text-xs text-gray-500", children: getSecondaryText(entity) }))] })] }) }, entity.id))) }) })), showDropdown && searchError && (jsxRuntime.jsx("div", { className: "absolute z-10 p-4 mt-1 w-full text-center text-red-600 bg-white rounded-md border border-red-200 shadow-lg", children: jsxRuntime.jsxs("div", { className: "flex justify-center items-center", children: [jsxRuntime.jsx(X, { className: "mr-2 w-4 h-4" }), "Error: ", searchError] }) })), showDropdown && error && !searchError && (jsxRuntime.jsx("div", { className: "absolute z-10 p-4 mt-1 w-full text-center text-red-600 bg-white rounded-md border border-red-200 shadow-lg", children: jsxRuntime.jsxs("div", { className: "flex justify-center items-center", children: [jsxRuntime.jsx(X, { className: "mr-2 w-4 h-4" }), error] }) })), showDropdown &&
624
624
  debouncedSearchTerm &&
625
625
  entities?.length === 0 &&
626
626
  !isLoading &&
627
627
  !searchError &&
628
628
  !error && (jsxRuntime.jsx("div", { className: "absolute z-10 p-4 mt-1 w-full text-center text-gray-500 bg-white rounded-md shadow-lg", children: debouncedSearchTerm.length < minSearchLength
629
629
  ? `Type at least ${minSearchLength} characters to search`
630
- : "No results found. Try a different search term." })), isLoading && showDropdown && (jsxRuntime.jsx("div", { className: "absolute z-10 p-4 mt-1 w-full text-center text-gray-500 bg-white rounded-md shadow-lg", children: jsxRuntime.jsxs("div", { className: "flex items-center justify-center", children: [jsxRuntime.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-ews-primary mr-2" }), "Loading..."] }) }))] }));
630
+ : "No results found. Try a different search term." })), isLoading && showDropdown && (jsxRuntime.jsx("div", { className: "absolute z-10 p-4 mt-1 w-full text-center text-gray-500 bg-white rounded-md shadow-lg", children: jsxRuntime.jsxs("div", { className: "flex justify-center items-center", children: [jsxRuntime.jsx("div", { className: "mr-2 w-4 h-4 rounded-full border-b-2 animate-spin border-ews-primary" }), "Loading..."] }) }))] }));
631
631
  }
632
632
 
633
633
  function MultiSearchAutocomplete({ items, selectedItems, onSelectionChange, onSearch, getEntityById, getPrimaryText, getSecondaryText, placeholder, disabled = false, loading = false, multiple = true, className, renderSelectedItem, renderListItem, keepOpenOnSelect = true, error, minSearchLength = 2, debounceTime = 300, }) {