@konstructio/ui 0.1.0-alpha.23 → 0.1.0-alpha.24
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.
|
@@ -1,12 +1,30 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p } from "react";
|
|
3
3
|
import { DropdownProvider as n } from "./contexts/dropdown.provider.js";
|
|
4
|
-
import { Wrapper as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import { Wrapper as c } from "./components/Wrapper.js";
|
|
5
|
+
const v = p(({ onChange: r, onBlur: l, value: a, error: s, helperText: e, name: o, ...i }, d) => /* @__PURE__ */ t(
|
|
6
|
+
n,
|
|
7
|
+
{
|
|
8
|
+
onChange: r,
|
|
9
|
+
onBlur: l,
|
|
10
|
+
value: a,
|
|
11
|
+
name: o,
|
|
12
|
+
children: /* @__PURE__ */ m("div", { className: "relative w-full", children: [
|
|
13
|
+
/* @__PURE__ */ t(
|
|
14
|
+
c,
|
|
15
|
+
{
|
|
16
|
+
name: o,
|
|
17
|
+
error: s,
|
|
18
|
+
ref: d,
|
|
19
|
+
onBlur: l,
|
|
20
|
+
...i
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
s ? /* @__PURE__ */ t("span", { className: "text-xs text-red-700", children: s }) : null,
|
|
24
|
+
!s && e ? /* @__PURE__ */ t("span", { className: "text-xs text-slate-600", children: e }) : null
|
|
25
|
+
] })
|
|
26
|
+
}
|
|
27
|
+
));
|
|
10
28
|
export {
|
|
11
|
-
|
|
29
|
+
v as Dropdown
|
|
12
30
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { DropdownContext as
|
|
4
|
-
import { useToggle as
|
|
5
|
-
const
|
|
6
|
-
const [
|
|
7
|
-
(
|
|
8
|
-
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l, useCallback as v } from "react";
|
|
3
|
+
import { DropdownContext as x } from "./dropdown.context.js";
|
|
4
|
+
import { useToggle as T } from "../../../hooks/useToggle.js";
|
|
5
|
+
const P = ({ children: s, value: o, name: r, onChange: e, onBlur: t }) => {
|
|
6
|
+
const [m, p] = T(!1), [a, c] = l(""), i = v(
|
|
7
|
+
(d) => {
|
|
8
|
+
e == null || e({ target: { value: d, name: r ?? "" } }), t == null || t();
|
|
9
9
|
},
|
|
10
|
-
[r,
|
|
10
|
+
[e, r, t]
|
|
11
11
|
);
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
|
|
12
|
+
return /* @__PURE__ */ f(
|
|
13
|
+
x.Provider,
|
|
14
14
|
{
|
|
15
15
|
value: {
|
|
16
16
|
value: o,
|
|
17
|
-
isOpen:
|
|
18
|
-
searchTerm:
|
|
19
|
-
setSearchTerm:
|
|
20
|
-
setValue:
|
|
21
|
-
toggleOpen:
|
|
17
|
+
isOpen: m,
|
|
18
|
+
searchTerm: a,
|
|
19
|
+
setSearchTerm: c,
|
|
20
|
+
setValue: i,
|
|
21
|
+
toggleOpen: p
|
|
22
22
|
},
|
|
23
|
-
children:
|
|
23
|
+
children: s
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
26
|
};
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
P as DropdownProvider
|
|
29
29
|
};
|
package/dist/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.0-alpha.
|
|
5
|
+
"version": "0.1.0-alpha.23",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.0-alpha.
|
|
5
|
+
"version": "0.1.0-alpha.24",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|