@diwauhris/ui 1.7.2 → 1.7.3

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/lib/index.cjs CHANGED
@@ -829,12 +829,12 @@ function Combobox({ value, onChange, options, placeholder, className, disabled,
829
829
  const listboxId = `${uid}-listbox`;
830
830
  const optionId = (index) => `${uid}-option-${index}`;
831
831
  const q = search.toLowerCase().trim();
832
- const filtered = q.length < 2 ? [] : options.filter((opt) => opt.label.toLowerCase().includes(q)).sort((a, b) => {
832
+ const DISPLAY_LIMIT = 100;
833
+ const filtered = q.length === 0 ? options : options.filter((opt) => opt.label.toLowerCase().includes(q)).sort((a, b) => {
833
834
  const al = a.label.toLowerCase();
834
835
  const bl = b.label.toLowerCase();
835
836
  return (al === q ? 0 : al.startsWith(q) ? 1 : al.indexOf(q) + 2) - (bl === q ? 0 : bl.startsWith(q) ? 1 : bl.indexOf(q) + 2);
836
837
  });
837
- const DISPLAY_LIMIT = 100;
838
838
  const displayed = filtered.length > DISPLAY_LIMIT ? filtered.slice(0, DISPLAY_LIMIT) : filtered;
839
839
  (0, react.useEffect)(() => {
840
840
  setSearch(value);
@@ -925,7 +925,7 @@ function Combobox({ value, onChange, options, placeholder, className, disabled,
925
925
  children: "Loading..."
926
926
  }) : filtered.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
927
927
  className: "px-3 py-2 text-sm text-slate-400 font-semibold",
928
- children: q.length < 2 ? "Type at least 2 characters to search..." : "No matches — press Enter to use this value"
928
+ children: "No matches — press Enter to use this value"
929
929
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [displayed.map((opt, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
930
930
  id: optionId(i),
931
931
  role: "option",
package/lib/index.mjs CHANGED
@@ -804,12 +804,12 @@ function Combobox({ value, onChange, options, placeholder, className, disabled,
804
804
  const listboxId = `${uid}-listbox`;
805
805
  const optionId = (index) => `${uid}-option-${index}`;
806
806
  const q = search.toLowerCase().trim();
807
- const filtered = q.length < 2 ? [] : options.filter((opt) => opt.label.toLowerCase().includes(q)).sort((a, b) => {
807
+ const DISPLAY_LIMIT = 100;
808
+ const filtered = q.length === 0 ? options : options.filter((opt) => opt.label.toLowerCase().includes(q)).sort((a, b) => {
808
809
  const al = a.label.toLowerCase();
809
810
  const bl = b.label.toLowerCase();
810
811
  return (al === q ? 0 : al.startsWith(q) ? 1 : al.indexOf(q) + 2) - (bl === q ? 0 : bl.startsWith(q) ? 1 : bl.indexOf(q) + 2);
811
812
  });
812
- const DISPLAY_LIMIT = 100;
813
813
  const displayed = filtered.length > DISPLAY_LIMIT ? filtered.slice(0, DISPLAY_LIMIT) : filtered;
814
814
  useEffect(() => {
815
815
  setSearch(value);
@@ -900,7 +900,7 @@ function Combobox({ value, onChange, options, placeholder, className, disabled,
900
900
  children: "Loading..."
901
901
  }) : filtered.length === 0 ? /* @__PURE__ */ jsx("div", {
902
902
  className: "px-3 py-2 text-sm text-slate-400 font-semibold",
903
- children: q.length < 2 ? "Type at least 2 characters to search..." : "No matches — press Enter to use this value"
903
+ children: "No matches — press Enter to use this value"
904
904
  }) : /* @__PURE__ */ jsxs(Fragment, { children: [displayed.map((opt, i) => /* @__PURE__ */ jsx("div", {
905
905
  id: optionId(i),
906
906
  role: "option",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@diwauhris/ui",
3
3
  "private": false,
4
- "version": "1.7.2",
4
+ "version": "1.7.3",
5
5
  "type": "module",
6
6
  "description": "DIWA UHRIS UI component library — React + Tailwind CSS",
7
7
  "keywords": [
@@ -90,3 +90,4 @@
90
90
  "vite-plugin-dts": "^5.0.3"
91
91
  }
92
92
  }
93
+