@burdenoff/microfe-labsofscience 2026.827.1 → 2026.1014.1

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 (37) hide show
  1. package/dist/labsofscience/LabsOfScienceRoot.d.ts.map +1 -1
  2. package/dist/labsofscience/LabsOfScienceRoot.js +54 -57
  3. package/dist/labsofscience/LabsOfScienceRoot.js.map +1 -1
  4. package/dist/labsofscience/components/BottomNav.d.ts.map +1 -1
  5. package/dist/labsofscience/components/BottomNav.js +67 -63
  6. package/dist/labsofscience/components/BottomNav.js.map +1 -1
  7. package/dist/labsofscience/hooks/index.d.ts +1 -0
  8. package/dist/labsofscience/hooks/index.d.ts.map +1 -1
  9. package/dist/labsofscience/hooks/useTr.d.ts +17 -0
  10. package/dist/labsofscience/hooks/useTr.d.ts.map +1 -0
  11. package/dist/labsofscience/hooks/useTr.js +14 -0
  12. package/dist/labsofscience/hooks/useTr.js.map +1 -0
  13. package/dist/labsofscience/pages/OverviewPage.d.ts.map +1 -1
  14. package/dist/labsofscience/pages/OverviewPage.js +187 -161
  15. package/dist/labsofscience/pages/OverviewPage.js.map +1 -1
  16. package/dist/labsofscience/pages/datasets/DatasetsListPage.d.ts.map +1 -1
  17. package/dist/labsofscience/pages/datasets/DatasetsListPage.js +129 -128
  18. package/dist/labsofscience/pages/datasets/DatasetsListPage.js.map +1 -1
  19. package/dist/labsofscience/pages/experiments/ExperimentsListPage.d.ts.map +1 -1
  20. package/dist/labsofscience/pages/experiments/ExperimentsListPage.js +148 -147
  21. package/dist/labsofscience/pages/experiments/ExperimentsListPage.js.map +1 -1
  22. package/dist/labsofscience/pages/instruments/InstrumentsListPage.d.ts.map +1 -1
  23. package/dist/labsofscience/pages/instruments/InstrumentsListPage.js +140 -139
  24. package/dist/labsofscience/pages/instruments/InstrumentsListPage.js.map +1 -1
  25. package/dist/labsofscience/pages/inventory/InventoryListPage.d.ts.map +1 -1
  26. package/dist/labsofscience/pages/inventory/InventoryListPage.js +169 -168
  27. package/dist/labsofscience/pages/inventory/InventoryListPage.js.map +1 -1
  28. package/dist/labsofscience/pages/notebook/NotebookListPage.d.ts.map +1 -1
  29. package/dist/labsofscience/pages/notebook/NotebookListPage.js +123 -122
  30. package/dist/labsofscience/pages/notebook/NotebookListPage.js.map +1 -1
  31. package/dist/labsofscience/pages/projects/ProjectsListPage.d.ts.map +1 -1
  32. package/dist/labsofscience/pages/projects/ProjectsListPage.js +141 -140
  33. package/dist/labsofscience/pages/projects/ProjectsListPage.js.map +1 -1
  34. package/dist/labsofscience/pages/protocols/ProtocolsListPage.d.ts.map +1 -1
  35. package/dist/labsofscience/pages/protocols/ProtocolsListPage.js +123 -122
  36. package/dist/labsofscience/pages/protocols/ProtocolsListPage.js.map +1 -1
  37. package/package.json +1 -1
@@ -1,151 +1,152 @@
1
- import { useLabsOfScience as e } from "../../context/LabsOfScienceContext.js";
2
- import { PageLayout as t } from "../../components/PageLayout.js";
3
- import { StatusBadge as n } from "../../components/StatusBadge.js";
4
- import { QueryBoundary as r } from "../../components/QueryStates.js";
5
- import { useProtocols as i } from "../../hooks/useLabsOfScienceApi.js";
6
- import { formatDateShort as a, formatDuration as o, titleCase as s } from "../../utils/formatters.js";
7
- import { EmptyState as c } from "../../components/EmptyState.js";
8
- import { ListSearchInput as l } from "../../components/ListSearchInput.js";
9
- import { useDebouncedValue as u } from "../../utils/useDebouncedValue.js";
10
- import { ProtocolFormDialog as d } from "./ProtocolFormDialog.js";
11
- import { useState as f } from "react";
12
- import { Microscope as p, Plus as m } from "lucide-react";
13
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
14
- import { Button as v, Pagination as y, ResponsiveTable as b, Select as x, SelectContent as S, SelectItem as C, SelectTrigger as w, SelectValue as T } from "@burdenoff/fe-libs/ui";
1
+ import { useTr as e } from "../../hooks/useTr.js";
2
+ import { useLabsOfScience as t } from "../../context/LabsOfScienceContext.js";
3
+ import { PageLayout as n } from "../../components/PageLayout.js";
4
+ import { StatusBadge as r } from "../../components/StatusBadge.js";
5
+ import { QueryBoundary as i } from "../../components/QueryStates.js";
6
+ import { useProtocols as a } from "../../hooks/useLabsOfScienceApi.js";
7
+ import { formatDateShort as o, formatDuration as s, titleCase as c } from "../../utils/formatters.js";
8
+ import { EmptyState as l } from "../../components/EmptyState.js";
9
+ import { ListSearchInput as u } from "../../components/ListSearchInput.js";
10
+ import { useDebouncedValue as d } from "../../utils/useDebouncedValue.js";
11
+ import { ProtocolFormDialog as f } from "./ProtocolFormDialog.js";
12
+ import { useState as p } from "react";
13
+ import { Microscope as m, Plus as h } from "lucide-react";
14
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
15
+ import { Button as y, Pagination as b, ResponsiveTable as x, Select as S, SelectContent as C, SelectItem as w, SelectTrigger as T, SelectValue as E } from "@burdenoff/fe-libs/ui";
15
16
  //#region src/labsofscience/pages/protocols/ProtocolsListPage.tsx
16
- var E = 20, D = [
17
+ var D = 20, O = [
17
18
  "DRAFT",
18
19
  "PUBLISHED",
19
20
  "DEPRECATED"
20
21
  ];
21
- function O() {
22
- let { navigateTo: O } = e(), [k, A] = f(1), [j, M] = f("ALL"), [N, P] = f(""), [F, I] = f(!1), L = u(N.trim()), R = i({
23
- status: j === "ALL" ? void 0 : j,
24
- search: L || void 0,
22
+ function k() {
23
+ let { navigateTo: k } = t(), A = e(), [j, M] = p(1), [N, P] = p("ALL"), [F, I] = p(""), [L, R] = p(!1), z = d(F.trim()), B = a({
24
+ status: N === "ALL" ? void 0 : N,
25
+ search: z || void 0,
25
26
  pagination: {
26
- limit: E,
27
- offset: (k - 1) * E
27
+ limit: D,
28
+ offset: (j - 1) * D
28
29
  }
29
- }), z = R.data?.items ?? [], B = R.data?.pageInfo.hasMore ?? !1;
30
- return /* @__PURE__ */ _(t, {
31
- title: "Protocols",
32
- description: "Versioned, reusable methods frozen at publish time.",
33
- actions: /* @__PURE__ */ _(v, {
34
- onClick: () => I(!0),
35
- children: [/* @__PURE__ */ g(m, { className: "mr-2 h-4 w-4" }), "New protocol"]
30
+ }), V = B.data?.items ?? [], H = B.data?.pageInfo.hasMore ?? !1, U = [
31
+ {
32
+ key: "name",
33
+ header: A("labsofscience.protocols.column.protocol", "Protocol"),
34
+ priority: "primary",
35
+ cell: (e) => /* @__PURE__ */ v("div", {
36
+ className: "min-w-0",
37
+ children: [/* @__PURE__ */ _("p", {
38
+ className: "truncate font-medium text-text-primary",
39
+ children: e.name
40
+ }), e.summary && /* @__PURE__ */ _("p", {
41
+ className: "truncate text-xs text-text-tertiary",
42
+ children: e.summary
43
+ })]
44
+ })
45
+ },
46
+ {
47
+ key: "version",
48
+ header: A("labsofscience.protocols.column.version", "Version"),
49
+ cell: (e) => /* @__PURE__ */ v("span", {
50
+ className: "tabular-nums text-text-secondary",
51
+ children: ["v", e.version]
52
+ })
53
+ },
54
+ {
55
+ key: "status",
56
+ header: A("labsofscience.protocols.column.status", "Status"),
57
+ priority: "primary",
58
+ cell: (e) => /* @__PURE__ */ _(r, { status: e.status })
59
+ },
60
+ {
61
+ key: "estimatedMinutes",
62
+ header: A("labsofscience.protocols.column.estimatedTime", "Est. time"),
63
+ priority: "hidden-on-mobile",
64
+ cell: (e) => /* @__PURE__ */ _("span", {
65
+ className: "text-text-secondary",
66
+ children: s(e.estimatedMinutes)
67
+ })
68
+ },
69
+ {
70
+ key: "updatedAt",
71
+ header: A("labsofscience.protocols.column.updated", "Updated"),
72
+ priority: "hidden-on-mobile",
73
+ cell: (e) => /* @__PURE__ */ _("span", {
74
+ className: "text-text-secondary",
75
+ children: o(e.updatedAt)
76
+ })
77
+ }
78
+ ];
79
+ return /* @__PURE__ */ v(n, {
80
+ title: A("labsofscience.protocols.title", "Protocols"),
81
+ description: A("labsofscience.protocols.description", "Versioned, reusable methods frozen at publish time."),
82
+ actions: /* @__PURE__ */ v(y, {
83
+ onClick: () => R(!0),
84
+ children: [/* @__PURE__ */ _(h, { className: "mr-2 h-4 w-4" }), A("labsofscience.protocols.newButton", "New protocol")]
36
85
  }),
37
- children: [/* @__PURE__ */ _("div", {
86
+ children: [/* @__PURE__ */ v("div", {
38
87
  className: "space-y-4",
39
- children: [/* @__PURE__ */ _("div", {
88
+ children: [/* @__PURE__ */ v("div", {
40
89
  className: "flex flex-wrap items-center gap-3",
41
- children: [/* @__PURE__ */ g(l, {
42
- value: N,
43
- ariaLabel: "Search protocols",
44
- placeholder: "Search protocols…",
90
+ children: [/* @__PURE__ */ _(u, {
91
+ value: F,
92
+ ariaLabel: A("labsofscience.protocols.searchAria", "Search protocols"),
93
+ placeholder: A("labsofscience.protocols.searchPlaceholder", "Search protocols…"),
45
94
  onChange: (e) => {
46
- P(e), A(1);
95
+ I(e), M(1);
47
96
  }
48
- }), /* @__PURE__ */ _(x, {
49
- value: j,
97
+ }), /* @__PURE__ */ v(S, {
98
+ value: N,
50
99
  onValueChange: (e) => {
51
- M(e), A(1);
100
+ P(e), M(1);
52
101
  },
53
- children: [/* @__PURE__ */ g(w, {
102
+ children: [/* @__PURE__ */ _(T, {
54
103
  className: "w-full sm:w-48",
55
- "aria-label": "Filter by status",
56
- children: /* @__PURE__ */ g(T, { placeholder: "All statuses" })
57
- }), /* @__PURE__ */ _(S, { children: [/* @__PURE__ */ g(C, {
104
+ "aria-label": A("labsofscience.protocols.statusFilterAria", "Filter by status"),
105
+ children: /* @__PURE__ */ _(E, { placeholder: A("labsofscience.protocols.allStatuses", "All statuses") })
106
+ }), /* @__PURE__ */ v(C, { children: [/* @__PURE__ */ _(w, {
58
107
  value: "ALL",
59
- children: "All statuses"
60
- }), D.map((e) => /* @__PURE__ */ g(C, {
108
+ children: A("labsofscience.protocols.allStatuses", "All statuses")
109
+ }), O.map((e) => /* @__PURE__ */ _(w, {
61
110
  value: e,
62
- children: s(e)
111
+ children: c(e)
63
112
  }, e))] })]
64
113
  })]
65
- }), /* @__PURE__ */ g(r, {
66
- isLoading: R.isLoading,
67
- isError: R.isError,
68
- error: R.error,
69
- onRetry: () => void R.refetch(),
70
- loadingLabel: "Loading protocols…",
71
- children: z.length === 0 ? /* @__PURE__ */ g(c, {
72
- icon: /* @__PURE__ */ g(p, { className: "h-10 w-10" }),
73
- title: "No protocols found",
74
- description: "Capture a reusable method as a versioned protocol.",
75
- action: /* @__PURE__ */ _(v, {
76
- onClick: () => I(!0),
77
- children: [/* @__PURE__ */ g(m, { className: "mr-2 h-4 w-4" }), "New protocol"]
114
+ }), /* @__PURE__ */ _(i, {
115
+ isLoading: B.isLoading,
116
+ isError: B.isError,
117
+ error: B.error,
118
+ onRetry: () => void B.refetch(),
119
+ loadingLabel: A("labsofscience.protocols.loading", "Loading protocols…"),
120
+ children: V.length === 0 ? /* @__PURE__ */ _(l, {
121
+ icon: /* @__PURE__ */ _(m, { className: "h-10 w-10" }),
122
+ title: A("labsofscience.protocols.emptyTitle", "No protocols found"),
123
+ description: A("labsofscience.protocols.emptyDescription", "Capture a reusable method as a versioned protocol."),
124
+ action: /* @__PURE__ */ v(y, {
125
+ onClick: () => R(!0),
126
+ children: [/* @__PURE__ */ _(h, { className: "mr-2 h-4 w-4" }), A("labsofscience.protocols.newButton", "New protocol")]
78
127
  })
79
- }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(b, {
80
- columns: [
81
- {
82
- key: "name",
83
- header: "Protocol",
84
- priority: "primary",
85
- cell: (e) => /* @__PURE__ */ _("div", {
86
- className: "min-w-0",
87
- children: [/* @__PURE__ */ g("p", {
88
- className: "truncate font-medium text-text-primary",
89
- children: e.name
90
- }), e.summary && /* @__PURE__ */ g("p", {
91
- className: "truncate text-xs text-text-tertiary",
92
- children: e.summary
93
- })]
94
- })
95
- },
96
- {
97
- key: "version",
98
- header: "Version",
99
- cell: (e) => /* @__PURE__ */ _("span", {
100
- className: "tabular-nums text-text-secondary",
101
- children: ["v", e.version]
102
- })
103
- },
104
- {
105
- key: "status",
106
- header: "Status",
107
- priority: "primary",
108
- cell: (e) => /* @__PURE__ */ g(n, { status: e.status })
109
- },
110
- {
111
- key: "estimatedMinutes",
112
- header: "Est. time",
113
- priority: "hidden-on-mobile",
114
- cell: (e) => /* @__PURE__ */ g("span", {
115
- className: "text-text-secondary",
116
- children: o(e.estimatedMinutes)
117
- })
118
- },
119
- {
120
- key: "updatedAt",
121
- header: "Updated",
122
- priority: "hidden-on-mobile",
123
- cell: (e) => /* @__PURE__ */ g("span", {
124
- className: "text-text-secondary",
125
- children: a(e.updatedAt)
126
- })
127
- }
128
- ],
129
- data: z,
128
+ }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(x, {
129
+ columns: U,
130
+ data: V,
130
131
  rowKey: (e) => e.id,
131
- onRowClick: (e) => O(`protocols/${e.id}`)
132
- }), /* @__PURE__ */ g(y, {
133
- page: k,
134
- pageSize: E,
135
- hasNextPage: B,
136
- hasPreviousPage: k > 1,
137
- loading: R.isFetching,
138
- onPageChange: A
132
+ onRowClick: (e) => k(`protocols/${e.id}`)
133
+ }), /* @__PURE__ */ _(b, {
134
+ page: j,
135
+ pageSize: D,
136
+ hasNextPage: H,
137
+ hasPreviousPage: j > 1,
138
+ loading: B.isFetching,
139
+ onPageChange: M
139
140
  })] })
140
141
  })]
141
- }), /* @__PURE__ */ g(d, {
142
- open: F,
143
- onOpenChange: I,
144
- onSaved: (e) => O(`protocols/${e.id}`)
142
+ }), /* @__PURE__ */ _(f, {
143
+ open: L,
144
+ onOpenChange: R,
145
+ onSaved: (e) => k(`protocols/${e.id}`)
145
146
  })]
146
147
  });
147
148
  }
148
149
  //#endregion
149
- export { O as ProtocolsListPage };
150
+ export { k as ProtocolsListPage };
150
151
 
151
152
  //# sourceMappingURL=ProtocolsListPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProtocolsListPage.js","names":[],"sources":["../../../../src/labsofscience/pages/protocols/ProtocolsListPage.tsx"],"sourcesContent":["/**\n * Protocols list page\n * @module labsofscience/pages/protocols\n */\n\nimport { useState } from 'react';\nimport { Microscope, Plus } from 'lucide-react';\nimport {\n Button,\n Pagination,\n ResponsiveTable,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { QueryBoundary } from '../../components/QueryStates';\nimport { ListSearchInput } from '../../components/ListSearchInput';\nimport { useLabsOfScience } from '../../context/LabsOfScienceContext';\nimport { useProtocols } from '../../hooks/useLabsOfScienceApi';\nimport type { LabProtocol, LabProtocolStatus } from '../../types';\nimport { formatDateShort, formatDuration, titleCase } from '../../utils/formatters';\nimport { useDebouncedValue } from '../../utils/useDebouncedValue';\nimport { ProtocolFormDialog } from './ProtocolFormDialog';\n\nconst PAGE_SIZE = 20;\nconst STATUS_OPTIONS: LabProtocolStatus[] = ['DRAFT', 'PUBLISHED', 'DEPRECATED'];\n\nexport function ProtocolsListPage() {\n const { navigateTo } = useLabsOfScience();\n const [page, setPage] = useState(1);\n const [status, setStatus] = useState<LabProtocolStatus | 'ALL'>('ALL');\n const [search, setSearch] = useState('');\n const [createOpen, setCreateOpen] = useState(false);\n const debouncedSearch = useDebouncedValue(search.trim());\n\n const query = useProtocols({\n status: status === 'ALL' ? undefined : status,\n search: debouncedSearch || undefined,\n pagination: { limit: PAGE_SIZE, offset: (page - 1) * PAGE_SIZE },\n });\n\n const items = query.data?.items ?? [];\n const hasMore = query.data?.pageInfo.hasMore ?? false;\n\n const columns: ResponsiveTableColumn<LabProtocol>[] = [\n {\n key: 'name',\n header: 'Protocol',\n priority: 'primary',\n cell: (row) => (\n <div className=\"min-w-0\">\n <p className=\"truncate font-medium text-text-primary\">{row.name}</p>\n {row.summary && <p className=\"truncate text-xs text-text-tertiary\">{row.summary}</p>}\n </div>\n ),\n },\n {\n key: 'version',\n header: 'Version',\n cell: (row) => <span className=\"tabular-nums text-text-secondary\">v{row.version}</span>,\n },\n {\n key: 'status',\n header: 'Status',\n priority: 'primary',\n cell: (row) => <StatusBadge status={row.status} />,\n },\n {\n key: 'estimatedMinutes',\n header: 'Est. time',\n priority: 'hidden-on-mobile',\n cell: (row) => (\n <span className=\"text-text-secondary\">{formatDuration(row.estimatedMinutes)}</span>\n ),\n },\n {\n key: 'updatedAt',\n header: 'Updated',\n priority: 'hidden-on-mobile',\n cell: (row) => <span className=\"text-text-secondary\">{formatDateShort(row.updatedAt)}</span>,\n },\n ];\n\n return (\n <PageLayout\n title=\"Protocols\"\n description=\"Versioned, reusable methods frozen at publish time.\"\n actions={\n <Button onClick={() => setCreateOpen(true)}>\n <Plus className=\"mr-2 h-4 w-4\" />\n New protocol\n </Button>\n }\n >\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-center gap-3\">\n <ListSearchInput\n value={search}\n ariaLabel=\"Search protocols\"\n placeholder=\"Search protocols…\"\n onChange={(value) => {\n setSearch(value);\n setPage(1);\n }}\n />\n <Select\n value={status}\n onValueChange={(value) => {\n setStatus(value as LabProtocolStatus | 'ALL');\n setPage(1);\n }}\n >\n <SelectTrigger className=\"w-full sm:w-48\" aria-label=\"Filter by status\">\n <SelectValue placeholder=\"All statuses\" />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"ALL\">All statuses</SelectItem>\n {STATUS_OPTIONS.map((option) => (\n <SelectItem key={option} value={option}>\n {titleCase(option)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n\n <QueryBoundary\n isLoading={query.isLoading}\n isError={query.isError}\n error={query.error}\n onRetry={() => void query.refetch()}\n loadingLabel=\"Loading protocols…\"\n >\n {items.length === 0 ? (\n <EmptyState\n icon={<Microscope className=\"h-10 w-10\" />}\n title=\"No protocols found\"\n description=\"Capture a reusable method as a versioned protocol.\"\n action={\n <Button onClick={() => setCreateOpen(true)}>\n <Plus className=\"mr-2 h-4 w-4\" />\n New protocol\n </Button>\n }\n />\n ) : (\n <>\n <ResponsiveTable\n columns={columns}\n data={items}\n rowKey={(row) => row.id}\n onRowClick={(row) => navigateTo(`protocols/${row.id}`)}\n />\n <Pagination\n page={page}\n pageSize={PAGE_SIZE}\n hasNextPage={hasMore}\n hasPreviousPage={page > 1}\n loading={query.isFetching}\n onPageChange={setPage}\n />\n </>\n )}\n </QueryBoundary>\n </div>\n\n <ProtocolFormDialog\n open={createOpen}\n onOpenChange={setCreateOpen}\n onSaved={(protocol) => navigateTo(`protocols/${protocol.id}`)}\n />\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA8BA,IAAM,IAAY,IACZ,IAAsC;CAAC;CAAS;CAAa;AAAY;AAE/E,SAAgB,IAAoB;CAClC,IAAM,EAAE,kBAAe,EAAiB,GAClC,CAAC,GAAM,KAAW,EAAS,CAAC,GAC5B,CAAC,GAAQ,KAAa,EAAoC,KAAK,GAC/D,CAAC,GAAQ,KAAa,EAAS,EAAE,GACjC,CAAC,GAAY,KAAiB,EAAS,EAAK,GAC5C,IAAkB,EAAkB,EAAO,KAAK,CAAC,GAEjD,IAAQ,EAAa;EACzB,QAAQ,MAAW,QAAQ,KAAA,IAAY;EACvC,QAAQ,KAAmB,KAAA;EAC3B,YAAY;GAAE,OAAO;GAAW,SAAS,IAAO,KAAK;EAAU;CACjE,CAAC,GAEK,IAAQ,EAAM,MAAM,SAAS,CAAC,GAC9B,IAAU,EAAM,MAAM,SAAS,WAAW;CAyChD,OACE,kBAAC,GAAD;EACE,OAAM;EACN,aAAY;EACZ,SACE,kBAAC,GAAD;GAAQ,eAAe,EAAc,EAAI;aAAzC,CACE,kBAAC,GAAD,EAAM,WAAU,eAAgB,CAAA,GAAC,cAE3B;;YAPZ,CAUE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD;KACE,OAAO;KACP,WAAU;KACV,aAAY;KACZ,WAAW,MAAU;MAEnB,AADA,EAAU,CAAK,GACf,EAAQ,CAAC;KACX;IACD,CAAA,GACD,kBAAC,GAAD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AS,CAAA;MACnD;MACA;OACE,KAAK;OACL,QAAQ;OACR,UAAU;OACV,OAAO,MACL,kBAAC,QAAD;QAAM,WAAU;kBAAuB,EAAe,EAAI,gBAAgB;OAAQ,CAAA;MAEtF;MACA;OACE,KAAK;OACL,QAAQ;OACR,UAAU;OACV,OAAO,MAAQ,kBAAC,QAAD;QAAM,WAAU;kBAAuB,EAAgB,EAAI,SAAS;OAAQ,CAAA;MAC7F;KAoEqB;KACT,MAAM;KACN,SAAS,MAAQ,EAAI;KACrB,aAAa,MAAQ,EAAW,aAAa,EAAI,IAAI;IACtD,CAAA,GACD,kBAAC,GAAD;KACQ;KACN,UAAU;KACV,aAAa;KACb,iBAAiB,IAAO;KACxB,SAAS,EAAM;KACf,cAAc;IACf,CAAA,CACD,EAAA,CAAA;GAES,CAAA,CACZ;MAEL,kBAAC,GAAD;GACE,MAAM;GACN,cAAc;GACd,UAAU,MAAa,EAAW,aAAa,EAAS,IAAI;EAC7D,CAAA,CACS;;AAEhB"}
1
+ {"version":3,"file":"ProtocolsListPage.js","names":[],"sources":["../../../../src/labsofscience/pages/protocols/ProtocolsListPage.tsx"],"sourcesContent":["/**\n * Protocols list page\n * @module labsofscience/pages/protocols\n */\n\nimport { useState } from 'react';\nimport { Microscope, Plus } from 'lucide-react';\nimport {\n Button,\n Pagination,\n ResponsiveTable,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { QueryBoundary } from '../../components/QueryStates';\nimport { ListSearchInput } from '../../components/ListSearchInput';\nimport { useLabsOfScience } from '../../context/LabsOfScienceContext';\nimport { useProtocols } from '../../hooks/useLabsOfScienceApi';\nimport { useTr } from '../../hooks/useTr';\nimport type { LabProtocol, LabProtocolStatus } from '../../types';\nimport { formatDateShort, formatDuration, titleCase } from '../../utils/formatters';\nimport { useDebouncedValue } from '../../utils/useDebouncedValue';\nimport { ProtocolFormDialog } from './ProtocolFormDialog';\n\nconst PAGE_SIZE = 20;\nconst STATUS_OPTIONS: LabProtocolStatus[] = ['DRAFT', 'PUBLISHED', 'DEPRECATED'];\n\nexport function ProtocolsListPage() {\n const { navigateTo } = useLabsOfScience();\n const tr = useTr();\n const [page, setPage] = useState(1);\n const [status, setStatus] = useState<LabProtocolStatus | 'ALL'>('ALL');\n const [search, setSearch] = useState('');\n const [createOpen, setCreateOpen] = useState(false);\n const debouncedSearch = useDebouncedValue(search.trim());\n\n const query = useProtocols({\n status: status === 'ALL' ? undefined : status,\n search: debouncedSearch || undefined,\n pagination: { limit: PAGE_SIZE, offset: (page - 1) * PAGE_SIZE },\n });\n\n const items = query.data?.items ?? [];\n const hasMore = query.data?.pageInfo.hasMore ?? false;\n\n const columns: ResponsiveTableColumn<LabProtocol>[] = [\n {\n key: 'name',\n header: tr('labsofscience.protocols.column.protocol', 'Protocol'),\n priority: 'primary',\n cell: (row) => (\n <div className=\"min-w-0\">\n <p className=\"truncate font-medium text-text-primary\">{row.name}</p>\n {row.summary && <p className=\"truncate text-xs text-text-tertiary\">{row.summary}</p>}\n </div>\n ),\n },\n {\n key: 'version',\n header: tr('labsofscience.protocols.column.version', 'Version'),\n cell: (row) => <span className=\"tabular-nums text-text-secondary\">v{row.version}</span>,\n },\n {\n key: 'status',\n header: tr('labsofscience.protocols.column.status', 'Status'),\n priority: 'primary',\n cell: (row) => <StatusBadge status={row.status} />,\n },\n {\n key: 'estimatedMinutes',\n header: tr('labsofscience.protocols.column.estimatedTime', 'Est. time'),\n priority: 'hidden-on-mobile',\n cell: (row) => (\n <span className=\"text-text-secondary\">{formatDuration(row.estimatedMinutes)}</span>\n ),\n },\n {\n key: 'updatedAt',\n header: tr('labsofscience.protocols.column.updated', 'Updated'),\n priority: 'hidden-on-mobile',\n cell: (row) => <span className=\"text-text-secondary\">{formatDateShort(row.updatedAt)}</span>,\n },\n ];\n\n return (\n <PageLayout\n title={tr('labsofscience.protocols.title', 'Protocols')}\n description={tr(\n 'labsofscience.protocols.description',\n 'Versioned, reusable methods frozen at publish time.'\n )}\n actions={\n <Button onClick={() => setCreateOpen(true)}>\n <Plus className=\"mr-2 h-4 w-4\" />\n {tr('labsofscience.protocols.newButton', 'New protocol')}\n </Button>\n }\n >\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-center gap-3\">\n <ListSearchInput\n value={search}\n ariaLabel={tr('labsofscience.protocols.searchAria', 'Search protocols')}\n placeholder={tr('labsofscience.protocols.searchPlaceholder', 'Search protocols…')}\n onChange={(value) => {\n setSearch(value);\n setPage(1);\n }}\n />\n <Select\n value={status}\n onValueChange={(value) => {\n setStatus(value as LabProtocolStatus | 'ALL');\n setPage(1);\n }}\n >\n <SelectTrigger\n className=\"w-full sm:w-48\"\n aria-label={tr('labsofscience.protocols.statusFilterAria', 'Filter by status')}\n >\n <SelectValue\n placeholder={tr('labsofscience.protocols.allStatuses', 'All statuses')}\n />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"ALL\">\n {tr('labsofscience.protocols.allStatuses', 'All statuses')}\n </SelectItem>\n {STATUS_OPTIONS.map((option) => (\n <SelectItem key={option} value={option}>\n {titleCase(option)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n\n <QueryBoundary\n isLoading={query.isLoading}\n isError={query.isError}\n error={query.error}\n onRetry={() => void query.refetch()}\n loadingLabel={tr('labsofscience.protocols.loading', 'Loading protocols…')}\n >\n {items.length === 0 ? (\n <EmptyState\n icon={<Microscope className=\"h-10 w-10\" />}\n title={tr('labsofscience.protocols.emptyTitle', 'No protocols found')}\n description={tr(\n 'labsofscience.protocols.emptyDescription',\n 'Capture a reusable method as a versioned protocol.'\n )}\n action={\n <Button onClick={() => setCreateOpen(true)}>\n <Plus className=\"mr-2 h-4 w-4\" />\n {tr('labsofscience.protocols.newButton', 'New protocol')}\n </Button>\n }\n />\n ) : (\n <>\n <ResponsiveTable\n columns={columns}\n data={items}\n rowKey={(row) => row.id}\n onRowClick={(row) => navigateTo(`protocols/${row.id}`)}\n />\n <Pagination\n page={page}\n pageSize={PAGE_SIZE}\n hasNextPage={hasMore}\n hasPreviousPage={page > 1}\n loading={query.isFetching}\n onPageChange={setPage}\n />\n </>\n )}\n </QueryBoundary>\n </div>\n\n <ProtocolFormDialog\n open={createOpen}\n onOpenChange={setCreateOpen}\n onSaved={(protocol) => navigateTo(`protocols/${protocol.id}`)}\n />\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+BA,IAAM,IAAY,IACZ,IAAsC;CAAC;CAAS;CAAa;AAAY;AAE/E,SAAgB,IAAoB;CAClC,IAAM,EAAE,kBAAe,EAAiB,GAClC,IAAK,EAAM,GACX,CAAC,GAAM,KAAW,EAAS,CAAC,GAC5B,CAAC,GAAQ,KAAa,EAAoC,KAAK,GAC/D,CAAC,GAAQ,KAAa,EAAS,EAAE,GACjC,CAAC,GAAY,KAAiB,EAAS,EAAK,GAC5C,IAAkB,EAAkB,EAAO,KAAK,CAAC,GAEjD,IAAQ,EAAa;EACzB,QAAQ,MAAW,QAAQ,KAAA,IAAY;EACvC,QAAQ,KAAmB,KAAA;EAC3B,YAAY;GAAE,OAAO;GAAW,SAAS,IAAO,KAAK;EAAU;CACjE,CAAC,GAEK,IAAQ,EAAM,MAAM,SAAS,CAAC,GAC9B,IAAU,EAAM,MAAM,SAAS,WAAW,IAE1C,IAAgD;EACpD;GACE,KAAK;GACL,QAAQ,EAAG,2CAA2C,UAAU;GAChE,UAAU;GACV,OAAO,MACL,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,KAAD;KAAG,WAAU;eAA0C,EAAI;IAAQ,CAAA,GAClE,EAAI,WAAW,kBAAC,KAAD;KAAG,WAAU;eAAuC,EAAI;IAAW,CAAA,CAChF;;EAET;EACA;GACE,KAAK;GACL,QAAQ,EAAG,0CAA0C,SAAS;GAC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GACf,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;MAAY,OAAM;gBACf,EAAG,uCAAuC,cAAc;KAC/C,CAAA,GACX,EAAe,KAAK,MACnB,kBAAC,GAAD;MAAyB,OAAO;gBAC7B,EAAU,CAAM;KACP,GAFK,CAEL,CACb,CACY,EAAA,CAAA,CACT;MACL;OAEL,kBAAC,GAAD;IACE,WAAW,EAAM;IACjB,SAAS,EAAM;IACf,OAAO,EAAM;IACb,eAAe,KAAK,EAAM,QAAQ;IAClC,cAAc,EAAG,mCAAmC,oBAAoB;cAEvE,EAAM,WAAW,IAChB,kBAAC,GAAD;KACE,MAAM,kBAAC,GAAD,EAAY,WAAU,YAAa,CAAA;KACzC,OAAO,EAAG,sCAAsC,oBAAoB;KACpE,aAAa,EACX,4CACA,oDACF;KACA,QACE,kBAAC,GAAD;MAAQ,eAAe,EAAc,EAAI;gBAAzC,CACE,kBAAC,GAAD,EAAM,WAAU,eAAgB,CAAA,GAC/B,EAAG,qCAAqC,cAAc,CACjD;;IAEX,CAAA,IAED,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;KACW;KACT,MAAM;KACN,SAAS,MAAQ,EAAI;KACrB,aAAa,MAAQ,EAAW,aAAa,EAAI,IAAI;IACtD,CAAA,GACD,kBAAC,GAAD;KACQ;KACN,UAAU;KACV,aAAa;KACb,iBAAiB,IAAO;KACxB,SAAS,EAAM;KACf,cAAc;IACf,CAAA,CACD,EAAA,CAAA;GAES,CAAA,CACZ;MAEL,kBAAC,GAAD;GACE,MAAM;GACN,cAAc;GACd,UAAU,MAAa,EAAW,aAAa,EAAS,IAAI;EAC7D,CAAA,CACS;;AAEhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-labsofscience",
3
- "version": "2026.827.1",
3
+ "version": "2026.1014.1",
4
4
  "description": "Burdenoff LabsOfScience Microfrontend",
5
5
  "type": "module",
6
6
  "files": [