@motor-hero/ui-kit 0.36.1 → 0.36.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/dist/components/combobox.d.ts +4 -1
- package/dist/components/combobox.d.ts.map +1 -1
- package/dist/components/search-input.d.ts.map +1 -1
- package/dist/index.cjs +9 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/combobox.tsx +222 -220
- package/src/components/search-input.tsx +36 -31
package/dist/index.js
CHANGED
|
@@ -636,7 +636,8 @@ function Combobox({
|
|
|
636
636
|
hasMore,
|
|
637
637
|
selectedOption,
|
|
638
638
|
creatable,
|
|
639
|
-
formatCreateLabel
|
|
639
|
+
formatCreateLabel,
|
|
640
|
+
deselectable
|
|
640
641
|
}) {
|
|
641
642
|
const [open, setOpen] = React5.useState(false);
|
|
642
643
|
const [search, setSearch] = React5.useState("");
|
|
@@ -648,7 +649,7 @@ function Combobox({
|
|
|
648
649
|
if (!next) setSearch("");
|
|
649
650
|
};
|
|
650
651
|
const handleSelect = (next) => {
|
|
651
|
-
onChange(next);
|
|
652
|
+
onChange(deselectable && next === value ? "" : next);
|
|
652
653
|
handleOpenChange(false);
|
|
653
654
|
};
|
|
654
655
|
const handleSearchChange = (next) => {
|
|
@@ -2111,7 +2112,7 @@ import * as React10 from "react";
|
|
|
2111
2112
|
import { jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2112
2113
|
var SearchInput = React10.forwardRef(
|
|
2113
2114
|
({ containerClassName, className, ...props }, ref) => {
|
|
2114
|
-
return /* @__PURE__ */ jsxs24("div", { className:
|
|
2115
|
+
return /* @__PURE__ */ jsxs24("div", { className: cn("relative flex-1", containerClassName), children: [
|
|
2115
2116
|
/* @__PURE__ */ jsxs24(
|
|
2116
2117
|
"svg",
|
|
2117
2118
|
{
|
|
@@ -2124,6 +2125,7 @@ var SearchInput = React10.forwardRef(
|
|
|
2124
2125
|
strokeWidth: "2",
|
|
2125
2126
|
strokeLinecap: "round",
|
|
2126
2127
|
strokeLinejoin: "round",
|
|
2128
|
+
"aria-hidden": "true",
|
|
2127
2129
|
className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",
|
|
2128
2130
|
children: [
|
|
2129
2131
|
/* @__PURE__ */ jsx26("circle", { cx: "11", cy: "11", r: "8" }),
|
|
@@ -2136,7 +2138,10 @@ var SearchInput = React10.forwardRef(
|
|
|
2136
2138
|
{
|
|
2137
2139
|
ref,
|
|
2138
2140
|
type: "text",
|
|
2139
|
-
className:
|
|
2141
|
+
className: cn(
|
|
2142
|
+
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 pl-10 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
2143
|
+
className
|
|
2144
|
+
),
|
|
2140
2145
|
...props
|
|
2141
2146
|
}
|
|
2142
2147
|
)
|