@harnessio/ui 0.5.3 → 0.5.5

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,7 +1,7 @@
1
1
  var k$ = Object.defineProperty;
2
2
  var P$ = (e, t, n) => t in e ? k$(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var de = (e, t, n) => P$(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { c as Dt, T as C4, R as Iv, D as Ov, a as Dv, u as Od, C as tg, b as R4, B as Je, I as me, P as wv, d as N4, O as ng, e as xv, S as Xi, f as F$, L as ks, g as U$, h as B$, i as Ts, j as yt, k as Pn, l as Ku, m as Ar, n as Dd, o as Lv, p as Va, q as On, r as yr, s as pt, t as Ir, v as rg, A as Mv, w as kv, x as mi, y as y4, z as A4, E as G$, F as I4, G as O4, H as D4, J as w4, K as x4, M as L4, N as M4, Q as li, U as st, V as vs, W as ji, X as wd, _ as Ve, Y as Cn, Z as k4, $ as va, a0 as ka, a1 as H$, a2 as ag, a3 as Y$, a4 as Ml, a5 as P4, a6 as z$, a7 as V$, a8 as q$, a9 as $$, aa as W$, ab as K$, ac as Q$, ad as X$, ae as j$, af as Z$, ag as J$ } from "./index-Dx1dURcv.js";
4
+ import { c as Dt, T as C4, R as Iv, D as Ov, a as Dv, u as Od, C as tg, b as R4, B as Je, I as me, P as wv, d as N4, O as ng, e as xv, S as Xi, f as F$, L as ks, g as U$, h as B$, i as Ts, j as yt, k as Pn, l as Ku, m as Ar, n as Dd, o as Lv, p as Va, q as On, r as yr, s as pt, t as Ir, v as rg, A as Mv, w as kv, x as mi, y as y4, z as A4, E as G$, F as I4, G as O4, H as D4, J as w4, K as x4, M as L4, N as M4, Q as li, U as st, V as vs, W as ji, X as wd, _ as Ve, Y as Cn, Z as k4, $ as va, a0 as ka, a1 as H$, a2 as ag, a3 as Y$, a4 as Ml, a5 as P4, a6 as z$, a7 as V$, a8 as q$, a9 as $$, aa as W$, ab as K$, ac as Q$, ad as X$, ae as j$, af as Z$, ag as J$ } from "./index-DhFGPGOA.js";
5
5
  import { jsx as g, jsxs as G, Fragment as mt } from "react/jsx-runtime";
6
6
  import * as h from "react";
7
7
  import se, { forwardRef as ge, useMemo as Me, useLayoutEffect as lc, useEffect as be, createContext as Ut, useContext as ut, useRef as xe, useCallback as Ue, Children as cc, useState as ve, cloneElement as Oo, memo as Ka, useReducer as eW, isValidElement as ra, createElement as tW, Fragment as Vi, useImperativeHandle as Pv } from "react";
@@ -169368,69 +169368,71 @@ const P3e = ({
169368
169368
  error: o,
169369
169369
  withForm: s = !1,
169370
169370
  message: l,
169371
- deletionItemName: c,
169372
- deletionKeyword: u = "DELETE",
169373
- violation: d = !1,
169374
- bypassable: p = !1
169371
+ title: c,
169372
+ deletionItemName: u,
169373
+ deleteConfirmText: d,
169374
+ deletionKeyword: p = "DELETE",
169375
+ violation: m = !1,
169376
+ bypassable: _ = !1
169375
169377
  }) => {
169376
- const { t: m } = Pn(), [_, f] = ve(""), [E, S] = ve(!1), b = (N) => {
169377
- f(N.target.value), E && S(!1);
169378
- }, T = () => {
169379
- s && _ !== u && S(!0), !(i || s && _ !== u) && (S(!1), r(n));
169380
- }, v = () => {
169378
+ const { t: f } = Pn(), [E, S] = ve(""), [b, T] = ve(!1), v = (I) => {
169379
+ S(I.target.value), b && T(!1);
169380
+ }, R = () => {
169381
+ s && E !== p && T(!0), !(i || s && E !== p) && (T(!1), r(n));
169382
+ }, N = () => {
169381
169383
  setTimeout(() => {
169382
- f(""), S(!1);
169384
+ S(""), T(!1);
169383
169385
  }, 300), t();
169384
- }, R = Me(() => {
169386
+ }, y = Me(() => {
169385
169387
  if (l) return l;
169386
- const N = "__IDENTIFIER__";
169388
+ const I = "__IDENTIFIER__";
169387
169389
  if (a) {
169388
- const I = m(
169390
+ const w = f(
169389
169391
  "component:deleteDialog.descriptionWithType",
169390
- `This will permanently delete your ${a} ${N} and remove all data. This action cannot be undone.`,
169391
- { type: a, identifier: N }
169392
- ).split(N);
169392
+ `This will permanently delete your ${a} ${I} and remove all data. This action cannot be undone.`,
169393
+ { type: a, identifier: I }
169394
+ ).split(I);
169393
169395
  return /* @__PURE__ */ G(mt, { children: [
169394
- I[0],
169395
- (c ?? n) && /* @__PURE__ */ g(he, { as: "span", variant: "body-strong", children: c ?? n }),
169396
- I[1]
169396
+ w[0],
169397
+ (u ?? n) && /* @__PURE__ */ g(he, { as: "span", variant: "body-strong", children: u ?? n }),
169398
+ w[1]
169397
169399
  ] });
169398
169400
  }
169399
- return m(
169401
+ return f(
169400
169402
  "component:deleteDialog.description",
169401
169403
  "This will permanently remove all data. This action cannot be undone."
169402
169404
  );
169403
- }, [a, m, l, n, c]);
169405
+ }, [a, f, l, n, u]);
169404
169406
  return /* @__PURE__ */ g(
169405
169407
  iu.Root,
169406
169408
  {
169407
169409
  theme: "danger",
169408
169410
  open: e,
169409
- onOpenChange: v,
169410
- onConfirm: T,
169411
+ onOpenChange: N,
169412
+ onConfirm: R,
169411
169413
  loading: i,
169412
- children: /* @__PURE__ */ G(iu.Content, { title: m("component:deleteDialog.title", "Are you sure?"), children: [
169413
- /* @__PURE__ */ g(he, { className: "break-words", wrap: "wrap", children: R }),
169414
+ children: /* @__PURE__ */ G(iu.Content, { title: c ?? f("component:deleteDialog.title", "Are you sure?"), children: [
169415
+ /* @__PURE__ */ g(he, { className: "break-words", wrap: "wrap", children: y }),
169414
169416
  s && /* @__PURE__ */ g(
169415
169417
  Ap,
169416
169418
  {
169417
169419
  id: "verification",
169418
- value: _,
169420
+ value: E,
169419
169421
  placeholder: "",
169420
- onChange: b,
169421
- label: `${m("component:deleteDialog.inputLabel", "To confirm, type")} "${u}"`,
169422
+ onChange: v,
169423
+ label: `${f("component:deleteDialog.inputLabel", "To confirm, type")} "${p}"`,
169422
169424
  disabled: i,
169423
169425
  autoFocus: !0,
169424
- error: E ? m("component:deleteDialog.validation.mismatch", `Please type "${u}" to confirm`, {
169425
- deletionKeyword: u
169426
+ error: b ? f("component:deleteDialog.validation.mismatch", `Please type "${p}" to confirm`, {
169427
+ deletionKeyword: p
169426
169428
  }) : ""
169427
169429
  }
169428
169430
  ),
169429
- d && /* @__PURE__ */ g(ju, { theme: ga.ERROR, children: p ? m(
169431
+ m && /* @__PURE__ */ g(ju, { theme: ga.ERROR, children: _ ? f(
169430
169432
  "component:deleteDialog.violationMessages.bypassed",
169431
169433
  `Some rules will be bypassed while deleting ${a}`,
169432
169434
  { type: a }
169433
- ) : m("component:deleteDialog.violationMessages.notAllow", `Some rules don't allow you to delete ${a}`, {
169435
+ ) : f("component:deleteDialog.violationMessages.notAllow", `Some rules don't allow you to delete ${a}`, {
169434
169436
  type: a
169435
169437
  }) }),
169436
169438
  !!o && /* @__PURE__ */ G(Ml.Root, { theme: "danger", children: [
@@ -169438,7 +169440,7 @@ const P3e = ({
169438
169440
  /* @__PURE__ */ g(Ml.Description, { children: aW(o, "Failed to perform delete operation") })
169439
169441
  ] }),
169440
169442
  /* @__PURE__ */ g(iu.Cancel, {}),
169441
- /* @__PURE__ */ g(iu.Confirm, { disabled: d && !p, children: d && p ? "Bypass rules and delete" : "Yes" })
169443
+ /* @__PURE__ */ g(iu.Confirm, { disabled: m && !_, children: m && _ ? "Bypass rules and delete" : d || "Yes" })
169442
169444
  ] })
169443
169445
  }
169444
169446
  );
@@ -176180,8 +176182,8 @@ const g$ = ({
176180
176182
  /* @__PURE__ */ g(Zn.Typography, { className: "w-1/3" }),
176181
176183
  /* @__PURE__ */ g(Zn.Typography, { className: "w-2/3" })
176182
176184
  ] }) : /* @__PURE__ */ G(mt, { children: [
176183
- /* @__PURE__ */ g(he, { color: "foreground-3", variant: "body-normal", children: e }),
176184
- /* @__PURE__ */ g(he, { color: "foreground-1", variant: "body-normal", className: "break-all", children: a })
176185
+ /* @__PURE__ */ g(he, { color: "foreground-1", variant: "body-normal", children: e }),
176186
+ /* @__PURE__ */ g(he, { color: "foreground-3", variant: "body-normal", className: "break-all", children: a })
176185
176187
  ] }) }, e) : /* @__PURE__ */ g(tt.Grid, { flow: "row", gapX: "2xl", columns: "minmax(0, 200px) minmax(0, 1fr)", align: "start", children: n ? /* @__PURE__ */ G(mt, { children: [
176186
176188
  /* @__PURE__ */ g(Zn.Typography, { className: "w-full" }),
176187
176189
  /* @__PURE__ */ g(Zn.Typography, { className: "w-2/3" })
@@ -179533,4 +179535,4 @@ export {
179533
179535
  Ese as y,
179534
179536
  xi as z
179535
179537
  };
179536
- //# sourceMappingURL=index-BYKijgj9.js.map
179538
+ //# sourceMappingURL=index-XHrNArJB.js.map