@pibit.ai/cure-design-system 0.6.53 → 0.6.54

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.
Files changed (28) hide show
  1. package/dist/patterns/condition-builder/add-action-button.d.ts +2 -0
  2. package/dist/patterns/condition-builder/add-action-button.d.ts.map +1 -1
  3. package/dist/patterns/condition-builder/add-action-button.js +22 -18
  4. package/dist/patterns/condition-builder/condition-builder.d.ts +1 -1
  5. package/dist/patterns/condition-builder/condition-builder.d.ts.map +1 -1
  6. package/dist/patterns/condition-builder/condition-builder.js +58 -57
  7. package/dist/patterns/condition-builder/condition-group.d.ts +1 -1
  8. package/dist/patterns/condition-builder/condition-group.d.ts.map +1 -1
  9. package/dist/patterns/condition-builder/condition-group.js +238 -233
  10. package/dist/patterns/condition-builder/types.d.ts +10 -0
  11. package/dist/patterns/condition-builder/types.d.ts.map +1 -1
  12. package/dist/patterns/confirm-dialog/confirm-dialog.d.ts +8 -1
  13. package/dist/patterns/confirm-dialog/confirm-dialog.d.ts.map +1 -1
  14. package/dist/patterns/confirm-dialog/confirm-dialog.js +76 -71
  15. package/dist/patterns/filter-group/document-fields-to-tree.d.ts +1 -0
  16. package/dist/patterns/filter-group/document-fields-to-tree.d.ts.map +1 -1
  17. package/dist/patterns/filter-group/document-fields-to-tree.js +14 -13
  18. package/dist/patterns/filter-group/filter-condition-row.js +30 -30
  19. package/dist/patterns/filter-group/nested-field-select.d.ts.map +1 -1
  20. package/dist/patterns/filter-group/nested-field-select.js +175 -167
  21. package/dist/patterns/filter-group/types.d.ts +4 -0
  22. package/dist/patterns/filter-group/types.d.ts.map +1 -1
  23. package/dist/patterns/filter-group/types.js +27 -12
  24. package/dist/rich-text/token-input/token-suggestion.d.ts +5 -0
  25. package/dist/rich-text/token-input/token-suggestion.d.ts.map +1 -1
  26. package/dist/rich-text/token-input/token-suggestion.js +14 -6
  27. package/dist/styles/components.css +1 -1
  28. package/package.json +1 -1
@@ -1,57 +1,57 @@
1
1
  import { jsxs as g, jsx as t } from "react/jsx-runtime";
2
- import { useContext as Ke, createContext as Te, useState as U, useMemo as Be, useRef as _, useEffect as We } from "react";
3
- import { Plus as de, Trash02 as pe } from "@untitledui/icons";
4
- import { pathToString as ge } from "./utils.js";
5
- import { cx as p } from "../../utils/cn.js";
6
- import { ConditionRow as je } from "./condition-row.js";
7
- import { ConditionReorderHandle as ve, WORKFLOW_REORDER_HANDLE_CLASS as Ae } from "./condition-reorder-handle.js";
8
- import { AddActionButton as ye } from "./add-action-button.js";
9
- import { Button as Ge } from "../../primitives/button/button.js";
10
- import { useDragControls as Le } from "../../node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.js";
11
- import { Select as G } from "../../primitives/select/select.js";
12
- import { ButtonUtility as Ne } from "../../primitives/button/button-utility.js";
13
- import { ReorderGroup as xe } from "../../node_modules/framer-motion/dist/es/components/Reorder/Group.js";
14
- import { ReorderItem as Re } from "../../node_modules/framer-motion/dist/es/components/Reorder/Item.js";
15
- function ze(m) {
16
- const c = _(/* @__PURE__ */ new WeakMap()), a = _(/* @__PURE__ */ new Map()), h = _(0), i = _([]);
2
+ import { useContext as Be, createContext as We, useState as X, useMemo as je, useRef as O, useEffect as Ae } from "react";
3
+ import { Plus as ge, Trash02 as ve } from "@untitledui/icons";
4
+ import { pathToString as ye } from "./utils.js";
5
+ import { cx as m } from "../../utils/cn.js";
6
+ import { ConditionRow as Ge } from "./condition-row.js";
7
+ import { ConditionReorderHandle as Ne, WORKFLOW_REORDER_HANDLE_CLASS as ze } from "./condition-reorder-handle.js";
8
+ import { AddActionButton as xe } from "./add-action-button.js";
9
+ import { Button as Me } from "../../primitives/button/button.js";
10
+ import { useDragControls as ke } from "../../node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.js";
11
+ import { Select as z } from "../../primitives/select/select.js";
12
+ import { ButtonUtility as be } from "../../primitives/button/button-utility.js";
13
+ import { ReorderGroup as we } from "../../node_modules/framer-motion/dist/es/components/Reorder/Group.js";
14
+ import { ReorderItem as Pe } from "../../node_modules/framer-motion/dist/es/components/Reorder/Item.js";
15
+ function Ve(h) {
16
+ const c = O(/* @__PURE__ */ new WeakMap()), a = O(/* @__PURE__ */ new Map()), d = O(0), o = O([]);
17
17
  return (b, v) => {
18
- const o = b;
19
- if (c.current.has(o)) {
20
- const R = c.current.get(o);
21
- return i.current[v] = R, R;
18
+ const i = b;
19
+ if (c.current.has(i)) {
20
+ const L = c.current.get(i);
21
+ return o.current[v] = L, L;
22
22
  }
23
- const f = i.current[v], N = f != null ? a.current.get(f) : void 0;
24
- if (f != null && N !== void 0 && !m.includes(N))
25
- return c.current.set(o, f), a.current.set(f, o), i.current[v] = f, f;
26
- const l = `cond-${h.current++}`;
27
- return c.current.set(o, l), a.current.set(l, o), i.current[v] = l, l;
23
+ const f = o.current[v], w = f != null ? a.current.get(f) : void 0;
24
+ if (f != null && w !== void 0 && !h.includes(w))
25
+ return c.current.set(i, f), a.current.set(f, i), o.current[v] = f, f;
26
+ const l = `cond-${d.current++}`;
27
+ return c.current.set(i, l), a.current.set(l, i), o.current[v] = l, l;
28
28
  };
29
29
  }
30
- const we = [
30
+ const Se = [
31
31
  { id: "AND", label: "And" },
32
32
  { id: "OR", label: "Or" }
33
- ], P = {
33
+ ], _ = {
34
34
  sm: "text-xs",
35
35
  md: "text-sm",
36
36
  lg: "text-md"
37
- }, be = {
37
+ }, Ie = {
38
38
  sm: "size-4",
39
39
  md: "size-5",
40
40
  lg: "size-6"
41
- }, Se = "min-w-0 flex-1 truncate text-xs font-semibold leading-4.5 text-secondary", Me = "w-[68px] shrink-0 [&_button>*]:h-7 [&_button>*]:py-1", Ie = Te(null), Ve = (m) => m % 2 === 0 ? "bg-primary" : "bg-secondary_subtle", qe = (m) => m === 0 ? "bg-secondary_subtle" : "bg-primary border border-[#E3EAFC]";
42
- function X({
43
- condition: m,
41
+ }, Re = "min-w-0 flex-1 truncate text-xs font-semibold leading-4.5 text-secondary", qe = "w-[68px] shrink-0 [&_button>*]:h-7 [&_button>*]:py-1", Le = We(null), $e = (h) => h % 2 === 0 ? "bg-primary" : "bg-secondary_subtle", Je = (h) => h === 0 ? "bg-secondary_subtle" : "bg-primary border border-[#E3EAFC]";
42
+ function Y({
43
+ condition: h,
44
44
  onDragStartSession: c,
45
45
  children: a
46
46
  }) {
47
- const h = Le();
47
+ const d = ke();
48
48
  return /* @__PURE__ */ t(
49
- Re,
49
+ Pe,
50
50
  {
51
- value: m,
51
+ value: h,
52
52
  as: "div",
53
53
  dragListener: !1,
54
- dragControls: h,
54
+ dragControls: d,
55
55
  style: { position: "relative" },
56
56
  whileDrag: {
57
57
  opacity: 0.85,
@@ -61,33 +61,34 @@ function X({
61
61
  },
62
62
  transition: { type: "spring", stiffness: 300, damping: 25 },
63
63
  children: a((b) => {
64
- c == null || c(), h.start(b);
64
+ c == null || c(), d.start(b);
65
65
  })
66
66
  }
67
67
  );
68
68
  }
69
- function $e({
70
- condition: m,
69
+ function Qe({
70
+ condition: h,
71
71
  renderCustomNode: c,
72
72
  customCtx: a,
73
- onDragStartSession: h,
74
- renderOperatorColumn: i,
73
+ onDragStartSession: d,
74
+ renderOperatorColumn: o,
75
75
  hideOperatorColumn: b,
76
- renderDefault: v
76
+ operatorColumnClassName: v,
77
+ renderDefault: i
77
78
  }) {
78
- const o = Le(), N = c(m, {
79
+ const f = ke(), S = c(h, {
79
80
  ...a,
80
- onDragHandlePointerDown: (L) => {
81
- h == null || h(), o.start(L);
81
+ onDragHandlePointerDown: (l) => {
82
+ d == null || d(), f.start(l);
82
83
  }
83
84
  });
84
- return N == null ? v() : /* @__PURE__ */ t(
85
- Re,
85
+ return S == null ? i() : /* @__PURE__ */ t(
86
+ Pe,
86
87
  {
87
- value: m,
88
+ value: h,
88
89
  as: "div",
89
90
  dragListener: !1,
90
- dragControls: o,
91
+ dragControls: f,
91
92
  style: { position: "relative" },
92
93
  whileDrag: {
93
94
  opacity: 0.85,
@@ -97,135 +98,137 @@ function $e({
97
98
  },
98
99
  transition: { type: "spring", stiffness: 300, damping: 25 },
99
100
  children: /* @__PURE__ */ g("div", { className: "flex items-start gap-2 py-2 min-w-0", children: [
100
- !b && /* @__PURE__ */ t("div", { className: "w-[75px] shrink-0 pt-2", children: i(a.index) }),
101
- /* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: N })
101
+ !b && /* @__PURE__ */ t("div", { className: m(v, "shrink-0 pt-2"), children: o(a.index) }),
102
+ /* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: S })
102
103
  ] })
103
104
  }
104
105
  );
105
106
  }
106
- function Je({
107
- group: m,
107
+ function Ue({
108
+ group: h,
108
109
  nodePath: c,
109
110
  level: a,
110
- maxDepth: h,
111
- config: i,
111
+ maxDepth: d,
112
+ config: o,
112
113
  onAddCondition: b,
113
114
  onUpdateCondition: v,
114
- onDeleteCondition: o,
115
+ onDeleteCondition: i,
115
116
  onAddGroup: f,
116
- onUpdateGroupOperator: N,
117
- onDeleteGroup: L,
117
+ onUpdateGroupOperator: w,
118
+ onDeleteGroup: S,
118
119
  onDuplicateCondition: l,
119
- onReorder: R,
120
- renderLeafRow: z,
121
- hideOperatorColumn: d = !1,
122
- invalidPaths: Y,
120
+ onReorder: L,
121
+ renderLeafRow: M,
122
+ hideOperatorColumn: p = !1,
123
+ invalidPaths: Z,
123
124
  getErrorMessage: K,
124
125
  size: u,
125
- addFilterLabel: Z,
126
- addFilterGroupLabel: D,
127
- addActionClassName: M,
128
- nestedAddActionClassName: ee,
129
- hideAddActions: re = !1,
130
- getOperatorOptions: Ce,
131
- reorderGroupClassName: V,
126
+ addFilterLabel: D,
127
+ addFilterGroupLabel: ee,
128
+ addActionClassName: V,
129
+ nestedAddActionClassName: re,
130
+ hideAddActions: te = !1,
131
+ getOperatorOptions: _e,
132
+ reorderGroupClassName: q,
132
133
  extraAddActions: T,
133
- renderCustomNode: q,
134
- isDeleteDisabled: S,
135
- showRootClearGroup: ke = !1,
136
- onRootClearGroup: te
134
+ renderCustomNode: $,
135
+ isDeleteDisabled: I,
136
+ showRootClearGroup: Oe = !1,
137
+ onRootClearGroup: ne,
138
+ whereLabel: se = "Where",
139
+ operatorColumnClassName: B = "w-[75px]"
137
140
  }) {
138
- const ne = a < h, se = a === 0 ? M : ee ?? M, O = i.getGroupOperator(m), x = i.getGroupConditions(m), $ = Ke(Ie), [ce, Pe] = U(null), H = Be(
139
- () => $ ?? { hoveredPath: ce, setHoveredPath: Pe },
140
- [$, ce]
141
- ), ae = (e) => d ? (r) => {
142
- r.stopPropagation(), H.setHoveredPath(e);
143
- } : void 0, le = d ? () => H.setHoveredPath(null) : void 0, [oe, ie] = U(!1), [_e, ue] = U([]), B = _(null), E = _(null), W = () => {
144
- const e = [...x];
145
- ie(!0), ue(e), B.current = e;
141
+ const ce = a < d, ae = a === 0 ? V : re ?? V, H = o.getGroupOperator(h), N = o.getGroupConditions(h), J = Be(Le), [le, He] = X(null), E = je(
142
+ () => J ?? { hoveredPath: le, setHoveredPath: He },
143
+ [J, le]
144
+ ), oe = (e) => p ? (r) => {
145
+ r.stopPropagation(), E.setHoveredPath(e);
146
+ } : void 0, ie = p ? () => E.setHoveredPath(null) : void 0, [ue, me] = X(!1), [Ee, he] = X([]), W = O(null), C = O(null), j = () => {
147
+ const e = [...N];
148
+ me(!0), he(e), W.current = e;
146
149
  const r = () => {
147
- const s = B.current, n = x;
148
- s && (s.length !== n.length || s.some((w, C) => w !== n[C])) && R(c, s), B.current = null, document.removeEventListener("pointerup", r), E.current = null, requestAnimationFrame(() => ie(!1));
150
+ const s = W.current, n = N;
151
+ s && (s.length !== n.length || s.some((x, k) => x !== n[k])) && L(c, s), W.current = null, document.removeEventListener("pointerup", r), C.current = null, requestAnimationFrame(() => me(!1));
149
152
  };
150
- E.current = r, document.addEventListener("pointerup", r);
151
- }, me = (e) => {
152
- if (oe) {
153
- B.current = e, ue(e);
153
+ C.current = r, document.addEventListener("pointerup", r);
154
+ }, fe = (e) => {
155
+ if (ue) {
156
+ W.current = e, he(e);
154
157
  return;
155
158
  }
156
- e !== x && (e.length === x.length && e.every((r, s) => x[s] === r) || R(c, e));
157
- }, I = oe ? _e : x, j = ze(I);
158
- We(() => () => {
159
- E.current && (document.removeEventListener("pointerup", E.current), E.current = null);
159
+ e !== N && (e.length === N.length && e.every((r, s) => N[s] === r) || L(c, e));
160
+ }, R = ue ? Ee : N, A = Ve(R);
161
+ Ae(() => () => {
162
+ C.current && (document.removeEventListener("pointerup", C.current), C.current = null);
160
163
  }, []);
161
- const J = (e) => {
164
+ const Q = (e) => {
162
165
  if (e === 0)
163
- return /* @__PURE__ */ t("span", { className: p("font-medium text-secondary pl-1", P[u]), children: "Where" });
164
- const r = e === 1, s = O === "OR" ? "Or" : "And";
166
+ return /* @__PURE__ */ t("span", { className: m("font-medium text-secondary pl-1", _[u]), children: a === 0 ? se : "Where" });
167
+ const r = e === 1, s = H === "OR" ? "Or" : "And";
165
168
  return r ? /* @__PURE__ */ t(
166
- G,
169
+ z,
167
170
  {
168
171
  size: u,
169
172
  className: "w-full",
170
- selectedKey: O,
171
- onSelectionChange: (n) => N(c, n),
172
- items: we,
173
+ selectedKey: H,
174
+ onSelectionChange: (n) => w(c, n),
175
+ items: Se,
173
176
  "aria-label": "Logical operator for this group",
174
- children: (n) => /* @__PURE__ */ t(G.Item, { id: n.id, children: n.label })
177
+ children: (n) => /* @__PURE__ */ t(z.Item, { id: n.id, children: n.label })
175
178
  }
176
- ) : /* @__PURE__ */ t("span", { className: p("font-medium text-secondary pl-3", P[u]), children: s });
177
- }, Oe = (e) => e === 0 ? /* @__PURE__ */ t("span", { className: Se, children: "Where" }) : e === 1 ? /* @__PURE__ */ t(
178
- G,
179
+ ) : /* @__PURE__ */ t("span", { className: m("font-medium text-secondary pl-3", _[u]), children: s });
180
+ }, Ce = (e) => e === 0 ? /* @__PURE__ */ t("span", { className: Re, children: a === 0 ? se : "Where" }) : e === 1 ? /* @__PURE__ */ t(
181
+ z,
179
182
  {
180
183
  size: "sm",
181
- className: Me,
184
+ className: qe,
182
185
  textStyles: "font-semibold text-secondary",
183
- selectedKey: O,
184
- onSelectionChange: (r) => N(c, r),
185
- items: we,
186
+ selectedKey: H,
187
+ onSelectionChange: (r) => w(c, r),
188
+ items: Se,
186
189
  "aria-label": "Logical operator for this group",
187
- children: (r) => /* @__PURE__ */ t(G.Item, { id: r.id, children: r.label })
190
+ children: (r) => /* @__PURE__ */ t(z.Item, { id: r.id, children: r.label })
188
191
  }
189
- ) : /* @__PURE__ */ t("span", { className: Se, children: O === "OR" ? "Or" : "And" }), He = (e, r, s) => {
190
- const n = [...c, r], y = ge(n), w = r === 0, C = Y.has(y), A = K == null ? void 0 : K(y);
192
+ ) : /* @__PURE__ */ t("span", { className: Re, children: H === "OR" ? "Or" : "And" }), Fe = (e, r, s) => {
193
+ const n = [...c, r], y = ye(n), x = r === 0, k = Z.has(y), G = K == null ? void 0 : K(y);
191
194
  return /* @__PURE__ */ t(
192
- X,
195
+ Y,
193
196
  {
194
197
  condition: e,
195
- onDragStartSession: W,
198
+ onDragStartSession: j,
196
199
  children: (F) => /* @__PURE__ */ g(
197
200
  "div",
198
201
  {
199
- className: p("flex min-w-0 items-center gap-2", d ? "py-0" : "py-1"),
200
- onMouseOver: ae(y),
202
+ className: m("flex min-w-0 items-center gap-2", p ? "py-0" : "py-1"),
203
+ onMouseOver: oe(y),
201
204
  children: [
202
- !d && /* @__PURE__ */ t("div", { className: "w-[75px] shrink-0", children: J(r) }),
203
- /* @__PURE__ */ t("div", { className: d ? "min-w-0 flex-1" : "min-w-[80px] flex-1", children: z ? z({
205
+ !p && /* @__PURE__ */ t("div", { className: m(B, "shrink-0"), children: Q(r) }),
206
+ /* @__PURE__ */ t("div", { className: p ? "min-w-0 flex-1" : "min-w-[80px] flex-1", children: M ? M({
204
207
  condition: e,
205
208
  nodePath: n,
206
- isFirst: w,
207
- onUpdate: (k) => v(n, k),
208
- onDelete: () => o(n),
209
+ isFirst: x,
210
+ onUpdate: (P) => v(n, P),
211
+ onDelete: () => i(n),
209
212
  onDuplicate: l ? () => l(n) : void 0,
210
- isInvalid: C,
211
- errorMessage: A,
213
+ isInvalid: k,
214
+ errorMessage: G,
212
215
  size: u,
213
216
  onDragHandlePointerDown: F,
214
217
  isDeleteDisabled: s,
215
- isDragHandleVisible: d ? H.hoveredPath === y : void 0
218
+ isDragHandleVisible: p ? E.hoveredPath === y : void 0
216
219
  }) : /* @__PURE__ */ t(
217
- je,
220
+ Ge,
218
221
  {
219
222
  condition: e,
220
223
  nodePath: n,
221
- isFirst: w,
222
- onUpdate: (k) => v(n, k),
223
- onDelete: () => o(n),
224
+ isFirst: x,
225
+ onUpdate: (P) => v(n, P),
226
+ onDelete: () => i(n),
224
227
  onDuplicate: l ? () => l(n) : void 0,
225
- isInvalid: C,
226
- errorMessage: A,
228
+ isInvalid: k,
229
+ errorMessage: G,
227
230
  size: u,
228
- getOperatorOptions: Ce,
231
+ getOperatorOptions: _e,
229
232
  onDragHandlePointerDown: F,
230
233
  isDeleteDisabled: s
231
234
  }
@@ -234,198 +237,200 @@ function Je({
234
237
  }
235
238
  )
236
239
  },
237
- j(e, r)
240
+ A(e, r)
238
241
  );
239
- }, Ee = (e, r, s) => {
240
- const n = [...c, r], y = r === 0, w = Ve(a + 1), C = qe(a), A = i.getGroupOperator(e), F = ge(n), k = /* @__PURE__ */ t(
241
- Je,
242
+ }, Ke = (e, r, s) => {
243
+ const n = [...c, r], y = r === 0, x = $e(a + 1), k = Je(a), G = o.getGroupOperator(e), F = ye(n), P = /* @__PURE__ */ t(
244
+ Ue,
242
245
  {
243
246
  group: e,
244
247
  nodePath: n,
245
248
  level: a + 1,
246
- maxDepth: h,
249
+ maxDepth: d,
247
250
  isFirst: y,
248
- parentOperator: O,
249
- config: i,
251
+ parentOperator: H,
252
+ config: o,
250
253
  onAddCondition: b,
251
254
  onUpdateCondition: v,
252
- onDeleteCondition: o,
255
+ onDeleteCondition: i,
253
256
  onAddGroup: f,
254
- onUpdateGroupOperator: N,
255
- onDeleteGroup: L,
257
+ onUpdateGroupOperator: w,
258
+ onDeleteGroup: S,
256
259
  onDuplicateCondition: l,
257
- onReorder: R,
258
- renderLeafRow: z,
259
- hideOperatorColumn: d,
260
- invalidPaths: Y,
260
+ onReorder: L,
261
+ renderLeafRow: M,
262
+ hideOperatorColumn: p,
263
+ invalidPaths: Z,
261
264
  getErrorMessage: K,
262
265
  size: u,
263
- addFilterLabel: Z,
264
- addFilterGroupLabel: D,
265
- addActionClassName: M,
266
- nestedAddActionClassName: ee,
267
- hideAddActions: re,
268
- reorderGroupClassName: V,
266
+ addFilterLabel: D,
267
+ addFilterGroupLabel: ee,
268
+ addActionClassName: V,
269
+ nestedAddActionClassName: re,
270
+ hideAddActions: te,
271
+ reorderGroupClassName: q,
269
272
  extraAddActions: T,
270
- renderCustomNode: q,
271
- isDeleteDisabled: S
273
+ renderCustomNode: $,
274
+ isDeleteDisabled: I,
275
+ operatorColumnClassName: B
272
276
  }
273
277
  );
274
- if (d) {
275
- const Q = H.hoveredPath === F;
278
+ if (p) {
279
+ const U = E.hoveredPath === F;
276
280
  return /* @__PURE__ */ t(
277
- X,
281
+ Y,
278
282
  {
279
283
  condition: e,
280
- onDragStartSession: W,
281
- children: (Fe) => /* @__PURE__ */ g(
284
+ onDragStartSession: j,
285
+ children: (Te) => /* @__PURE__ */ g(
282
286
  "div",
283
287
  {
284
288
  className: "relative flex min-w-0 flex-col gap-1.5",
285
- onMouseOver: ae(F),
289
+ onMouseOver: oe(F),
286
290
  children: [
287
291
  /* @__PURE__ */ t(
288
- ve,
292
+ Ne,
289
293
  {
290
- className: p(
291
- Ae,
294
+ className: m(
295
+ ze,
292
296
  "absolute right-0 top-0 z-10 translate-x-1/2",
293
- Q ? "opacity-100" : "pointer-events-none opacity-0"
297
+ U ? "opacity-100" : "pointer-events-none opacity-0"
294
298
  ),
295
299
  size: u,
296
- onDragHandlePointerDown: Fe,
300
+ onDragHandlePointerDown: Te,
297
301
  onDuplicate: l ? () => l(n) : void 0
298
302
  }
299
303
  ),
300
304
  /* @__PURE__ */ g(
301
305
  "div",
302
306
  {
303
- className: p(
307
+ className: m(
304
308
  "flex min-w-0 items-center justify-between gap-0.5",
305
309
  r === 1 ? "h-7 pr-1" : "h-[18px] px-1"
306
310
  ),
307
311
  children: [
308
- Oe(r),
312
+ Ce(r),
309
313
  !s && /* @__PURE__ */ t(
310
- Ne,
314
+ be,
311
315
  {
312
316
  color: "tertiary",
313
317
  size: "4xs",
314
- icon: pe,
318
+ icon: ve,
315
319
  "aria-label": "Remove group",
316
- onClick: () => L(n),
320
+ onClick: () => S(n),
317
321
  className: "shrink-0 hover:bg-secondary_hover hover:text-fg-secondary"
318
322
  }
319
323
  )
320
324
  ]
321
325
  }
322
326
  ),
323
- /* @__PURE__ */ t("div", { className: p("min-w-0 rounded-[10px] p-1.5", C), children: k })
327
+ /* @__PURE__ */ t("div", { className: m("min-w-0 rounded-[10px] p-1.5", k), children: P })
324
328
  ]
325
329
  }
326
330
  )
327
331
  },
328
- j(e, r)
332
+ A(e, r)
329
333
  );
330
334
  }
331
335
  return /* @__PURE__ */ t(
332
- X,
336
+ Y,
333
337
  {
334
338
  condition: e,
335
- onDragStartSession: W,
336
- children: (Q) => /* @__PURE__ */ g("div", { className: "flex min-w-0 items-start gap-2 py-2", children: [
337
- /* @__PURE__ */ t("div", { className: "w-[75px] shrink-0 pt-2", children: J(r) }),
338
- /* @__PURE__ */ g("div", { className: p("relative min-w-0 flex-1 overflow-hidden rounded-lg p-3", w), children: [
339
+ onDragStartSession: j,
340
+ children: (U) => /* @__PURE__ */ g("div", { className: "flex min-w-0 items-start gap-2 py-2", children: [
341
+ /* @__PURE__ */ t("div", { className: m(B, "shrink-0 pt-2"), children: Q(r) }),
342
+ /* @__PURE__ */ g("div", { className: m("relative min-w-0 flex-1 overflow-hidden rounded-lg p-3", x), children: [
339
343
  /* @__PURE__ */ g("div", { className: "mb-2 flex min-w-0 items-center gap-0.5", children: [
340
- /* @__PURE__ */ t("span", { className: p("min-w-0 flex-1 text-tertiary", P[u]), children: A === "OR" ? "Any of the following are true..." : "All of the following are true..." }),
344
+ /* @__PURE__ */ t("span", { className: m("min-w-0 flex-1 text-tertiary", _[u]), children: G === "OR" ? "Any of the following are true..." : "All of the following are true..." }),
341
345
  !s && /* @__PURE__ */ t(
342
- Ne,
346
+ be,
343
347
  {
344
348
  "aria-label": "Remove group",
345
- icon: pe,
349
+ icon: ve,
346
350
  color: "tertiary",
347
351
  size: "3xs",
348
- onClick: () => L(n)
352
+ onClick: () => S(n)
349
353
  }
350
354
  )
351
355
  ] }),
352
- k
356
+ P
353
357
  ] }),
354
- !d && /* @__PURE__ */ t(
355
- ve,
358
+ !p && /* @__PURE__ */ t(
359
+ Ne,
356
360
  {
357
361
  className: "mt-2 w-9 shrink-0",
358
362
  size: u,
359
- onDragHandlePointerDown: Q,
363
+ onDragHandlePointerDown: U,
360
364
  onDuplicate: l ? () => l(n) : void 0
361
365
  }
362
366
  )
363
367
  ] })
364
368
  },
365
- j(e, r)
369
+ A(e, r)
366
370
  );
367
- }, he = (e, r) => {
368
- const s = [...c, r], n = x.length, y = !!(S != null && S({ nodePath: s, siblingCount: n })), w = () => i.isLeafCondition(e) ? He(e, r, y) : i.isGroupCondition(e) ? Ee(e, r, y) : null;
369
- return q ? /* @__PURE__ */ t(
370
- $e,
371
+ }, de = (e, r) => {
372
+ const s = [...c, r], n = N.length, y = !!(I != null && I({ nodePath: s, siblingCount: n })), x = () => o.isLeafCondition(e) ? Fe(e, r, y) : o.isGroupCondition(e) ? Ke(e, r, y) : null;
373
+ return $ ? /* @__PURE__ */ t(
374
+ Qe,
371
375
  {
372
376
  condition: e,
373
- renderCustomNode: q,
377
+ renderCustomNode: $,
374
378
  customCtx: {
375
379
  nodePath: s,
376
380
  index: r,
377
381
  isFirst: r === 0,
378
382
  onDuplicate: l ? () => l(s) : void 0,
379
- onDelete: () => o(s)
383
+ onDelete: () => i(s)
380
384
  },
381
- onDragStartSession: W,
382
- renderOperatorColumn: J,
383
- hideOperatorColumn: d,
384
- renderDefault: w
385
+ onDragStartSession: j,
386
+ renderOperatorColumn: Q,
387
+ operatorColumnClassName: B,
388
+ hideOperatorColumn: p,
389
+ renderDefault: x
385
390
  },
386
- j(e, r)
387
- ) : w();
388
- }, fe = (e = !1) => re ? null : /* @__PURE__ */ g("div", { className: "flex flex-1 items-center justify-between pt-3", children: [
391
+ A(e, r)
392
+ ) : x();
393
+ }, pe = (e = !1) => te ? null : /* @__PURE__ */ g("div", { className: "flex flex-1 items-center justify-between pt-3", children: [
389
394
  /* @__PURE__ */ g("div", { className: "flex items-center gap-3", children: [
390
395
  /* @__PURE__ */ t(
391
- ye,
396
+ xe,
392
397
  {
393
- icon: de,
394
- fontSize: P[u],
395
- iconSize: be[u],
396
- className: se,
398
+ icon: ge,
399
+ fontSize: _[u],
400
+ iconSize: Ie[u],
401
+ className: ae,
397
402
  onClick: () => b(c),
398
- children: Z
403
+ children: D
399
404
  }
400
405
  ),
401
- ne && /* @__PURE__ */ t(
402
- ye,
406
+ ce && /* @__PURE__ */ t(
407
+ xe,
403
408
  {
404
- icon: de,
405
- fontSize: P[u],
406
- iconSize: be[u],
407
- className: se,
409
+ icon: ge,
410
+ fontSize: _[u],
411
+ iconSize: Ie[u],
412
+ className: ae,
408
413
  onClick: () => f(c),
409
- children: D
414
+ children: ee
410
415
  }
411
416
  ),
412
- T == null ? void 0 : T({ nodePath: c, level: a, canAddNestedGroup: ne })
417
+ T == null ? void 0 : T({ nodePath: c, level: a, canAddNestedGroup: ce })
413
418
  ] }),
414
- e && x.length > 0 && /* @__PURE__ */ t(
415
- Ge,
419
+ e && N.length > 0 && /* @__PURE__ */ t(
420
+ Me,
416
421
  {
417
422
  type: "button",
418
423
  color: "link-gray",
419
424
  size: "sm",
420
- className: p("font-medium text-secondary hover:text-primary", P[u]),
425
+ className: m("font-medium text-secondary hover:text-primary", _[u]),
421
426
  onClick: () => {
422
- if (a === 0 && te) {
423
- te();
427
+ if (a === 0 && ne) {
428
+ ne();
424
429
  return;
425
430
  }
426
- for (let r = x.length - 1; r >= 0; r--) {
431
+ for (let r = N.length - 1; r >= 0; r--) {
427
432
  const s = [...c, r], n = r + 1;
428
- S != null && S({ nodePath: s, siblingCount: n }) || o(s);
433
+ I != null && I({ nodePath: s, siblingCount: n }) || i(s);
429
434
  }
430
435
  },
431
436
  children: "Clear Group"
@@ -437,40 +442,40 @@ function Je({
437
442
  "div",
438
443
  {
439
444
  className: "space-y-0 min-w-0 max-w-full",
440
- onMouseOver: le,
441
- onMouseLeave: le,
445
+ onMouseOver: ie,
446
+ onMouseLeave: ie,
442
447
  children: [
443
- I.length > 0 && /* @__PURE__ */ t(
444
- xe,
448
+ R.length > 0 && /* @__PURE__ */ t(
449
+ we,
445
450
  {
446
451
  axis: "y",
447
- values: I,
448
- onReorder: me,
449
- className: p("space-y-0", V),
450
- children: I.map((r, s) => he(r, s))
452
+ values: R,
453
+ onReorder: fe,
454
+ className: m("space-y-0", q),
455
+ children: R.map((r, s) => de(r, s))
451
456
  }
452
457
  ),
453
- fe(ke)
458
+ pe(Oe)
454
459
  ]
455
460
  }
456
461
  );
457
- return $ ? e : /* @__PURE__ */ t(Ie.Provider, { value: H, children: e });
462
+ return J ? e : /* @__PURE__ */ t(Le.Provider, { value: E, children: e });
458
463
  }
459
464
  return /* @__PURE__ */ g("div", { className: "space-y-0 min-w-0", children: [
460
- I.length > 0 && /* @__PURE__ */ t(
461
- xe,
465
+ R.length > 0 && /* @__PURE__ */ t(
466
+ we,
462
467
  {
463
468
  axis: "y",
464
- values: I,
465
- onReorder: me,
466
- className: p("space-y-0", V),
467
- children: I.map((e, r) => he(e, r))
469
+ values: R,
470
+ onReorder: fe,
471
+ className: m("space-y-0", q),
472
+ children: R.map((e, r) => de(e, r))
468
473
  }
469
474
  ),
470
- fe(!d)
475
+ pe(!p)
471
476
  ] });
472
477
  }
473
478
  export {
474
- Je as ConditionGroup,
475
- Je as default
479
+ Ue as ConditionGroup,
480
+ Ue as default
476
481
  };