@llmnative/react 2.2.2 → 2.3.0

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.mjs CHANGED
@@ -824,7 +824,7 @@ var dn = {
824
824
  wrapperClassName: "",
825
825
  className: "",
826
826
  icon: "loader-2",
827
- title: "Loading..",
827
+ title: "",
828
828
  description: ""
829
829
  },
830
830
  ActionButton: {
@@ -1391,7 +1391,7 @@ var dn = {
1391
1391
  wrapperClassName: "",
1392
1392
  className: "",
1393
1393
  icon: "loader-2",
1394
- title: "Loading..",
1394
+ title: "",
1395
1395
  description: ""
1396
1396
  },
1397
1397
  ActionButton: {
@@ -1955,7 +1955,7 @@ var dn = {
1955
1955
  wrapperClassName: "",
1956
1956
  className: "",
1957
1957
  icon: "loader-2",
1958
- title: "Loading..",
1958
+ title: "",
1959
1959
  description: ""
1960
1960
  },
1961
1961
  ActionButton: {
@@ -4277,8 +4277,8 @@ var qi = g(null), Ji = ({ registry: e, defaultKey: t, children: n }) => {
4277
4277
  //#endregion
4278
4278
  //#region src/components/ui/Loader.tsx
4279
4279
  function Xi({ children: e, show: t = !1, icon: n = void 0, title: r = void 0, description: i = void 0, minHeight: a = "200px", before: o = void 0, after: s = void 0, wrapperClassName: c = void 0, className: l = void 0 }) {
4280
- let u = J("loader");
4281
- return n ||= u.Loader.icon, r ||= u.Loader.title, i ||= u.Loader.description, t ? /* @__PURE__ */ f.createElement(fr, { className: c || u.Loader.wrapperClassName }, /* @__PURE__ */ f.createElement("div", {
4280
+ let u = J("loader"), d = er().common;
4281
+ return n ||= u.Loader.icon, r = r || u.Loader.title || d.loading, i ||= u.Loader.description, t ? /* @__PURE__ */ f.createElement(fr, { className: c || u.Loader.wrapperClassName }, /* @__PURE__ */ f.createElement("div", {
4282
4282
  className: "relative " + (l || u.Loader.className),
4283
4283
  style: { minHeight: a }
4284
4284
  }, /* @__PURE__ */ f.createElement("div", { className: "absolute top-0 bottom-0 left-0 right-0 z-10 bg-background/60 backdrop-blur-[2px]" }, o, (n || r || i) && /* @__PURE__ */ f.createElement("div", { className: "flex flex-col items-center justify-center gap-2 p-4 text-center" }, n && /* @__PURE__ */ f.createElement(Q, {
@@ -5168,25 +5168,27 @@ var Pa = g(null), Fa = ({ registry: e, defaultKey: t, children: n }) => {
5168
5168
  S && i && le();
5169
5169
  }
5170
5170
  })), document.body);
5171
- }, Ya = ({ children: e, title: t = void 0, onYes: n = void 0, onNo: r = void 0, onClose: i = void 0 }) => {
5172
- let a = X("modal");
5171
+ }, Ya = ({ children: e, title: t = void 0, onYes: n = void 0, onNo: r = void 0, onClose: i = void 0, yesLabel: a = void 0, noLabel: o = void 0, danger: s = !1 }) => {
5172
+ let c = X("modal"), l = n && /* @__PURE__ */ f.createElement(ci, {
5173
+ key: "yes",
5174
+ variant: s ? "danger" : "primary",
5175
+ label: a ?? c.yes,
5176
+ onClick: async (e) => {
5177
+ e.preventDefault(), await n(e), i?.();
5178
+ }
5179
+ }), u = r && /* @__PURE__ */ f.createElement(ci, {
5180
+ key: "no",
5181
+ variant: "secondary",
5182
+ label: o ?? c.no,
5183
+ onClick: async (e) => {
5184
+ e.preventDefault(), await r(e), i?.();
5185
+ }
5186
+ });
5173
5187
  return /* @__PURE__ */ f.createElement(Ja, {
5174
5188
  title: t,
5175
5189
  onClose: i,
5176
5190
  allowFullscreen: !1,
5177
- footer: /* @__PURE__ */ f.createElement(f.Fragment, null, n && /* @__PURE__ */ f.createElement(ci, {
5178
- variant: "primary",
5179
- label: a.yes,
5180
- onClick: async (e) => {
5181
- e.preventDefault(), await n(e), i?.();
5182
- }
5183
- }), r && /* @__PURE__ */ f.createElement(ci, {
5184
- variant: "secondary",
5185
- label: a.no,
5186
- onClick: async (e) => {
5187
- e.preventDefault(), await r(e), i?.();
5188
- }
5189
- }))
5191
+ footer: /* @__PURE__ */ f.createElement(f.Fragment, null, s ? [u, l] : [l, u])
5190
5192
  }, e);
5191
5193
  }, Xa = ({ children: e, title: t = void 0, onClose: n = void 0 }) => {
5192
5194
  let r = X("modal");
@@ -10915,25 +10917,25 @@ function _u(e) {
10915
10917
  });
10916
10918
  }
10917
10919
  var vu = (e) => {
10918
- let { path: t, defaultValues: n, ...r } = e, i = Yi(), [a, o] = E(void 0);
10920
+ let { path: t, defaultValues: n, ...r } = e, i = Yi(), a = X("common"), [o, s] = E(void 0);
10919
10921
  return b(() => {
10920
10922
  i.read(t).then((e) => {
10921
- o({
10923
+ s({
10922
10924
  ...n,
10923
10925
  ...e
10924
10926
  });
10925
10927
  }).catch((e) => {
10926
- console.error(e), o({});
10928
+ console.error(e), s({});
10927
10929
  });
10928
10930
  }, [
10929
10931
  i,
10930
10932
  t,
10931
10933
  n
10932
- ]), a ? /* @__PURE__ */ f.createElement(Cu, {
10934
+ ]), o ? /* @__PURE__ */ f.createElement(Cu, {
10933
10935
  ...r,
10934
- defaultValues: a,
10936
+ defaultValues: o,
10935
10937
  path: t
10936
- }) : /* @__PURE__ */ f.createElement("p", { className: "p-4" }, /* @__PURE__ */ f.createElement("span", { className: "mr-2 inline-block h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }), "Loading...");
10938
+ }) : /* @__PURE__ */ f.createElement("p", { className: "p-4" }, /* @__PURE__ */ f.createElement("span", { className: "mr-2 inline-block h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }), a.loading);
10937
10939
  }, yu = (e) => JSON.stringify(Zt(e ?? {})), bu = (e) => {
10938
10940
  if (e) try {
10939
10941
  let t = JSON.parse(e);