@dilipod/ui 0.4.4 → 0.4.6
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/components/impact-metrics-form.d.ts.map +1 -1
- package/dist/index.js +97 -109
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +97 -109
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/impact-metrics-form.tsx +99 -122
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impact-metrics-form.d.ts","sourceRoot":"","sources":["../../src/components/impact-metrics-form.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"impact-metrics-form.d.ts","sourceRoot":"","sources":["../../src/components/impact-metrics-form.tsx"],"names":[],"mappings":"AAoBA,MAAM,WAAW,aAAa;IAC5B,0BAA0B,EAAE,MAAM,CAAA;IAClC,iBAAiB,EAAE,MAAM,CAAA;IACzB,cAAc,EAAE,MAAM,CAAA;IACtB,8BAA8B,EAAE,MAAM,CAAA;CACvC;AAED,MAAM,WAAW,sBAAsB;IACrC,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,6BAA6B;IAC7B,cAAc,EAAE,aAAa,CAAA;IAC7B,uCAAuC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wFAAwF;IACxF,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IACvE,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,cAAc,EACd,eAAmB,EACnB,YAAwB,EACxB,WAA4B,EAC5B,MAAM,EACN,UAAiB,EACjB,SAAS,GACV,EAAE,sBAAsB,2CA2OxB"}
|
package/dist/index.js
CHANGED
|
@@ -4272,14 +4272,14 @@ function ImpactMetricsForm({
|
|
|
4272
4272
|
setIsEditing(false);
|
|
4273
4273
|
};
|
|
4274
4274
|
const hoursSavedPerYear = Math.round(metrics.fte_equivalent * HOURS_PER_FTE_YEAR);
|
|
4275
|
+
const timePerTaskHours = metrics.time_saved_minutes_per_run / 60;
|
|
4276
|
+
const impliedFrequencyPerYear = timePerTaskHours > 0 ? Math.round(hoursSavedPerYear / timePerTaskHours) : 0;
|
|
4277
|
+
const impliedFrequencyPerMonth = Math.round(impliedFrequencyPerYear / 12);
|
|
4275
4278
|
const laborSavingsPerYear = metrics.fte_equivalent * HOURS_PER_FTE_YEAR * metrics.hourly_rate_euros;
|
|
4276
4279
|
const netAnnualSavings = laborSavingsPerYear - workerCostPerYear;
|
|
4277
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
4278
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4279
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4280
|
-
/* @__PURE__ */ jsxRuntime.jsx(IconBox, { size: "sm", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "currentColor", viewBox: "0 0 256 256", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-88a16,16,0,1,1-16-16A16,16,0,0,1,144,128Zm-56,0a16,16,0,1,1-16-16A16,16,0,0,1,88,128Zm112,0a16,16,0,1,1-16-16A16,16,0,0,1,200,128Z" }) }) }),
|
|
4281
|
-
"Impact Metrics (ROI)"
|
|
4282
|
-
] }),
|
|
4280
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn("", className), children: /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "p-5", children: [
|
|
4281
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4282
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide", children: "Impact Metrics (ROI)" }),
|
|
4283
4283
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: isEditing ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4284
4284
|
isInitiallySaved && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4285
4285
|
Button,
|
|
@@ -4308,117 +4308,105 @@ function ImpactMetricsForm({
|
|
|
4308
4308
|
children: "Edit"
|
|
4309
4309
|
}
|
|
4310
4310
|
) })
|
|
4311
|
-
] })
|
|
4312
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4313
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
4314
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
4315
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
4316
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
"
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
metrics.time_saved_minutes_per_run,
|
|
4334
|
-
" ",
|
|
4335
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-normal text-muted-foreground", children: "min" })
|
|
4336
|
-
] }),
|
|
4337
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "How long manually" })
|
|
4311
|
+
] }),
|
|
4312
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 lg:grid-cols-4 gap-6", children: [
|
|
4313
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4314
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground uppercase tracking-wide mb-1", children: "Time per Task" }),
|
|
4315
|
+
isEditing ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-1", children: [
|
|
4316
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4317
|
+
"input",
|
|
4318
|
+
{
|
|
4319
|
+
type: "number",
|
|
4320
|
+
value: metrics.time_saved_minutes_per_run,
|
|
4321
|
+
onChange: (e) => setMetrics((prev) => ({
|
|
4322
|
+
...prev,
|
|
4323
|
+
time_saved_minutes_per_run: parseInt(e.target.value) || 0
|
|
4324
|
+
})),
|
|
4325
|
+
className: "w-16 px-2 py-1 text-2xl font-bold border border-border rounded-sm focus:outline-none focus:ring-2 focus:ring-[var(--cyan)] bg-background",
|
|
4326
|
+
min: "0"
|
|
4327
|
+
}
|
|
4328
|
+
),
|
|
4329
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "min" })
|
|
4330
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-2xl font-bold", children: [
|
|
4331
|
+
metrics.time_saved_minutes_per_run,
|
|
4332
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-normal text-muted-foreground ml-1", children: "min" })
|
|
4338
4333
|
] })
|
|
4339
4334
|
] }),
|
|
4340
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
4341
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
4342
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
4343
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
"
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
metrics.hourly_rate_euros,
|
|
4364
|
-
" ",
|
|
4365
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-normal text-muted-foreground", children: "/hr" })
|
|
4366
|
-
] }),
|
|
4367
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "Employee hourly cost" })
|
|
4335
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4336
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground uppercase tracking-wide mb-1", children: "Manual Cost" }),
|
|
4337
|
+
isEditing ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-1", children: [
|
|
4338
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "\u20AC" }),
|
|
4339
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4340
|
+
"input",
|
|
4341
|
+
{
|
|
4342
|
+
type: "number",
|
|
4343
|
+
value: metrics.hourly_rate_euros,
|
|
4344
|
+
onChange: (e) => setMetrics((prev) => ({
|
|
4345
|
+
...prev,
|
|
4346
|
+
hourly_rate_euros: parseFloat(e.target.value) || 0
|
|
4347
|
+
})),
|
|
4348
|
+
className: "w-16 px-2 py-1 text-2xl font-bold border border-border rounded-sm focus:outline-none focus:ring-2 focus:ring-[var(--cyan)] bg-background",
|
|
4349
|
+
min: "0",
|
|
4350
|
+
step: "0.5"
|
|
4351
|
+
}
|
|
4352
|
+
),
|
|
4353
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "/hr" })
|
|
4354
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-2xl font-bold", children: [
|
|
4355
|
+
"\u20AC",
|
|
4356
|
+
metrics.hourly_rate_euros,
|
|
4357
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-normal text-muted-foreground ml-1", children: "/hr" })
|
|
4368
4358
|
] })
|
|
4369
4359
|
] }),
|
|
4370
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
4371
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
4372
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
4373
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
"
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground mt-1", children: [
|
|
4397
|
-
"% of FTE (",
|
|
4398
|
-
hoursSavedPerYear,
|
|
4399
|
-
"h/year)"
|
|
4400
|
-
] })
|
|
4360
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4361
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground uppercase tracking-wide mb-1", children: "Job Portion" }),
|
|
4362
|
+
isEditing ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-1", children: [
|
|
4363
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4364
|
+
"input",
|
|
4365
|
+
{
|
|
4366
|
+
type: "number",
|
|
4367
|
+
value: Math.round(metrics.fte_equivalent * 100),
|
|
4368
|
+
onChange: (e) => setMetrics((prev) => ({
|
|
4369
|
+
...prev,
|
|
4370
|
+
fte_equivalent: (parseFloat(e.target.value) || 0) / 100
|
|
4371
|
+
})),
|
|
4372
|
+
className: "w-16 px-2 py-1 text-2xl font-bold border border-border rounded-sm focus:outline-none focus:ring-2 focus:ring-[var(--cyan)] bg-background",
|
|
4373
|
+
min: "0",
|
|
4374
|
+
max: "1000",
|
|
4375
|
+
step: "5"
|
|
4376
|
+
}
|
|
4377
|
+
),
|
|
4378
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "%" })
|
|
4379
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-2xl font-bold", children: [
|
|
4380
|
+
Math.round(metrics.fte_equivalent * 100),
|
|
4381
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-normal text-muted-foreground ml-1", children: "%" })
|
|
4382
|
+
] }),
|
|
4383
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground mt-0.5", children: [
|
|
4384
|
+
hoursSavedPerYear,
|
|
4385
|
+
"h/year"
|
|
4401
4386
|
] })
|
|
4402
4387
|
] }),
|
|
4403
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
4404
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
4405
|
-
/* @__PURE__ */ jsxRuntime.jsxs("
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
" labor \u2212 \u20AC",
|
|
4415
|
-
workerCostPerYear,
|
|
4416
|
-
" worker"
|
|
4417
|
-
] })
|
|
4388
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4389
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground uppercase tracking-wide mb-1", children: "Net Annual Savings" }),
|
|
4390
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: cn("text-2xl font-bold", netAnnualSavings >= 0 ? "text-[var(--cyan)]" : "text-red-500"), children: [
|
|
4391
|
+
"\u20AC",
|
|
4392
|
+
netAnnualSavings.toLocaleString(void 0, { maximumFractionDigits: 0 })
|
|
4393
|
+
] }),
|
|
4394
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground mt-0.5", children: [
|
|
4395
|
+
"\u20AC",
|
|
4396
|
+
laborSavingsPerYear.toLocaleString(void 0, { maximumFractionDigits: 0 }),
|
|
4397
|
+
" \u2212 \u20AC",
|
|
4398
|
+
workerCostPerYear
|
|
4418
4399
|
] })
|
|
4419
4400
|
] })
|
|
4420
|
-
] })
|
|
4421
|
-
|
|
4401
|
+
] }),
|
|
4402
|
+
impliedFrequencyPerYear > 0 && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground mt-4 pt-3 border-t border-border/50", children: [
|
|
4403
|
+
"Implied: ~",
|
|
4404
|
+
impliedFrequencyPerMonth,
|
|
4405
|
+
"\xD7/month (",
|
|
4406
|
+
impliedFrequencyPerYear,
|
|
4407
|
+
"\xD7/year)"
|
|
4408
|
+
] })
|
|
4409
|
+
] }) });
|
|
4422
4410
|
}
|
|
4423
4411
|
|
|
4424
4412
|
// src/index.ts
|