@burdenoff/microfe-technospam 2026.828.1 → 2026.829.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.
- package/dist/index.js +4 -3
- package/dist/node_modules/recharts/es6/cartesian/Brush.js.map +1 -1
- package/dist/node_modules/recharts/es6/cartesian/ErrorBar.js.map +1 -1
- package/dist/node_modules/recharts/es6/cartesian/ReferenceArea.js.map +1 -1
- package/dist/node_modules/recharts/es6/cartesian/ReferenceDot.js.map +1 -1
- package/dist/node_modules/recharts/es6/cartesian/ReferenceLine.js.map +1 -1
- package/dist/node_modules/recharts/es6/cartesian/XAxis.js.map +1 -1
- package/dist/node_modules/recharts/es6/cartesian/YAxis.js.map +1 -1
- package/dist/node_modules/recharts/es6/component/ResponsiveContainer.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js.map +1 -1
- package/dist/technospam/TechnoSpamRoot.js +4 -4
- package/dist/technospam/components/PageLayout.d.ts.map +1 -1
- package/dist/technospam/components/PageLayout.js +24 -23
- package/dist/technospam/components/PageLayout.js.map +1 -1
- package/dist/technospam/components/StateViews.d.ts +1 -1
- package/dist/technospam/components/StateViews.d.ts.map +1 -1
- package/dist/technospam/components/StateViews.js +28 -26
- package/dist/technospam/components/StateViews.js.map +1 -1
- package/dist/technospam/components/TagInput.d.ts +1 -1
- package/dist/technospam/components/TagInput.d.ts.map +1 -1
- package/dist/technospam/components/TagInput.js +39 -34
- package/dist/technospam/components/TagInput.js.map +1 -1
- package/dist/technospam/hooks/useTr.d.ts +17 -0
- package/dist/technospam/hooks/useTr.d.ts.map +1 -0
- package/dist/technospam/hooks/useTr.js +12 -0
- package/dist/technospam/hooks/useTr.js.map +1 -0
- package/dist/technospam/index.d.ts +1 -0
- package/dist/technospam/index.d.ts.map +1 -1
- package/dist/technospam/index.js +1 -0
- package/dist/technospam/pages/AnalyticsAnalyticsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/AnalyticsAnalyticsPagePage.js +198 -189
- package/dist/technospam/pages/AnalyticsAnalyticsPagePage.js.map +1 -1
- package/dist/technospam/pages/ApplicationsProblemsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/ApplicationsProblemsPagePage.js +165 -163
- package/dist/technospam/pages/ApplicationsProblemsPagePage.js.map +1 -1
- package/dist/technospam/pages/CoursesCoursesPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/CoursesCoursesPagePage.js +117 -113
- package/dist/technospam/pages/CoursesCoursesPagePage.js.map +1 -1
- package/dist/technospam/pages/DashboardDashboardPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/DashboardDashboardPagePage.js +211 -193
- package/dist/technospam/pages/DashboardDashboardPagePage.js.map +1 -1
- package/dist/technospam/pages/HackathonsHackathonsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/HackathonsHackathonsPagePage.js +110 -110
- package/dist/technospam/pages/HackathonsHackathonsPagePage.js.map +1 -1
- package/dist/technospam/pages/MentorshipMentorsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/MentorshipMentorsPagePage.js +174 -160
- package/dist/technospam/pages/MentorshipMentorsPagePage.js.map +1 -1
- package/dist/technospam/pages/MentorshipSessionsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/MentorshipSessionsPagePage.js +156 -151
- package/dist/technospam/pages/MentorshipSessionsPagePage.js.map +1 -1
- package/dist/technospam/utils/i18n.js +1 -1
- package/dist/technospam/utils/i18n.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,62 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useTr as e } from "../hooks/useTr.js";
|
|
2
|
+
import { AlertTriangle as t, Inbox as n } from "lucide-react";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import { Skeleton as a } from "@burdenoff/fe-libs/ui";
|
|
4
5
|
//#region src/technospam/components/StateViews.tsx
|
|
5
|
-
function
|
|
6
|
-
return /* @__PURE__ */
|
|
6
|
+
function o({ title: e, description: t, action: a, icon: o }) {
|
|
7
|
+
return /* @__PURE__ */ i("div", {
|
|
7
8
|
className: "flex flex-col items-center justify-center gap-3 rounded-2xl border border-border-seam bg-bg-surface px-6 py-14 text-center",
|
|
8
9
|
children: [
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
+
/* @__PURE__ */ r("span", {
|
|
10
11
|
className: "flex h-14 w-14 items-center justify-center rounded-2xl bg-bg-sunken text-text-muted",
|
|
11
|
-
children: o ?? /* @__PURE__ */ n
|
|
12
|
+
children: o ?? /* @__PURE__ */ r(n, { size: 26 })
|
|
12
13
|
}),
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
+
/* @__PURE__ */ r("h3", {
|
|
14
15
|
className: "text-base font-semibold text-text-primary",
|
|
15
16
|
children: e
|
|
16
17
|
}),
|
|
17
|
-
|
|
18
|
+
t ? /* @__PURE__ */ r("p", {
|
|
18
19
|
className: "max-w-md text-sm text-text-secondary",
|
|
19
|
-
children:
|
|
20
|
+
children: t
|
|
20
21
|
}) : null,
|
|
21
|
-
a ? /* @__PURE__ */
|
|
22
|
+
a ? /* @__PURE__ */ r("div", {
|
|
22
23
|
className: "mt-2",
|
|
23
24
|
children: a
|
|
24
25
|
}) : null
|
|
25
26
|
]
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
29
|
+
function s({ title: n, error: a }) {
|
|
30
|
+
let o = e();
|
|
31
|
+
return /* @__PURE__ */ i("div", {
|
|
30
32
|
className: "flex flex-col items-center justify-center gap-3 rounded-2xl border border-border-seam bg-bg-surface px-6 py-14 text-center",
|
|
31
33
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ r("span", {
|
|
33
35
|
className: "flex h-14 w-14 items-center justify-center rounded-2xl bg-status-error-bg-subtle text-status-error-text",
|
|
34
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ r(t, { size: 26 })
|
|
35
37
|
}),
|
|
36
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ r("h3", {
|
|
37
39
|
className: "text-base font-semibold text-text-primary",
|
|
38
|
-
children: t
|
|
40
|
+
children: n ?? o("technospam.common.errorTitle", "Couldn't load this yet")
|
|
39
41
|
}),
|
|
40
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ r("p", {
|
|
41
43
|
className: "max-w-md text-sm text-text-secondary",
|
|
42
|
-
children:
|
|
44
|
+
children: a?.message ?? o("technospam.common.tryAgain", "Please try again in a moment.")
|
|
43
45
|
})
|
|
44
46
|
]
|
|
45
47
|
});
|
|
46
48
|
}
|
|
47
|
-
function
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
+
function c({ count: e = 6, height: t = "h-56" }) {
|
|
50
|
+
return /* @__PURE__ */ r("div", {
|
|
49
51
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
50
|
-
children: Array.from({ length: e }).map((e,
|
|
52
|
+
children: Array.from({ length: e }).map((e, n) => /* @__PURE__ */ r(a, { className: `${t} w-full rounded-xl` }, n))
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
|
-
function
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
+
function l({ count: e = 4, height: t = "h-20" }) {
|
|
56
|
+
return /* @__PURE__ */ r("div", {
|
|
55
57
|
className: "space-y-3",
|
|
56
|
-
children: Array.from({ length: e }).map((e,
|
|
58
|
+
children: Array.from({ length: e }).map((e, n) => /* @__PURE__ */ r(a, { className: `${t} w-full rounded-xl` }, n))
|
|
57
59
|
});
|
|
58
60
|
}
|
|
59
61
|
//#endregion
|
|
60
|
-
export {
|
|
62
|
+
export { o as EmptyView, s as ErrorView, c as LoadingGrid, l as LoadingRows };
|
|
61
63
|
|
|
62
64
|
//# sourceMappingURL=StateViews.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateViews.js","names":[],"sources":["../../../src/technospam/components/StateViews.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { AlertTriangle, Inbox } from 'lucide-react';\nimport { Skeleton } from '@burdenoff/fe-libs/ui';\n\n/**\n * Self-contained empty state (does not depend on host-shell illustration assets).\n * A soft glass medallion + lucide icon, a title, an optional description and action.\n */\nexport function EmptyView({\n title,\n description,\n action,\n icon,\n}: {\n title: string;\n description?: string;\n action?: ReactNode;\n icon?: ReactNode;\n}) {\n return (\n <div className=\"flex flex-col items-center justify-center gap-3 rounded-2xl border border-border-seam bg-bg-surface px-6 py-14 text-center\">\n <span className=\"flex h-14 w-14 items-center justify-center rounded-2xl bg-bg-sunken text-text-muted\">\n {icon ?? <Inbox size={26} />}\n </span>\n <h3 className=\"text-base font-semibold text-text-primary\">{title}</h3>\n {description ? <p className=\"max-w-md text-sm text-text-secondary\">{description}</p> : null}\n {action ? <div className=\"mt-2\">{action}</div> : null}\n </div>\n );\n}\n\n/** Consistent error state, surfaced from a GraphQL/network error. */\nexport function ErrorView({
|
|
1
|
+
{"version":3,"file":"StateViews.js","names":[],"sources":["../../../src/technospam/components/StateViews.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { AlertTriangle, Inbox } from 'lucide-react';\nimport { Skeleton } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../hooks/useTr';\n\n/**\n * Self-contained empty state (does not depend on host-shell illustration assets).\n * A soft glass medallion + lucide icon, a title, an optional description and action.\n */\nexport function EmptyView({\n title,\n description,\n action,\n icon,\n}: {\n title: string;\n description?: string;\n action?: ReactNode;\n icon?: ReactNode;\n}) {\n return (\n <div className=\"flex flex-col items-center justify-center gap-3 rounded-2xl border border-border-seam bg-bg-surface px-6 py-14 text-center\">\n <span className=\"flex h-14 w-14 items-center justify-center rounded-2xl bg-bg-sunken text-text-muted\">\n {icon ?? <Inbox size={26} />}\n </span>\n <h3 className=\"text-base font-semibold text-text-primary\">{title}</h3>\n {description ? <p className=\"max-w-md text-sm text-text-secondary\">{description}</p> : null}\n {action ? <div className=\"mt-2\">{action}</div> : null}\n </div>\n );\n}\n\n/** Consistent error state, surfaced from a GraphQL/network error. */\nexport function ErrorView({ title, error }: { title?: string; error?: { message?: string } }) {\n const tr = useTr();\n return (\n <div className=\"flex flex-col items-center justify-center gap-3 rounded-2xl border border-border-seam bg-bg-surface px-6 py-14 text-center\">\n <span className=\"flex h-14 w-14 items-center justify-center rounded-2xl bg-status-error-bg-subtle text-status-error-text\">\n <AlertTriangle size={26} />\n </span>\n <h3 className=\"text-base font-semibold text-text-primary\">\n {title ?? tr('technospam.common.errorTitle', \"Couldn't load this yet\")}\n </h3>\n <p className=\"max-w-md text-sm text-text-secondary\">\n {error?.message ?? tr('technospam.common.tryAgain', 'Please try again in a moment.')}\n </p>\n </div>\n );\n}\n\n/** Skeleton grid for card lists. */\nexport function LoadingGrid({ count = 6, height = 'h-56' }: { count?: number; height?: string }) {\n return (\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {Array.from({ length: count }).map((_, i) => (\n <Skeleton key={i} className={`${height} w-full rounded-xl`} />\n ))}\n </div>\n );\n}\n\n/** Skeleton rows for stacked lists. */\nexport function LoadingRows({ count = 4, height = 'h-20' }: { count?: number; height?: string }) {\n return (\n <div className=\"space-y-3\">\n {Array.from({ length: count }).map((_, i) => (\n <Skeleton key={i} className={`${height} w-full rounded-xl`} />\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;AASA,SAAgB,EAAU,EACxB,UACA,gBACA,WACA,WAMC;AACD,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,QAAD;IAAM,WAAU;cACb,KAAQ,kBAAC,GAAD,EAAO,MAAM,IAAM,CAAA;IACvB,CAAA;GACP,kBAAC,MAAD;IAAI,WAAU;cAA6C;IAAW,CAAA;GACrE,IAAc,kBAAC,KAAD;IAAG,WAAU;cAAwC;IAAgB,CAAA,GAAG;GACtF,IAAS,kBAAC,OAAD;IAAK,WAAU;cAAQ;IAAa,CAAA,GAAG;GAC7C;;;AAKV,SAAgB,EAAU,EAAE,UAAO,YAA2D;CAC5F,IAAM,IAAK,GAAO;AAClB,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,QAAD;IAAM,WAAU;cACd,kBAAC,GAAD,EAAe,MAAM,IAAM,CAAA;IACtB,CAAA;GACP,kBAAC,MAAD;IAAI,WAAU;cACX,KAAS,EAAG,gCAAgC,yBAAyB;IACnE,CAAA;GACL,kBAAC,KAAD;IAAG,WAAU;cACV,GAAO,WAAW,EAAG,8BAA8B,gCAAgC;IAClF,CAAA;GACA;;;AAKV,SAAgB,EAAY,EAAE,WAAQ,GAAG,YAAS,UAA+C;AAC/F,QACE,kBAAC,OAAD;EAAK,WAAU;YACZ,MAAM,KAAK,EAAE,QAAQ,GAAO,CAAC,CAAC,KAAK,GAAG,MACrC,kBAAC,GAAD,EAAkB,WAAW,GAAG,EAAO,qBAAuB,EAA/C,EAA+C,CAC9D;EACE,CAAA;;AAKV,SAAgB,EAAY,EAAE,WAAQ,GAAG,YAAS,UAA+C;AAC/F,QACE,kBAAC,OAAD;EAAK,WAAU;YACZ,MAAM,KAAK,EAAE,QAAQ,GAAO,CAAC,CAAC,KAAK,GAAG,MACrC,kBAAC,GAAD,EAAkB,WAAW,GAAG,EAAO,qBAAuB,EAA/C,EAA+C,CAC9D;EACE,CAAA"}
|
|
@@ -13,6 +13,6 @@ interface TagInputProps {
|
|
|
13
13
|
* arrays stored on Tec* entities while the workspace-wide @burdenoff/microfe-tags
|
|
14
14
|
* taxonomy is being adopted product-wide.
|
|
15
15
|
*/
|
|
16
|
-
export declare function TagInput({ value, onChange, placeholder, className, maxTags
|
|
16
|
+
export declare function TagInput({ value, onChange, placeholder, className, maxTags }: TagInputProps): import("react").JSX.Element;
|
|
17
17
|
export {};
|
|
18
18
|
//# sourceMappingURL=TagInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagInput.d.ts","sourceRoot":"","sources":["../../../src/technospam/components/TagInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TagInput.d.ts","sourceRoot":"","sources":["../../../src/technospam/components/TagInput.tsx"],"names":[],"mappings":"AAMA,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,aAAa,+BA6D3F"}
|
|
@@ -1,58 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { useTr as e } from "../hooks/useTr.js";
|
|
2
|
+
import { cn as t } from "../utils/cn.js";
|
|
3
|
+
import { useCallback as n, useState as r } from "react";
|
|
4
|
+
import { Plus as i, X as a } from "lucide-react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { Button as c, Input as l } from "@burdenoff/fe-libs/ui";
|
|
6
7
|
//#region src/technospam/components/TagInput.tsx
|
|
7
|
-
function
|
|
8
|
-
let [
|
|
9
|
-
let e =
|
|
8
|
+
function u({ value: u, onChange: d, placeholder: f, className: p, maxTags: m }) {
|
|
9
|
+
let h = e(), [g, _] = r(""), v = n(() => {
|
|
10
|
+
let e = g.split(",").map((e) => e.trim()).filter(Boolean);
|
|
10
11
|
if (e.length === 0) return;
|
|
11
|
-
let t = Array.from(new Set([...
|
|
12
|
-
|
|
12
|
+
let t = Array.from(new Set([...u, ...e]));
|
|
13
|
+
d(m ? t.slice(0, m) : t), _("");
|
|
13
14
|
}, [
|
|
14
|
-
|
|
15
|
-
l,
|
|
15
|
+
g,
|
|
16
16
|
u,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
d,
|
|
18
|
+
m
|
|
19
|
+
]), y = n((e) => {
|
|
20
|
+
d(u.filter((t) => t !== e));
|
|
21
|
+
}, [u, d]);
|
|
22
|
+
return /* @__PURE__ */ s("div", {
|
|
23
|
+
className: t("space-y-2", p),
|
|
24
|
+
children: [/* @__PURE__ */ o("div", {
|
|
24
25
|
className: "flex flex-wrap items-center gap-1.5",
|
|
25
|
-
children:
|
|
26
|
+
children: u.map((e) => /* @__PURE__ */ s("span", {
|
|
26
27
|
className: "inline-flex items-center gap-1 rounded-full border border-border-seam bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
|
|
27
|
-
children: [e, /* @__PURE__ */
|
|
28
|
+
children: [e, /* @__PURE__ */ o("button", {
|
|
28
29
|
type: "button",
|
|
29
|
-
onClick: () =>
|
|
30
|
+
onClick: () => y(e),
|
|
30
31
|
className: "rounded-full p-0.5 hover:bg-bg-surface hover:text-status-error-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]",
|
|
31
|
-
"aria-label":
|
|
32
|
-
children: /* @__PURE__ */ a
|
|
32
|
+
"aria-label": h("technospam.common.removeTagAria", "Remove {{tag}}", { tag: e }),
|
|
33
|
+
children: /* @__PURE__ */ o(a, { size: 10 })
|
|
33
34
|
})]
|
|
34
35
|
}, e))
|
|
35
|
-
}), /* @__PURE__ */
|
|
36
|
+
}), /* @__PURE__ */ s("div", {
|
|
36
37
|
className: "flex items-center gap-2",
|
|
37
|
-
children: [/* @__PURE__ */
|
|
38
|
-
value:
|
|
39
|
-
onChange: (e) =>
|
|
38
|
+
children: [/* @__PURE__ */ o(l, {
|
|
39
|
+
value: g,
|
|
40
|
+
onChange: (e) => _(e.target.value),
|
|
40
41
|
onKeyDown: (e) => {
|
|
41
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
42
|
+
e.key === "Enter" && (e.preventDefault(), v());
|
|
42
43
|
},
|
|
43
|
-
placeholder:
|
|
44
|
+
placeholder: f ?? h("technospam.common.addTag", "Add a tag…"),
|
|
44
45
|
className: "flex-1"
|
|
45
|
-
}), /* @__PURE__ */
|
|
46
|
+
}), /* @__PURE__ */ s(c, {
|
|
46
47
|
type: "button",
|
|
47
48
|
variant: "outline",
|
|
48
49
|
size: "sm",
|
|
49
|
-
onClick:
|
|
50
|
-
children: [
|
|
50
|
+
onClick: v,
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ o(i, { size: 14 }),
|
|
53
|
+
" ",
|
|
54
|
+
h("technospam.common.add", "Add")
|
|
55
|
+
]
|
|
51
56
|
})]
|
|
52
57
|
})]
|
|
53
58
|
});
|
|
54
59
|
}
|
|
55
60
|
//#endregion
|
|
56
|
-
export {
|
|
61
|
+
export { u as TagInput };
|
|
57
62
|
|
|
58
63
|
//# sourceMappingURL=TagInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagInput.js","names":[],"sources":["../../../src/technospam/components/TagInput.tsx"],"sourcesContent":["import { useState, useCallback } from 'react';\nimport { X, Plus } from 'lucide-react';\nimport { Input, Button } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface TagInputProps {\n value: string[];\n onChange: (tags: string[]) => void;\n placeholder?: string;\n className?: string;\n maxTags?: number;\n}\n\n/**\n * Small controlled tag input. Renders existing tags as removable chips and\n * commits a new tag on Enter or when the add button is pressed.\n *\n * This is the TechnoSpam-local tag picker; it works with the legacy string-tag\n * arrays stored on Tec* entities while the workspace-wide @burdenoff/microfe-tags\n * taxonomy is being adopted product-wide.\n */\nexport function TagInput({
|
|
1
|
+
{"version":3,"file":"TagInput.js","names":[],"sources":["../../../src/technospam/components/TagInput.tsx"],"sourcesContent":["import { useState, useCallback } from 'react';\nimport { X, Plus } from 'lucide-react';\nimport { Input, Button } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../hooks/useTr';\nimport { cn } from '../utils/cn';\n\ninterface TagInputProps {\n value: string[];\n onChange: (tags: string[]) => void;\n placeholder?: string;\n className?: string;\n maxTags?: number;\n}\n\n/**\n * Small controlled tag input. Renders existing tags as removable chips and\n * commits a new tag on Enter or when the add button is pressed.\n *\n * This is the TechnoSpam-local tag picker; it works with the legacy string-tag\n * arrays stored on Tec* entities while the workspace-wide @burdenoff/microfe-tags\n * taxonomy is being adopted product-wide.\n */\nexport function TagInput({ value, onChange, placeholder, className, maxTags }: TagInputProps) {\n const tr = useTr();\n const [draft, setDraft] = useState('');\n\n const commit = useCallback(() => {\n const next = draft\n .split(',')\n .map((t) => t.trim())\n .filter(Boolean);\n if (next.length === 0) return;\n const merged = Array.from(new Set([...value, ...next]));\n onChange(maxTags ? merged.slice(0, maxTags) : merged);\n setDraft('');\n }, [draft, value, onChange, maxTags]);\n\n const remove = useCallback(\n (tag: string) => {\n onChange(value.filter((t) => t !== tag));\n },\n [value, onChange]\n );\n\n return (\n <div className={cn('space-y-2', className)}>\n <div className=\"flex flex-wrap items-center gap-1.5\">\n {value.map((tag) => (\n <span\n key={tag}\n className=\"inline-flex items-center gap-1 rounded-full border border-border-seam bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary\"\n >\n {tag}\n <button\n type=\"button\"\n onClick={() => remove(tag)}\n className=\"rounded-full p-0.5 hover:bg-bg-surface hover:text-status-error-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]\"\n aria-label={tr('technospam.common.removeTagAria', 'Remove {{tag}}', { tag })}\n >\n <X size={10} />\n </button>\n </span>\n ))}\n </div>\n <div className=\"flex items-center gap-2\">\n <Input\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n commit();\n }\n }}\n placeholder={placeholder ?? tr('technospam.common.addTag', 'Add a tag…')}\n className=\"flex-1\"\n />\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={commit}>\n <Plus size={14} /> {tr('technospam.common.add', 'Add')}\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAsBA,SAAgB,EAAS,EAAE,UAAO,aAAU,gBAAa,cAAW,cAA0B;CAC5F,IAAM,IAAK,GAAO,EACZ,CAAC,GAAO,KAAY,EAAS,GAAG,EAEhC,IAAS,QAAkB;EAC/B,IAAM,IAAO,EACV,MAAM,IAAI,CACV,KAAK,MAAM,EAAE,MAAM,CAAC,CACpB,OAAO,QAAQ;AAClB,MAAI,EAAK,WAAW,EAAG;EACvB,IAAM,IAAS,MAAM,KAAK,IAAI,IAAI,CAAC,GAAG,GAAO,GAAG,EAAK,CAAC,CAAC;AAEvD,EADA,EAAS,IAAU,EAAO,MAAM,GAAG,EAAQ,GAAG,EAAO,EACrD,EAAS,GAAG;IACX;EAAC;EAAO;EAAO;EAAU;EAAQ,CAAC,EAE/B,IAAS,GACZ,MAAgB;AACf,IAAS,EAAM,QAAQ,MAAM,MAAM,EAAI,CAAC;IAE1C,CAAC,GAAO,EAAS,CAClB;AAED,QACE,kBAAC,OAAD;EAAK,WAAW,EAAG,aAAa,EAAU;YAA1C,CACE,kBAAC,OAAD;GAAK,WAAU;aACZ,EAAM,KAAK,MACV,kBAAC,QAAD;IAEE,WAAU;cAFZ,CAIG,GACD,kBAAC,UAAD;KACE,MAAK;KACL,eAAe,EAAO,EAAI;KAC1B,WAAU;KACV,cAAY,EAAG,mCAAmC,kBAAkB,EAAE,QAAK,CAAC;eAE5E,kBAAC,GAAD,EAAG,MAAM,IAAM,CAAA;KACR,CAAA,CACJ;MAZA,EAYA,CACP;GACE,CAAA,EACN,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,GAAD;IACE,OAAO;IACP,WAAW,MAAM,EAAS,EAAE,OAAO,MAAM;IACzC,YAAY,MAAM;AAChB,KAAI,EAAE,QAAQ,YACZ,EAAE,gBAAgB,EAClB,GAAQ;;IAGZ,aAAa,KAAe,EAAG,4BAA4B,aAAa;IACxE,WAAU;IACV,CAAA,EACF,kBAAC,GAAD;IAAQ,MAAK;IAAS,SAAQ;IAAU,MAAK;IAAK,SAAS;cAA3D;KACE,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;;KAAE,EAAG,yBAAyB,MAAM;KAC/C;MACL;KACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useTr — translation hook with fallback semantics.
|
|
3
|
+
*
|
|
4
|
+
* Wraps `useI18n().t()` so that when a key has no translation (i.e. the
|
|
5
|
+
* provider returns the key itself), the caller's English fallback is used
|
|
6
|
+
* instead. This keeps consumer call sites consistent and avoids leaking
|
|
7
|
+
* untranslated keys into the UI.
|
|
8
|
+
*
|
|
9
|
+
* Supports optional interpolation params using `{{key}}` placeholders.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const tr = useTr();
|
|
13
|
+
* return <h1>{tr('technospam.dashboard.title', 'Dashboard')}</h1>;
|
|
14
|
+
* return <p>{tr('technospam.delete.confirm', 'Delete {{count}} items?', { count: 5 })}</p>;
|
|
15
|
+
*/
|
|
16
|
+
export declare function useTr(): (key: string, fallback: string, params?: Record<string, string | number>) => string;
|
|
17
|
+
//# sourceMappingURL=useTr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTr.d.ts","sourceRoot":"","sources":["../../../src/technospam/hooks/useTr.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,IAAI,CACvB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KACrC,MAAM,CAOV"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { tWithFallback as e } from "../utils/i18n.js";
|
|
2
|
+
import { useCallback as t } from "react";
|
|
3
|
+
import { useI18n as n } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
4
|
+
//#region src/technospam/hooks/useTr.ts
|
|
5
|
+
function r() {
|
|
6
|
+
let { t: r } = n();
|
|
7
|
+
return t((t, n, i) => e(r, t, n, i), [r]);
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { r as useTr };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=useTr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTr.js","names":[],"sources":["../../../src/technospam/hooks/useTr.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { tWithFallback } from '../utils/i18n';\n\n/**\n * useTr — translation hook with fallback semantics.\n *\n * Wraps `useI18n().t()` so that when a key has no translation (i.e. the\n * provider returns the key itself), the caller's English fallback is used\n * instead. This keeps consumer call sites consistent and avoids leaking\n * untranslated keys into the UI.\n *\n * Supports optional interpolation params using `{{key}}` placeholders.\n *\n * @example\n * const tr = useTr();\n * return <h1>{tr('technospam.dashboard.title', 'Dashboard')}</h1>;\n * return <p>{tr('technospam.delete.confirm', 'Delete {{count}} items?', { count: 5 })}</p>;\n */\nexport function useTr(): (\n key: string,\n fallback: string,\n params?: Record<string, string | number>\n) => string {\n const { t } = useI18n();\n return useCallback(\n (key: string, fallback: string, params?: Record<string, string | number>): string =>\n tWithFallback(t, key, fallback, params),\n [t]\n );\n}\n"],"mappings":";;;;AAmBA,SAAgB,IAIJ;CACV,IAAM,EAAE,SAAM,GAAS;AACvB,QAAO,GACJ,GAAa,GAAkB,MAC9B,EAAc,GAAG,GAAK,GAAU,EAAO,EACzC,CAAC,EAAE,CACJ"}
|
|
@@ -2,5 +2,6 @@ export { TechnoSpamRoot } from './TechnoSpamRoot';
|
|
|
2
2
|
export type { TechnoSpamRootProps, NavItem, FooterItem } from './types';
|
|
3
3
|
export { useTechnoSpam, useTechnoSpamNavigate } from './providers/TechnoSpamProvider';
|
|
4
4
|
export * from './services/createSandboxAssistantTransport';
|
|
5
|
+
export { useTr } from './hooks/useTr';
|
|
5
6
|
export { useTechnoSpamAnalytics } from './hooks/useTechnoSpamAnalytics';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/technospam/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAOtF,cAAc,4CAA4C,CAAC;AAG3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/technospam/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAOtF,cAAc,4CAA4C,CAAC;AAG3D,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/dist/technospam/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsAnalyticsPagePage.d.ts","sourceRoot":"","sources":["../../../src/technospam/pages/AnalyticsAnalyticsPagePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnalyticsAnalyticsPagePage.d.ts","sourceRoot":"","sources":["../../../src/technospam/pages/AnalyticsAnalyticsPagePage.tsx"],"names":[],"mappings":"AA4XA,wBAAgB,0BAA0B,gCAodzC"}
|