@pibit.ai/cure-design-system 0.6.23 → 0.6.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.
@@ -102,7 +102,7 @@ const T = ({
102
102
  /* @__PURE__ */ r("nav", { className: "flex-1 pb-4 pr-2 overflow-y-auto overflow-x-hidden", children: i.sections.map((a) => /* @__PURE__ */ r(u, { children: h(
103
103
  (a == null ? void 0 : a.permissions) || [],
104
104
  /* @__PURE__ */ o("div", { className: n("mb-6"), children: [
105
- /* @__PURE__ */ r("div", { className: "py-0.5 px-2", children: /* @__PURE__ */ r("p", { className: "font-medium text-[10px] text-[var(--color-text-tertiary)] uppercase tracking-[1.3px] whitespace-nowrap", children: a.label }) }),
105
+ /* @__PURE__ */ r("div", { className: "py-0.5 px-2", children: /* @__PURE__ */ r("p", { className: "font-medium text-3xs text-[var(--color-text-tertiary)] uppercase tracking-[1.3px] whitespace-nowrap", children: a.label }) }),
106
106
  /* @__PURE__ */ r("ul", { className: "space-y-1", children: a.items.map((e) => {
107
107
  const t = e.href || e.label, l = E.has(t), N = e.items && e.items.length > 0, p = v(e);
108
108
  return N ? /* @__PURE__ */ r(u, { children: h(
@@ -255,7 +255,7 @@ const T = ({
255
255
  }) })
256
256
  ] }),
257
257
  a.showDisabled ? /* @__PURE__ */ o("div", { className: n("mb-6"), children: [
258
- /* @__PURE__ */ r("div", { className: "py-0.5 px-2", children: /* @__PURE__ */ r("p", { className: "font-medium text-[10px] text-[var(--color-text-tertiary)] uppercase tracking-[1.3px] whitespace-nowrap", children: a.label }) }),
258
+ /* @__PURE__ */ r("div", { className: "py-0.5 px-2", children: /* @__PURE__ */ r("p", { className: "font-medium text-3xs text-[var(--color-text-tertiary)] uppercase tracking-[1.3px] whitespace-nowrap", children: a.label }) }),
259
259
  /* @__PURE__ */ r("ul", { className: "", children: a.items.map((e) => {
260
260
  const t = e.href || e.label, l = v(e);
261
261
  return /* @__PURE__ */ r(
@@ -4,10 +4,10 @@ import { AlignLeft as Z, AlignCenter as B, AlignRight as G, ChevronDown as K, Ey
4
4
  import { Button as j } from "react-aria-components";
5
5
  import { cx as m } from "../../../utils/cn.js";
6
6
  import { Dropdown as N } from "../../../primitives/dropdown/dropdown.js";
7
- const a = ({
7
+ const s = ({
8
8
  icon: o,
9
9
  label: c,
10
- danger: s,
10
+ danger: a,
11
11
  submenu: f,
12
12
  selected: p,
13
13
  disabled: r,
@@ -25,7 +25,7 @@ const a = ({
25
25
  "flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium transition-colors w-full text-left",
26
26
  r ? "cursor-not-allowed text-disabled" : m(
27
27
  "cursor-pointer",
28
- s ? "text-error-primary hover:bg-error-primary" : p ? "bg-utility-brand-25 text-secondary" : "text-secondary hover:bg-primary_hover"
28
+ a ? "text-error-primary hover:bg-error-primary" : p ? "bg-utility-brand-25 text-secondary" : "text-secondary hover:bg-primary_hover"
29
29
  )
30
30
  ),
31
31
  children: [
@@ -35,7 +35,7 @@ const a = ({
35
35
  size: 16,
36
36
  className: m(
37
37
  "shrink-0",
38
- r ? "text-fg-disabled" : s ? "text-error-primary" : "text-fg-quaternary"
38
+ r ? "text-fg-disabled" : a ? "text-error-primary" : "text-fg-quaternary"
39
39
  )
40
40
  }
41
41
  ),
@@ -44,7 +44,7 @@ const a = ({
44
44
  f && /* @__PURE__ */ e(E, { size: 14, className: "shrink-0 text-fg-quaternary" })
45
45
  ]
46
46
  }
47
- ), i = () => /* @__PURE__ */ e("div", { className: "my-1 h-px w-full bg-secondary" }), M = ({ children: o }) => /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase tracking-wider text-tertiary", children: o }), le = ({ label: o, suffix: c }) => /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1.5 rounded-md border border-secondary bg-primary px-1.5 py-0.5", children: [
47
+ ), i = () => /* @__PURE__ */ e("div", { className: "my-1 h-px w-full bg-secondary" }), M = ({ children: o }) => /* @__PURE__ */ e("span", { className: "text-3xs font-medium uppercase tracking-wider text-tertiary", children: o }), le = ({ label: o, suffix: c }) => /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1.5 rounded-md border border-secondary bg-primary px-1.5 py-0.5", children: [
48
48
  /* @__PURE__ */ e("span", { className: "flex h-4 w-4 items-center justify-center rounded-sm border border-secondary text-[9px] font-semibold text-tertiary", children: "T" }),
49
49
  /* @__PURE__ */ e("span", { className: "text-xs font-semibold text-primary", children: o }),
50
50
  c && /* @__PURE__ */ e("span", { className: "text-xs text-tertiary", children: c })
@@ -55,7 +55,7 @@ const a = ({
55
55
  ], pe = ({
56
56
  column: o,
57
57
  columnLabel: c,
58
- fieldDef: s,
58
+ fieldDef: a,
59
59
  currentAlignment: f,
60
60
  textWrapped: p = !1,
61
61
  capabilities: r,
@@ -66,7 +66,7 @@ const a = ({
66
66
  isHeaderHovered: H = !1
67
67
  }) => {
68
68
  var _, q;
69
- const F = (s == null ? void 0 : s.data_type) ?? o.dataType, y = F === "LOOKUP" || o.variant === "lookup", L = F === "DERIVED" || o.variant === "derived", I = y ? "Hide field" : "Hide column", x = (r == null ? void 0 : r.sort) ?? !0, v = (r == null ? void 0 : r.align) ?? !0, k = (r == null ? void 0 : r.textWrap) ?? !1, w = (r == null ? void 0 : r.filter) ?? !0, b = (r == null ? void 0 : r.hide) ?? !0, [P, R] = z(!1), [U, A] = z(!1), V = !T || P || H, l = (t) => {
69
+ const F = (a == null ? void 0 : a.data_type) ?? o.dataType, y = F === "LOOKUP" || o.variant === "lookup", L = F === "DERIVED" || o.variant === "derived", I = y ? "Hide field" : "Hide column", x = (r == null ? void 0 : r.sort) ?? !0, v = (r == null ? void 0 : r.align) ?? !0, k = (r == null ? void 0 : r.textWrap) ?? !1, w = (r == null ? void 0 : r.filter) ?? !0, b = (r == null ? void 0 : r.hide) ?? !0, [P, R] = z(!1), [U, A] = z(!1), V = !T || P || H, l = (t) => {
70
70
  u(t), A(!1), R(!1);
71
71
  }, S = O.find((t) => t.id === f) ?? O[0], W = S.icon, C = h == null ? void 0 : h(o);
72
72
  return /* @__PURE__ */ n(
@@ -104,11 +104,11 @@ const a = ({
104
104
  /* @__PURE__ */ e(le, { label: c, suffix: "Object name" })
105
105
  ] }),
106
106
  /* @__PURE__ */ e(i, {}),
107
- /* @__PURE__ */ e(a, { icon: $, label: "View Field", onClick: () => l({ type: "lookup-view" }) }),
108
- /* @__PURE__ */ e(a, { icon: J, label: "Edit field", onClick: () => l({ type: "lookup-edit" }) }),
107
+ /* @__PURE__ */ e(s, { icon: $, label: "View Field", onClick: () => l({ type: "lookup-view" }) }),
108
+ /* @__PURE__ */ e(s, { icon: J, label: "Edit field", onClick: () => l({ type: "lookup-edit" }) }),
109
109
  /* @__PURE__ */ e(i, {}),
110
110
  /* @__PURE__ */ e(
111
- a,
111
+ s,
112
112
  {
113
113
  icon: Q,
114
114
  label: "Add field to right",
@@ -116,7 +116,7 @@ const a = ({
116
116
  }
117
117
  ),
118
118
  /* @__PURE__ */ e(
119
- a,
119
+ s,
120
120
  {
121
121
  icon: X,
122
122
  label: "Add field to left",
@@ -128,7 +128,7 @@ const a = ({
128
128
  L && /* @__PURE__ */ n(d, { children: [
129
129
  /* @__PURE__ */ n("div", { className: "flex flex-col gap-1.5 px-2 py-2", children: [
130
130
  /* @__PURE__ */ e(M, { children: "Formula" }),
131
- /* @__PURE__ */ e("div", { className: "text-xs font-medium text-secondary break-words", children: ((_ = s == null ? void 0 : s.formula) == null ? void 0 : _.trim()) || ((q = o.formula) == null ? void 0 : q.trim()) || c })
131
+ /* @__PURE__ */ e("div", { className: "text-xs font-medium text-secondary break-words", children: ((_ = a == null ? void 0 : a.formula) == null ? void 0 : _.trim()) || ((q = o.formula) == null ? void 0 : q.trim()) || c })
132
132
  ] }),
133
133
  /* @__PURE__ */ e(i, {})
134
134
  ] }),
@@ -139,7 +139,7 @@ const a = ({
139
139
  C && (x || v || k || w || b) && /* @__PURE__ */ e(i, {}),
140
140
  x && /* @__PURE__ */ n(d, { children: [
141
141
  /* @__PURE__ */ e(
142
- a,
142
+ s,
143
143
  {
144
144
  icon: Y,
145
145
  label: "Sort A to Z",
@@ -147,7 +147,7 @@ const a = ({
147
147
  }
148
148
  ),
149
149
  /* @__PURE__ */ e(
150
- a,
150
+ s,
151
151
  {
152
152
  icon: D,
153
153
  label: "Sort Z to A",
@@ -180,7 +180,7 @@ const a = ({
180
180
  placement: "right top",
181
181
  className: "w-44",
182
182
  children: /* @__PURE__ */ e("div", { className: "flex flex-col py-1 px-1.5", children: O.map((t) => /* @__PURE__ */ e(
183
- a,
183
+ s,
184
184
  {
185
185
  icon: t.icon,
186
186
  label: t.label,
@@ -196,7 +196,7 @@ const a = ({
196
196
  k && /* @__PURE__ */ n(d, { children: [
197
197
  (x || v) && /* @__PURE__ */ e(i, {}),
198
198
  /* @__PURE__ */ e(
199
- a,
199
+ s,
200
200
  {
201
201
  icon: ee,
202
202
  label: "Text wrap",
@@ -207,9 +207,9 @@ const a = ({
207
207
  ] }),
208
208
  (w || b) && /* @__PURE__ */ n(d, { children: [
209
209
  (x || v) && !k && /* @__PURE__ */ e(i, {}),
210
- w && /* @__PURE__ */ e(a, { icon: re, label: "Filter by", onClick: () => l({ type: "filter" }) }),
210
+ w && /* @__PURE__ */ e(s, { icon: re, label: "Filter by", onClick: () => l({ type: "filter" }) }),
211
211
  b && /* @__PURE__ */ e(
212
- a,
212
+ s,
213
213
  {
214
214
  icon: te,
215
215
  label: I,
@@ -222,7 +222,7 @@ const a = ({
222
222
  y && /* @__PURE__ */ n(d, { children: [
223
223
  /* @__PURE__ */ e(i, {}),
224
224
  /* @__PURE__ */ e(
225
- a,
225
+ s,
226
226
  {
227
227
  icon: ne,
228
228
  label: "Delete fields",
@@ -180,7 +180,7 @@ const L = ({ config: e, isDisabled: r }) => {
180
180
  o.id
181
181
  )),
182
182
  d.length > 0 && /* @__PURE__ */ s(f, { children: [
183
- /* @__PURE__ */ t("div", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold tracking-wide text-tertiary uppercase", children: "Shared with me" }),
183
+ /* @__PURE__ */ t("div", { className: "px-2.5 pb-1 pt-2 text-3xs font-semibold tracking-wide text-tertiary uppercase", children: "Shared with me" }),
184
184
  d.map((o) => /* @__PURE__ */ t(
185
185
  h,
186
186
  {
@@ -113,7 +113,7 @@ const H = ({
113
113
  root: "gap-2",
114
114
  textWrapper: c,
115
115
  label: e("text-xs font-medium", o),
116
- hint: "text-[11px]"
116
+ hint: "text-2xs"
117
117
  },
118
118
  md: {
119
119
  root: "gap-3",
@@ -1,8 +1,8 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { cx as m } from "../../utils/cn.js";
3
- import { Text as s } from "react-aria-components";
2
+ import { cx as s } from "../../utils/cn.js";
3
+ import { Text as m } from "react-aria-components";
4
4
  const i = {
5
- sm: "text-[11px]",
5
+ sm: "text-2xs",
6
6
  md: "text-xs",
7
7
  lg: "text-xs"
8
8
  }, p = ({
@@ -11,11 +11,11 @@ const i = {
11
11
  className: e,
12
12
  ...x
13
13
  }) => /* @__PURE__ */ o(
14
- s,
14
+ m,
15
15
  {
16
16
  ...x,
17
17
  slot: t ? "errorMessage" : "description",
18
- className: m(
18
+ className: s(
19
19
  "text-tertiary",
20
20
  i[r],
21
21
  // Invalid state
@@ -1,6 +1,6 @@
1
1
  import { jsx as s, jsxs as M, Fragment as me } from "react/jsx-runtime";
2
2
  import { useId as ge, useCallback as L, useMemo as B, useRef as G, useState as ue, createContext as we, useContext as H, useLayoutEffect as ye } from "react";
3
- import { useFilter as be, useInteractOutside as xe, FocusScope as ve, useFocusManager as De } from "react-aria";
3
+ import { useFilter as be, useInteractOutside as ve, FocusScope as xe, useFocusManager as De } from "react-aria";
4
4
  import { ChevronDown as Ne, SearchMd as ke } from "@untitledui/icons";
5
5
  import { ComboBox as Te, ListBox as Se, ComboBoxStateContext as Z, ButtonContext as ee, Group as Re, Input as Fe } from "react-aria-components";
6
6
  import { useListData as Ae } from "../../node_modules/react-stately/dist/private/data/useListData.js";
@@ -44,7 +44,7 @@ function $e({
44
44
  popoverRef: y
45
45
  }) {
46
46
  const d = H(Z);
47
- return xe({
47
+ return ve({
48
48
  ref: y,
49
49
  isDisabled: !(d != null && d.isOpen),
50
50
  onInteractOutside: (m) => {
@@ -169,7 +169,7 @@ const Ue = ({
169
169
  ...f
170
170
  }) => {
171
171
  var ae;
172
- const _ = ge(), { contains: V } = be({ sensitivity: "base" }), E = (ae = m == null ? void 0 : m.items) != null && ae.length ? m.items.map((n) => n.id) : [], v = L(
172
+ const _ = ge(), { contains: V } = be({ sensitivity: "base" }), E = (ae = m == null ? void 0 : m.items) != null && ae.length ? m.items.map((n) => n.id) : [], x = L(
173
173
  (n) => E.some((i) => String(i) === String(n)),
174
174
  [E]
175
175
  ), X = L(
@@ -179,9 +179,9 @@ const Ue = ({
179
179
  i,
180
180
  V
181
181
  );
182
- return (R || !v(n.id)) && A;
182
+ return (R || !x(n.id)) && A;
183
183
  },
184
- [V, v, R]
184
+ [V, x, R]
185
185
  ), w = Ae({
186
186
  initialItems: c,
187
187
  filter: X
@@ -190,34 +190,34 @@ const Ue = ({
190
190
  ) : c : [], [c, z, w.filterText, V]), P = B(() => {
191
191
  if (D.length === 0) return "unselected";
192
192
  const n = D.filter(
193
- (i) => v(i.id)
193
+ (i) => x(i.id)
194
194
  ).length;
195
195
  return n === 0 ? "unselected" : n === D.length ? "selected" : "indeterminate";
196
- }, [D, v]), t = G(!1), N = L(() => {
196
+ }, [D, x]), t = G(!1), N = L(() => {
197
197
  t.current = !0, setTimeout(() => {
198
198
  t.current = !1;
199
199
  }, 0);
200
200
  }, []), J = L(() => {
201
201
  N();
202
- const n = P !== "selected", i = D.map((x) => x.id), A = new Set(i.map(String)), K = n ? [.../* @__PURE__ */ new Set([...E, ...i])] : E.filter((x) => !A.has(String(x))), W = D.filter((x) => !v(x.id)), U = D.filter((x) => v(x.id)).map((x) => x.id);
202
+ const n = P !== "selected", i = D.map((v) => v.id), A = new Set(i.map(String)), K = n ? [.../* @__PURE__ */ new Set([...E, ...i])] : E.filter((v) => !A.has(String(v))), W = D.filter((v) => !x(v.id)), U = D.filter((v) => x(v.id)).map((v) => v.id);
203
203
  if (n && W.length > 0 ? m.append(...W) : !n && U.length > 0 && m.remove(...U), T) {
204
204
  T(K);
205
205
  return;
206
206
  }
207
207
  if (n) {
208
- for (const x of D)
209
- v(x.id) || b == null || b(x.id);
208
+ for (const v of D)
209
+ x(v.id) || b == null || b(v.id);
210
210
  return;
211
211
  }
212
- for (const x of D)
213
- v(x.id) && (l == null || l(x.id));
212
+ for (const v of D)
213
+ x(v.id) && (l == null || l(v.id));
214
214
  }, [
215
215
  N,
216
216
  P,
217
217
  D,
218
218
  E,
219
219
  m,
220
- v,
220
+ x,
221
221
  T,
222
222
  b,
223
223
  l
@@ -238,7 +238,7 @@ const Ue = ({
238
238
  }, 0);
239
239
  const A = w.getItem(n) ?? (c == null ? void 0 : c.find((K) => String(K.id) === String(n)));
240
240
  if (A) {
241
- if (v(n)) {
241
+ if (x(n)) {
242
242
  const K = E.find((W) => String(W) === i) ?? n;
243
243
  m.remove(K), l == null || l(K);
244
244
  } else
@@ -313,7 +313,7 @@ const Ue = ({
313
313
  className: k(
314
314
  "text-tertiary",
315
315
  ce[d],
316
- "-mt-0.5 leading-[18px]"
316
+ "-mt-0.5 leading-4.5"
317
317
  ),
318
318
  children: j
319
319
  }
@@ -510,7 +510,7 @@ const Ue = ({
510
510
  e == null || e.close();
511
511
  break;
512
512
  }
513
- }, v = ((z = (w = a == null ? void 0 : a.selectedItems) == null ? void 0 : w.items) == null ? void 0 : z.length) === 0;
513
+ }, x = ((z = (w = a == null ? void 0 : a.selectedItems) == null ? void 0 : w.items) == null ? void 0 : z.length) === 0;
514
514
  return /* @__PURE__ */ M("div", { className: "relative min-w-0 w-full flex-1", children: [
515
515
  /* @__PURE__ */ M(
516
516
  "div",
@@ -525,7 +525,7 @@ const Ue = ({
525
525
  ) : "flex-nowrap items-center overflow-x-auto overflow-y-hidden scrollbar-hide"
526
526
  ),
527
527
  children: [
528
- /* @__PURE__ */ s(ee.Provider, { value: null, children: !v && ((P = (D = a == null ? void 0 : a.selectedItems) == null ? void 0 : D.items) == null ? void 0 : P.map((t) => /* @__PURE__ */ M(
528
+ /* @__PURE__ */ s(ee.Provider, { value: null, children: !x && ((P = (D = a == null ? void 0 : a.selectedItems) == null ? void 0 : D.items) == null ? void 0 : P.map((t) => /* @__PURE__ */ M(
529
529
  "span",
530
530
  {
531
531
  "data-multiselect-chip": !0,
@@ -575,7 +575,7 @@ const Ue = ({
575
575
  className: k(
576
576
  "relative flex flex-1 flex-row items-center",
577
577
  o ? "min-w-[20%]" : "min-w-0",
578
- !v && "ml-0.5",
578
+ !x && "ml-0.5",
579
579
  y && "min-w-[30%]"
580
580
  ),
581
581
  children: [
@@ -583,7 +583,7 @@ const Ue = ({
583
583
  Fe,
584
584
  {
585
585
  ref: T,
586
- placeholder: v ? m : void 0,
586
+ placeholder: x ? m : void 0,
587
587
  onKeyDown: F,
588
588
  onMouseDown: _,
589
589
  onFocus: V,
@@ -692,7 +692,7 @@ const Ue = ({
692
692
  },
693
693
  children: ({ isDisabled: u, isFocusWithin: h }) => /* @__PURE__ */ M(me, { children: [
694
694
  l && /* @__PURE__ */ s(l, { className: "pointer-events-none size-5 shrink-0 text-fg-quaternary" }),
695
- /* @__PURE__ */ s(ve, { contain: !1, autoFocus: !1, restoreFocus: !1, children: /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(
695
+ /* @__PURE__ */ s(xe, { contain: !1, autoFocus: !1, restoreFocus: !1, children: /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(
696
696
  Je,
697
697
  {
698
698
  inputRef: g,