@devalok/shilp-sutra-karm 0.20.1 → 0.20.2

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.
@@ -200,7 +200,7 @@ const z = w.forwardRef(
200
200
  "button",
201
201
  {
202
202
  onClick: c,
203
- className: "flex items-center gap-ds-02b rounded-ds-lg px-ds-03 py-ds-02b text-surface-fg-muted transition-colors hover:bg-surface-2",
203
+ className: "flex items-center gap-ds-02b rounded-ds-lg px-ds-03 py-ds-02b text-surface-fg-muted transition-colors hover:bg-surface-3",
204
204
  children: [
205
205
  /* @__PURE__ */ e(E, { className: "h-ico-sm w-ico-sm" }),
206
206
  /* @__PURE__ */ e("span", { className: "text-ds-sm", children: "New Chat" })
@@ -215,8 +215,8 @@ const z = w.forwardRef(
215
215
  "div",
216
216
  {
217
217
  className: x(
218
- "group flex items-center gap-ds-04 border-b border-surface-border px-ds-05 py-ds-04 transition-colors hover:bg-surface-2",
219
- d === t.id && "bg-surface-2"
218
+ "group flex items-center gap-ds-04 border-b border-surface-border px-ds-05 py-ds-04 transition-colors hover:bg-surface-3",
219
+ d === t.id && "bg-surface-3"
220
220
  ),
221
221
  children: [
222
222
  /* @__PURE__ */ s(
@@ -1945,7 +1945,7 @@ const ua = Object.assign(We, {
1945
1945
  {
1946
1946
  "aria-label": "Previous",
1947
1947
  onClick: () => h("prev"),
1948
- className: "rounded-ds-full p-ds-02 hover:bg-surface-2",
1948
+ className: "rounded-ds-full p-ds-02 hover:bg-surface-3",
1949
1949
  children: /* @__PURE__ */ e(Ne, { className: "h-ico-md w-ico-md text-surface-fg-muted" })
1950
1950
  }
1951
1951
  ),
@@ -1954,7 +1954,7 @@ const ua = Object.assign(We, {
1954
1954
  {
1955
1955
  "aria-label": "Next",
1956
1956
  onClick: () => h("next"),
1957
- className: "rounded-ds-full p-ds-02 hover:bg-surface-2",
1957
+ className: "rounded-ds-full p-ds-02 hover:bg-surface-3",
1958
1958
  children: /* @__PURE__ */ e(ye, { className: "h-ico-md w-ico-md text-surface-fg-muted" })
1959
1959
  }
1960
1960
  )
@@ -85,7 +85,7 @@ const ze = n.forwardRef(
85
85
  },
86
86
  className: h(
87
87
  "shrink-0 rounded p-ds-01 transition-colors",
88
- a ? "hover:bg-surface-2" : "cursor-default"
88
+ a ? "hover:bg-surface-3" : "cursor-default"
89
89
  ),
90
90
  children: r ? /* @__PURE__ */ s(js, { className: "h-ico-sm w-ico-sm text-accent-11", stroke: 1.5 }) : /* @__PURE__ */ s(Os, { className: "h-ico-sm w-ico-sm text-surface-fg-subtle", stroke: 1.5 })
91
91
  }
@@ -434,7 +434,7 @@ const Ue = n.forwardRef(
434
434
  href: /^https?:\/\//.test(e.externalUrl) ? e.externalUrl : "#",
435
435
  target: "_blank",
436
436
  rel: "noopener noreferrer",
437
- className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md transition-colors hover:bg-surface-2",
437
+ className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md transition-colors hover:bg-surface-3",
438
438
  title: e.externalLabel ?? "Open externally",
439
439
  children: /* @__PURE__ */ s(Bs, { className: "h-ico-sm w-ico-sm text-surface-fg-subtle" })
440
440
  }
@@ -445,7 +445,7 @@ const Ue = n.forwardRef(
445
445
  href: /^https?:\/\//.test(e.downloadUrl) ? e.downloadUrl : "#",
446
446
  target: "_blank",
447
447
  rel: "noopener noreferrer",
448
- className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md transition-colors hover:bg-surface-2",
448
+ className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md transition-colors hover:bg-surface-3",
449
449
  title: "Download",
450
450
  children: /* @__PURE__ */ s(Vs, { className: "h-ico-sm w-ico-sm text-surface-fg-subtle" })
451
451
  }
@@ -13,24 +13,24 @@ import { Tooltip as ae, TooltipTrigger as se, TooltipContent as ne, TooltipProvi
13
13
  function ce(t, e, s, o) {
14
14
  if (t.length < 2) return { path: "", endX: 0, endY: 0, startX: 0 };
15
15
  const a = t.length, i = e - o * 2, c = s - o * 2;
16
- let m = Math.min(...t), p = Math.max(...t);
17
- if (p - m < 0.1) {
18
- const d = (p + m) / 2;
19
- m = d - 0.05, p = d + 0.05;
16
+ let m = Math.min(...t), f = Math.max(...t);
17
+ if (f - m < 0.1) {
18
+ const d = (f + m) / 2;
19
+ m = d - 0.05, f = d + 0.05;
20
20
  }
21
- const f = t.map((d, h) => o + h / (a - 1) * i), n = t.map(
22
- (d) => o + (1 - (d - m) / (p - m)) * c
21
+ const p = t.map((d, h) => o + h / (a - 1) * i), n = t.map(
22
+ (d) => o + (1 - (d - m) / (f - m)) * c
23
23
  ), l = [];
24
- l.push(`M ${f[0]} ${n[0]}`);
24
+ l.push(`M ${p[0]} ${n[0]}`);
25
25
  for (let d = 0; d < a - 1; d++) {
26
- const h = f[Math.max(0, d - 1)], g = n[Math.max(0, d - 1)], w = f[d], x = n[d], N = f[d + 1], v = n[d + 1], B = f[Math.min(a - 1, d + 2)], I = n[Math.min(a - 1, d + 2)], E = (N - h) / 6, X = (v - g) / 6, z = (B - w) / 6, F = (I - x) / 6, K = w + E, O = x + X, Y = N - z, _ = v - F;
26
+ const h = p[Math.max(0, d - 1)], g = n[Math.max(0, d - 1)], w = p[d], x = n[d], N = p[d + 1], v = n[d + 1], B = p[Math.min(a - 1, d + 2)], I = n[Math.min(a - 1, d + 2)], E = (N - h) / 6, X = (v - g) / 6, z = (B - w) / 6, F = (I - x) / 6, K = w + E, O = x + X, Y = N - z, _ = v - F;
27
27
  l.push(`C ${K} ${O}, ${Y} ${_}, ${N} ${v}`);
28
28
  }
29
29
  return {
30
30
  path: l.join(" "),
31
- endX: f[a - 1],
31
+ endX: p[a - 1],
32
32
  endY: n[a - 1],
33
- startX: f[0]
33
+ startX: p[0]
34
34
  };
35
35
  }
36
36
  function le(t) {
@@ -41,12 +41,12 @@ function le(t) {
41
41
  return a > 0.05 ? { stroke: "var(--success-9)", fill: "var(--success-4)" } : a < -0.05 ? { stroke: "var(--error-9)", fill: "var(--error-4)" } : { stroke: "var(--warning-9)", fill: "var(--warning-4)" };
42
42
  }
43
43
  function ie({ trend: t, id: e }) {
44
- const { path: i, endX: c, endY: m, startX: p } = ce(
44
+ const { path: i, endX: c, endY: m, startX: f } = ce(
45
45
  t,
46
46
  48,
47
47
  20,
48
48
  2
49
- ), { stroke: f, fill: n } = le(t);
49
+ ), { stroke: p, fill: n } = le(t);
50
50
  if (!i) return null;
51
51
  const l = `sparkline-fill-${e}`;
52
52
  return /* @__PURE__ */ u(
@@ -65,7 +65,7 @@ function ie({ trend: t, id: e }) {
65
65
  /* @__PURE__ */ r(
66
66
  "path",
67
67
  {
68
- d: `${i} L ${c} 18 L ${p} 18 Z`,
68
+ d: `${i} L ${c} 18 L ${f} 18 Z`,
69
69
  fill: `url(#${l})`
70
70
  }
71
71
  ),
@@ -74,13 +74,13 @@ function ie({ trend: t, id: e }) {
74
74
  {
75
75
  d: i,
76
76
  fill: "none",
77
- stroke: f,
77
+ stroke: p,
78
78
  strokeWidth: 1.5,
79
79
  strokeLinecap: "round",
80
80
  strokeLinejoin: "round"
81
81
  }
82
82
  ),
83
- /* @__PURE__ */ r("circle", { cx: c, cy: m, r: 2, fill: f })
83
+ /* @__PURE__ */ r("circle", { cx: c, cy: m, r: 2, fill: p })
84
84
  ]
85
85
  }
86
86
  );
@@ -123,10 +123,10 @@ function ue({
123
123
  function me(t) {
124
124
  return t > 75 ? "success" : t >= 25 ? "warning" : "error";
125
125
  }
126
- const pe = k.forwardRef(function({ project: e, onClick: s, loading: o, className: a, ...i }, c) {
126
+ const fe = k.forwardRef(function({ project: e, onClick: s, loading: o, className: a, ...i }, c) {
127
127
  if (o)
128
128
  return /* @__PURE__ */ r(de, { className: a, ...i });
129
- const { id: m, name: p, completed: f, total: n, overdue: l, urgent: d, contextLine: h, trend: g } = e, w = n > 0 ? Math.round(f / n * 100) : 0, x = [];
129
+ const { id: m, name: f, completed: p, total: n, overdue: l, urgent: d, contextLine: h, trend: g } = e, w = n > 0 ? Math.round(p / n * 100) : 0, x = [];
130
130
  h && x.push(
131
131
  /* @__PURE__ */ r("span", { children: h }, "ctx")
132
132
  ), l && l > 0 && (x.length > 0 && x.push(
@@ -160,14 +160,14 @@ const pe = k.forwardRef(function({ project: e, onClick: s, loading: o, className
160
160
  ...M(i),
161
161
  children: /* @__PURE__ */ u("div", { className: "flex flex-col gap-ds-03", children: [
162
162
  /* @__PURE__ */ u("div", { className: "flex items-center justify-between gap-ds-02", children: [
163
- /* @__PURE__ */ r("span", { className: "min-w-0 truncate text-ds-md font-semibold text-surface-fg", children: p }),
163
+ /* @__PURE__ */ r("span", { className: "min-w-0 truncate text-ds-md font-semibold text-surface-fg", children: f }),
164
164
  /* @__PURE__ */ r(ue, { urgent: d, overdue: l })
165
165
  ] }),
166
166
  /* @__PURE__ */ u("div", { className: "flex items-center gap-ds-03", children: [
167
167
  /* @__PURE__ */ u("div", { className: "flex-1 flex items-center gap-ds-03", children: [
168
- /* @__PURE__ */ r("div", { className: "flex-1", children: /* @__PURE__ */ r(R, { size: "sm", color: me(w), value: w, "aria-label": `${p} progress` }) }),
168
+ /* @__PURE__ */ r("div", { className: "flex-1", children: /* @__PURE__ */ r(R, { size: "sm", color: me(w), value: w, "aria-label": `${f} progress` }) }),
169
169
  /* @__PURE__ */ u("span", { className: "shrink-0 text-ds-sm text-surface-fg-muted", children: [
170
- f,
170
+ p,
171
171
  "/",
172
172
  n,
173
173
  " tasks"
@@ -180,7 +180,7 @@ const pe = k.forwardRef(function({ project: e, onClick: s, loading: o, className
180
180
  }
181
181
  );
182
182
  });
183
- pe.displayName = "ProjectHealthCard";
183
+ fe.displayName = "ProjectHealthCard";
184
184
  const j = q(null);
185
185
  function y() {
186
186
  const t = Z(j);
@@ -188,7 +188,7 @@ function y() {
188
188
  throw new Error("useWeekHeatmap must be used within a WeekHeatmapProvider");
189
189
  return t;
190
190
  }
191
- function fe(t, e) {
191
+ function pe(t, e) {
192
192
  const s = t.filter((a) => a.date < e).sort((a, i) => i.date.localeCompare(a.date));
193
193
  let o = 0;
194
194
  for (const a of s)
@@ -206,14 +206,14 @@ function A({
206
206
  today: a
207
207
  }) {
208
208
  const i = a ?? (/* @__PURE__ */ new Date()).toISOString().split("T")[0], c = U(() => {
209
- const m = e.reduce((n, l) => n + l.completed, 0), p = e.reduce((n, l) => n + l.total, 0), f = fe(e, i);
209
+ const m = e.reduce((n, l) => n + l.completed, 0), f = e.reduce((n, l) => n + l.total, 0), p = pe(e, i);
210
210
  return {
211
211
  days: e,
212
212
  onDayClick: s,
213
213
  overdue: o,
214
214
  totalCompleted: m,
215
- totalTasks: p,
216
- streak: f,
215
+ totalTasks: f,
216
+ streak: p,
217
217
  today: i
218
218
  };
219
219
  }, [e, s, o, i]);
@@ -221,7 +221,7 @@ function A({
221
221
  }
222
222
  A.displayName = "WeekHeatmapProvider";
223
223
  const H = k.forwardRef(
224
- function({ days: e, onDayClick: s, overdue: o, today: a, className: i, children: c, ...m }, p) {
224
+ function({ days: e, onDayClick: s, overdue: o, today: a, className: i, children: c, ...m }, f) {
225
225
  return /* @__PURE__ */ r(
226
226
  A,
227
227
  {
@@ -229,7 +229,7 @@ const H = k.forwardRef(
229
229
  onDayClick: s,
230
230
  overdue: o,
231
231
  today: a,
232
- children: /* @__PURE__ */ r("div", { ref: p, className: b("flex flex-col gap-ds-04", i), ...m, children: c })
232
+ children: /* @__PURE__ */ r("div", { ref: f, className: b("flex flex-col gap-ds-04 rounded-ds-md border border-surface-border bg-surface-2 p-ds-04", i), ...m, children: c })
233
233
  }
234
234
  );
235
235
  }
@@ -259,11 +259,11 @@ const be = {
259
259
  empty: "bg-surface-3 border border-dashed border-surface-border text-surface-fg-subtle"
260
260
  }, W = k.forwardRef(
261
261
  function({ day: e, index: s, focusedIndex: o, onFocusChange: a }, i) {
262
- const { onDayClick: c, today: m } = y(), p = ke(e, m), f = ge(e.date), n = p === "empty", l = /* @__PURE__ */ u("div", { className: "flex flex-col", children: [
262
+ const { onDayClick: c, today: m } = y(), f = ke(e, m), p = ge(e.date), n = f === "empty", l = /* @__PURE__ */ u("div", { className: "flex flex-col", children: [
263
263
  /* @__PURE__ */ r("span", { children: xe(e.date) }),
264
264
  /* @__PURE__ */ r("span", { children: e.total > 0 ? `${e.completed} of ${e.total} completed` : "No tasks" })
265
265
  ] }), d = () => {
266
- n || p === "future" || c == null || c(e.date);
266
+ n || f === "future" || c == null || c(e.date);
267
267
  }, h = (g) => {
268
268
  (g.key === "Enter" || g.key === " ") && (g.preventDefault(), c == null || c(e.date));
269
269
  };
@@ -275,20 +275,20 @@ const be = {
275
275
  role: "gridcell",
276
276
  tabIndex: o === s ? 0 : -1,
277
277
  "aria-disabled": n || void 0,
278
- "aria-label": `${f}, ${e.completed} of ${e.total} completed`,
278
+ "aria-label": `${p}, ${e.completed} of ${e.total} completed`,
279
279
  className: "flex cursor-pointer flex-col items-center gap-ds-02 outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent-7",
280
280
  onClick: d,
281
281
  onFocus: () => a(s),
282
282
  onKeyDown: h,
283
283
  whileTap: { scale: 0.95 },
284
284
  children: [
285
- /* @__PURE__ */ r("span", { className: "text-ds-xs text-surface-fg-muted", children: f }),
285
+ /* @__PURE__ */ r("span", { className: "text-ds-xs text-surface-fg-muted", children: p }),
286
286
  /* @__PURE__ */ r(
287
287
  "div",
288
288
  {
289
289
  className: b(
290
290
  "flex h-8 w-10 items-center justify-center rounded-ds-md transition-colors duration-150",
291
- be[p]
291
+ be[f]
292
292
  )
293
293
  }
294
294
  ),
@@ -307,7 +307,7 @@ const be = {
307
307
  W.displayName = "WeekHeatmapDay";
308
308
  const D = k.forwardRef(
309
309
  function({ className: e, ...s }, o) {
310
- const { days: a, today: i } = y(), [c, m] = J(0), p = Q([]), f = V(
310
+ const { days: a, today: i } = y(), [c, m] = J(0), f = Q([]), p = V(
311
311
  (n) => {
312
312
  var d;
313
313
  let l = c;
@@ -327,7 +327,7 @@ const D = k.forwardRef(
327
327
  default:
328
328
  return;
329
329
  }
330
- m(l), (d = p.current[l]) == null || d.focus();
330
+ m(l), (d = f.current[l]) == null || d.focus();
331
331
  },
332
332
  [c, a.length]
333
333
  );
@@ -339,14 +339,14 @@ const D = k.forwardRef(
339
339
  "aria-label": "Weekly task completion",
340
340
  delay: 0.05,
341
341
  className: b("grid grid-cols-7 gap-ds-03", e),
342
- onKeyDown: f,
342
+ onKeyDown: p,
343
343
  ...M(s),
344
344
  children: /* @__PURE__ */ r("div", { role: "row", className: "contents", children: a.map((n, l) => {
345
345
  const d = n.date === i, h = /* @__PURE__ */ r(
346
346
  W,
347
347
  {
348
348
  ref: (g) => {
349
- p.current[l] = g;
349
+ f.current[l] = g;
350
350
  },
351
351
  day: n,
352
352
  index: l,
@@ -442,7 +442,7 @@ const Pe = Object.assign(L, {
442
442
  export {
443
443
  Me as AttendanceCTA,
444
444
  Re as DailyBrief,
445
- pe as ProjectHealthCard,
445
+ fe as ProjectHealthCard,
446
446
  je as Scratchpad,
447
447
  Ae as ScratchpadProvider,
448
448
  Le as ScratchpadWidget,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devalok/shilp-sutra-karm",
3
- "version": "0.20.1",
3
+ "version": "0.20.2",
4
4
  "description": "Domain components for Karm — board, tasks, chat, dashboard, client, and admin",
5
5
  "license": "MIT",
6
6
  "type": "module",