@burdenoff/microfe-healthybowl 2026.811.6 → 2026.811.7
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/healthybowl/components/AnalyticsControls.js +46 -0
- package/dist/healthybowl/components/AnalyticsControls.js.map +1 -0
- package/dist/healthybowl/components/index.js +1 -0
- package/dist/healthybowl/pages/livestock/HerdStatsCard.js +207 -181
- package/dist/healthybowl/pages/livestock/HerdStatsCard.js.map +1 -1
- package/dist/healthybowl/pages/livestock/LivestockFeedCard.js +95 -71
- package/dist/healthybowl/pages/livestock/LivestockFeedCard.js.map +1 -1
- package/dist/healthybowl/pages/livestock/LivestockGrowthCard.js +95 -71
- package/dist/healthybowl/pages/livestock/LivestockGrowthCard.js.map +1 -1
- package/dist/healthybowl/utils/download.js +8 -1
- package/dist/healthybowl/utils/download.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useI18n as e } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
2
|
+
import { Download as t } from "lucide-react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/healthybowl/components/AnalyticsControls.tsx
|
|
5
|
+
var i = "min-h-[32px] rounded-md border border-border-subtle bg-bg-surface px-2 py-1 text-xs text-text-primary", a = ({ from: a, to: o, onFromChange: s, onToChange: c, onExportCsv: l, exportDisabled: u = !1, children: d }) => {
|
|
6
|
+
let { t: f } = e();
|
|
7
|
+
return /* @__PURE__ */ r("div", {
|
|
8
|
+
className: "flex flex-wrap items-center gap-1.5",
|
|
9
|
+
children: [
|
|
10
|
+
d,
|
|
11
|
+
/* @__PURE__ */ n("input", {
|
|
12
|
+
type: "date",
|
|
13
|
+
value: a,
|
|
14
|
+
max: o || void 0,
|
|
15
|
+
onChange: (e) => s(e.target.value),
|
|
16
|
+
"aria-label": f("healthybowl.livestock.analytics.fromDate", "From date"),
|
|
17
|
+
className: i
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ n("span", {
|
|
20
|
+
"aria-hidden": "true",
|
|
21
|
+
className: "text-xs text-text-secondary",
|
|
22
|
+
children: "–"
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ n("input", {
|
|
25
|
+
type: "date",
|
|
26
|
+
value: o,
|
|
27
|
+
min: a || void 0,
|
|
28
|
+
onChange: (e) => c(e.target.value),
|
|
29
|
+
"aria-label": f("healthybowl.livestock.analytics.toDate", "To date"),
|
|
30
|
+
className: i
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ r("button", {
|
|
33
|
+
type: "button",
|
|
34
|
+
onClick: l,
|
|
35
|
+
disabled: u,
|
|
36
|
+
"aria-label": f("healthybowl.livestock.analytics.exportCsv", "Export CSV"),
|
|
37
|
+
className: "flex min-h-[32px] items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary transition-colors hover:bg-bg-sunken/50 disabled:cursor-not-allowed disabled:opacity-50",
|
|
38
|
+
children: [/* @__PURE__ */ n(t, { className: "h-3.5 w-3.5" }), f("healthybowl.livestock.analytics.csv", "CSV")]
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { a as AnalyticsControls };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=AnalyticsControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsControls.js","names":[],"sources":["../../../src/healthybowl/components/AnalyticsControls.tsx"],"sourcesContent":["/**\n * Shared header controls for the livestock analytics cards (BOFF-6124).\n *\n * Adds the two acceptance criteria BOFF-5971 shipped without — a from/to date-range\n * filter and a CSV export of the computed series — beside each card's existing\n * granularity toggle. Every card already plumbs `from`/`to` through its hook to a\n * backend that accepts them (`resolveWindow`); these are simply the missing controls\n * that bind to them, so a farmer is no longer hard-locked to the last 180 days.\n *\n * `aria-label`s (not `htmlFor`) are used deliberately: the three cards render this on\n * one screen, so element ids would collide.\n * @module healthybowl\n */\n\nimport { type FC, type ReactNode } from 'react';\nimport { Download } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\ninterface AnalyticsControlsProps {\n /** ISO `yyyy-MM-dd` (empty string = unset → backend default window). */\n from: string;\n to: string;\n onFromChange: (value: string) => void;\n onToChange: (value: string) => void;\n onExportCsv: () => void;\n /** Disabled when there is no computed data to export. */\n exportDisabled?: boolean;\n /** The card's existing granularity toggle. */\n children?: ReactNode;\n}\n\nconst inputClass =\n 'min-h-[32px] rounded-md border border-border-subtle bg-bg-surface px-2 py-1 text-xs text-text-primary';\n\nexport const AnalyticsControls: FC<AnalyticsControlsProps> = ({\n from,\n to,\n onFromChange,\n onToChange,\n onExportCsv,\n exportDisabled = false,\n children,\n}) => {\n const { t } = useI18n();\n return (\n <div className=\"flex flex-wrap items-center gap-1.5\">\n {children}\n <input\n type=\"date\"\n value={from}\n max={to || undefined}\n onChange={(e) => onFromChange(e.target.value)}\n aria-label={t('healthybowl.livestock.analytics.fromDate', 'From date')}\n className={inputClass}\n />\n <span aria-hidden=\"true\" className=\"text-xs text-text-secondary\">\n –\n </span>\n <input\n type=\"date\"\n value={to}\n min={from || undefined}\n onChange={(e) => onToChange(e.target.value)}\n aria-label={t('healthybowl.livestock.analytics.toDate', 'To date')}\n className={inputClass}\n />\n <button\n type=\"button\"\n onClick={onExportCsv}\n disabled={exportDisabled}\n aria-label={t('healthybowl.livestock.analytics.exportCsv', 'Export CSV')}\n className=\"flex min-h-[32px] items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary transition-colors hover:bg-bg-sunken/50 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Download className=\"h-3.5 w-3.5\" />\n {t('healthybowl.livestock.analytics.csv', 'CSV')}\n </button>\n </div>\n );\n};\n"],"mappings":";;;;AA+BA,IAAM,IACJ,yGAEW,KAAiD,EAC5D,SACA,OACA,iBACA,eACA,gBACA,oBAAiB,IACjB,kBACI;CACJ,IAAM,EAAE,SAAM,GAAS;AACvB,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACG;GACD,kBAAC,SAAD;IACE,MAAK;IACL,OAAO;IACP,KAAK,KAAM,KAAA;IACX,WAAW,MAAM,EAAa,EAAE,OAAO,MAAM;IAC7C,cAAY,EAAE,4CAA4C,YAAY;IACtE,WAAW;IACX,CAAA;GACF,kBAAC,QAAD;IAAM,eAAY;IAAO,WAAU;cAA8B;IAE1D,CAAA;GACP,kBAAC,SAAD;IACE,MAAK;IACL,OAAO;IACP,KAAK,KAAQ,KAAA;IACb,WAAW,MAAM,EAAW,EAAE,OAAO,MAAM;IAC3C,cAAY,EAAE,0CAA0C,UAAU;IAClE,WAAW;IACX,CAAA;GACF,kBAAC,UAAD;IACE,MAAK;IACL,SAAS;IACT,UAAU;IACV,cAAY,EAAE,6CAA6C,aAAa;IACxE,WAAU;cALZ,CAOE,kBAAC,GAAD,EAAU,WAAU,eAAgB,CAAA,EACnC,EAAE,uCAAuC,MAAM,CACzC;;GACL"}
|