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