@burdenoff/microfe-i18n 2026.624.1 → 2026.625.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.
@@ -5,9 +5,10 @@ import { useI18n as r } from "../providers/I18nProvider.js";
5
5
  import { useI18nStore as i } from "../store/i18nStore.js";
6
6
  import { useState as a } from "react";
7
7
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
+ import { CTAOverflowMenu as c, EmphasisPanel as l, GlassCard as u, GradientText as d, IllustratedEmptyState as f, PagePurpose as p } from "@burdenoff/fe-libs/ui";
8
9
  //#region src/i18n/pages/LanguagesListPage.tsx
9
- var c = () => {
10
- let { t: c } = r(), l = (e, t, n) => c(e, t, n), { languageFilter: u, updateLanguageFilter: d, setSelectedLanguage: f } = i(), [p, m] = a(u.search), h = [{
10
+ var m = () => {
11
+ let { t: m } = r(), h = (e, t, n) => m(e, t, n), { languageFilter: g, updateLanguageFilter: _, setSelectedLanguage: v } = i(), [y, b] = a(g.search), x = [{
11
12
  id: "1",
12
13
  code: "en",
13
14
  name: "English",
@@ -23,131 +24,194 @@ var c = () => {
23
24
  direction: "ltr",
24
25
  status: "active",
25
26
  isDefault: !1
26
- }], g = (e) => {
27
- m(e), d({ search: e });
28
- };
27
+ }], S = (e) => {
28
+ b(e), _({ search: e });
29
+ }, C = "rounded-lg border border-border-seam bg-bg-elevated px-3 py-2.5 text-sm text-text-primary focus:border-action-primary-bg focus-visible:shadow-[var(--shadow-focus)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]", w = (y ?? "").trim().length > 0 || g.status !== "all" || g.direction !== "all", T = x.filter((e) => e.status === "active").length, E = x.find((e) => e.isDefault);
29
30
  return /* @__PURE__ */ s("div", {
30
- className: "flex h-full flex-col",
31
- children: [
32
- /* @__PURE__ */ o("div", {
33
- className: "border-b border-border-subtle bg-surface-elevated p-6",
34
- children: /* @__PURE__ */ s("div", {
35
- className: "flex items-center justify-between",
31
+ className: "min-h-full w-full bg-bg-surface",
32
+ children: [/* @__PURE__ */ o("div", {
33
+ className: "border-b border-border-seam bg-bg-surface px-6 py-6 sm:px-8 lg:px-10",
34
+ children: /* @__PURE__ */ s("div", {
35
+ className: "mx-auto flex max-w-screen-xl flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
36
+ children: [/* @__PURE__ */ s("div", {
37
+ className: "flex items-center gap-4",
38
+ children: [/* @__PURE__ */ o("div", {
39
+ className: "flex size-11 shrink-0 items-center justify-center rounded-xl bg-action-primary-bg/10 text-primary shadow-elevation-1",
40
+ children: /* @__PURE__ */ o(e, {
41
+ className: "size-5",
42
+ "aria-hidden": "true"
43
+ })
44
+ }), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("h1", {
45
+ className: "text-2xl font-bold tracking-tight text-text-primary",
46
+ children: /* @__PURE__ */ o(d, { children: h("i18n.languages.title", "Languages") })
47
+ }), /* @__PURE__ */ o("p", {
48
+ className: "mt-0.5 text-sm text-text-secondary",
49
+ children: h("i18n.languages.subtitle", "Configure the locales your products ship in")
50
+ })] })]
51
+ }), /* @__PURE__ */ o(c, {
52
+ primary: {
53
+ label: h("i18n.languages.actions.add", "Add Language"),
54
+ onSelect: () => void 0,
55
+ icon: /* @__PURE__ */ o(t, {
56
+ className: "size-4",
57
+ "aria-hidden": "true"
58
+ })
59
+ },
60
+ actions: []
61
+ })]
62
+ })
63
+ }), /* @__PURE__ */ s("div", {
64
+ className: "mx-auto max-w-screen-xl space-y-6 px-6 py-8 sm:px-8 lg:px-10",
65
+ children: [
66
+ /* @__PURE__ */ o(p, { children: h("i18n.languages.purpose", "This is the master list of every locale your products can ship in — the set of languages translators can work in and users can switch to. Add a language here before any of its translations can be entered, set which one is the default fallback, and configure its formatting and text direction.") }),
67
+ /* @__PURE__ */ s(l, {
68
+ className: "flex flex-col gap-4 sm:flex-row sm:items-center",
36
69
  children: [/* @__PURE__ */ s("div", {
37
- className: "flex items-center gap-3",
38
- children: [/* @__PURE__ */ o(e, { className: "size-6 text-accent-primary" }), /* @__PURE__ */ o("h1", {
39
- className: "text-2xl font-semibold text-content-primary",
40
- children: l("i18n.languages.title", "Languages")
70
+ className: "flex flex-1 items-center gap-4",
71
+ children: [/* @__PURE__ */ o("div", {
72
+ className: "flex size-14 shrink-0 items-center justify-center rounded-2xl bg-action-primary-bg/10 text-primary shadow-elevation-1",
73
+ children: /* @__PURE__ */ o(e, {
74
+ className: "size-7",
75
+ "aria-hidden": "true"
76
+ })
77
+ }), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("p", {
78
+ className: "text-sm font-medium text-text-secondary",
79
+ children: h("i18n.languages.summary.label", "Languages configured")
80
+ }), /* @__PURE__ */ o("p", {
81
+ className: "text-4xl font-bold tracking-tight text-text-primary tabular-nums",
82
+ children: x.length
83
+ })] })]
84
+ }), /* @__PURE__ */ s("div", {
85
+ className: "flex flex-wrap gap-3 sm:justify-end",
86
+ children: [/* @__PURE__ */ s("div", {
87
+ className: "flex items-center gap-1.5 rounded-lg border border-border-seam bg-bg-sunken/60 px-3 py-1.5 text-xs text-text-secondary",
88
+ children: [/* @__PURE__ */ o("span", {
89
+ className: "size-1.5 rounded-full bg-status-success-text motion-safe:animate-vc-glow-pulse",
90
+ "aria-hidden": "true"
91
+ }), h("i18n.languages.summary.active", "{{count}} active", { count: T })]
92
+ }), E && /* @__PURE__ */ o("div", {
93
+ className: "rounded-lg border border-border-seam bg-bg-sunken/60 px-3 py-1.5 text-xs text-text-secondary",
94
+ children: h("i18n.languages.summary.default", "Default: {{name}}", { name: E.name })
41
95
  })]
42
- }), /* @__PURE__ */ s("button", {
43
- type: "button",
44
- className: "flex items-center gap-2 rounded-md bg-accent-primary px-4 py-2 text-sm font-medium text-white hover:bg-accent-primary-hover",
45
- children: [/* @__PURE__ */ o(t, { className: "size-4" }), l("i18n.languages.actions.add", "Add Language")]
46
96
  })]
47
- })
48
- }),
49
- /* @__PURE__ */ o("div", {
50
- className: "border-b border-border-subtle bg-surface p-4",
51
- children: /* @__PURE__ */ s("div", {
52
- className: "flex items-center gap-4",
97
+ }),
98
+ /* @__PURE__ */ s("div", {
99
+ className: "flex flex-col gap-3 sm:flex-row sm:items-center",
53
100
  children: [
54
101
  /* @__PURE__ */ s("div", {
55
102
  className: "relative flex-1",
56
- children: [/* @__PURE__ */ o(n, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-content-secondary" }), /* @__PURE__ */ o("input", {
103
+ children: [/* @__PURE__ */ o(n, {
104
+ className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-secondary",
105
+ "aria-hidden": "true"
106
+ }), /* @__PURE__ */ o("input", {
57
107
  type: "text",
58
- "aria-label": l("i18n.languages.filters.searchAriaLabel", "Search languages"),
59
- placeholder: l("i18n.languages.filters.searchPlaceholder", "Search languages..."),
60
- value: p,
61
- onChange: (e) => g(e.target.value),
62
- className: "w-full rounded-md border border-border-subtle bg-surface-elevated py-2 pl-10 pr-4 text-sm text-content-primary placeholder:text-content-tertiary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary"
108
+ "aria-label": h("i18n.languages.filters.searchAriaLabel", "Search languages"),
109
+ placeholder: h("i18n.languages.filters.searchPlaceholder", "Search languages..."),
110
+ value: y,
111
+ onChange: (e) => S(e.target.value),
112
+ className: "w-full rounded-lg border border-border-seam bg-bg-elevated py-2.5 pl-10 pr-4 text-sm text-text-primary placeholder:text-text-tertiary focus:border-action-primary-bg focus-visible:shadow-[var(--shadow-focus)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]"
63
113
  })]
64
114
  }),
65
115
  /* @__PURE__ */ s("select", {
66
- "aria-label": l("i18n.languages.filters.status.label", "Filter by status"),
67
- value: u.status,
68
- onChange: (e) => d({ status: e.target.value }),
69
- className: "rounded-md border border-border-subtle bg-surface-elevated px-3 py-2 text-sm text-content-primary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary",
116
+ "aria-label": h("i18n.languages.filters.status.label", "Filter by status"),
117
+ value: g.status,
118
+ onChange: (e) => _({ status: e.target.value }),
119
+ className: C,
70
120
  children: [
71
121
  /* @__PURE__ */ o("option", {
72
122
  value: "all",
73
- children: l("i18n.languages.filters.status.all", "All Status")
123
+ children: h("i18n.languages.filters.status.all", "All Status")
74
124
  }),
75
125
  /* @__PURE__ */ o("option", {
76
126
  value: "active",
77
- children: l("i18n.shared.status.active", "Active")
127
+ children: h("i18n.shared.status.active", "Active")
78
128
  }),
79
129
  /* @__PURE__ */ o("option", {
80
130
  value: "inactive",
81
- children: l("i18n.shared.status.inactive", "Inactive")
131
+ children: h("i18n.shared.status.inactive", "Inactive")
82
132
  })
83
133
  ]
84
134
  }),
85
135
  /* @__PURE__ */ s("select", {
86
- "aria-label": l("i18n.languages.filters.direction.label", "Filter by direction"),
87
- value: u.direction,
88
- onChange: (e) => d({ direction: e.target.value }),
89
- className: "rounded-md border border-border-subtle bg-surface-elevated px-3 py-2 text-sm text-content-primary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary",
136
+ "aria-label": h("i18n.languages.filters.direction.label", "Filter by direction"),
137
+ value: g.direction,
138
+ onChange: (e) => _({ direction: e.target.value }),
139
+ className: C,
90
140
  children: [
91
141
  /* @__PURE__ */ o("option", {
92
142
  value: "all",
93
- children: l("i18n.languages.filters.direction.all", "All Directions")
143
+ children: h("i18n.languages.filters.direction.all", "All Directions")
94
144
  }),
95
145
  /* @__PURE__ */ o("option", {
96
146
  value: "ltr",
97
- children: l("i18n.shared.direction.ltr", "LTR")
147
+ children: h("i18n.shared.direction.ltr", "LTR")
98
148
  }),
99
149
  /* @__PURE__ */ o("option", {
100
150
  value: "rtl",
101
- children: l("i18n.shared.direction.rtl", "RTL")
151
+ children: h("i18n.shared.direction.rtl", "RTL")
102
152
  })
103
153
  ]
104
154
  })
105
155
  ]
106
- })
107
- }),
108
- /* @__PURE__ */ o("div", {
109
- className: "flex-1 overflow-auto p-6",
110
- children: /* @__PURE__ */ o("div", {
156
+ }),
157
+ x.length === 0 && /* @__PURE__ */ o(f, {
158
+ illustration: w ? "empty-search" : "empty-data",
159
+ title: w ? h("i18n.languages.empty.search.title", "No languages match") : h("i18n.languages.empty.title", "No languages yet"),
160
+ description: w ? h("i18n.languages.empty.search.description", "Adjust your filters to see more languages.") : h("i18n.languages.empty.description", "Add a language to begin localizing your products.")
161
+ }),
162
+ x.length > 0 && /* @__PURE__ */ o("div", {
111
163
  className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",
112
- children: h.map((e) => /* @__PURE__ */ o("button", {
113
- type: "button",
114
- onClick: () => f(e),
115
- className: "cursor-pointer rounded-lg border border-border-subtle bg-surface-elevated p-4 text-left transition-all hover:border-accent-primary hover:shadow-md",
116
- children: /* @__PURE__ */ s("div", {
117
- className: "flex items-start justify-between",
118
- children: [/* @__PURE__ */ s("div", {
119
- className: "flex-1",
120
- children: [
121
- /* @__PURE__ */ s("div", {
122
- className: "flex items-center gap-2",
123
- children: [/* @__PURE__ */ o("h3", {
124
- className: "font-medium text-content-primary",
125
- children: e.name
126
- }), e.isDefault && /* @__PURE__ */ o("span", {
127
- className: "rounded bg-accent-primary/10 px-2 py-0.5 text-xs font-medium text-accent-primary",
128
- children: l("i18n.languages.badges.default", "Default")
129
- })]
130
- }),
131
- /* @__PURE__ */ o("p", {
132
- className: "mt-1 text-sm text-content-secondary",
133
- children: e.nativeName
134
- }),
135
- /* @__PURE__ */ s("div", {
136
- className: "mt-2 flex items-center gap-3 text-xs text-content-tertiary",
137
- children: [
138
- /* @__PURE__ */ o("span", { children: l("i18n.languages.card.code", "Code: {{code}}", { code: e.code }) }),
139
- /* @__PURE__ */ o("span", { children: "•" }),
140
- /* @__PURE__ */ o("span", { children: e.direction === "ltr" ? l("i18n.shared.direction.ltr", "LTR") : l("i18n.shared.direction.rtl", "RTL") })
141
- ]
142
- })
143
- ]
144
- }), /* @__PURE__ */ o("div", { className: `size-2 rounded-full ${e.status === "active" ? "bg-success" : "bg-content-tertiary"}` })]
164
+ children: x.map((e, t) => /* @__PURE__ */ o(u, {
165
+ treatment: "metric",
166
+ glow: t === 0,
167
+ className: "border-border-seam",
168
+ children: /* @__PURE__ */ o("button", {
169
+ type: "button",
170
+ onClick: () => v(e),
171
+ className: "block w-full cursor-pointer rounded-[inherit] p-5 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]",
172
+ children: /* @__PURE__ */ s("div", {
173
+ className: "flex items-start justify-between gap-3",
174
+ children: [/* @__PURE__ */ s("div", {
175
+ className: "flex-1",
176
+ children: [
177
+ /* @__PURE__ */ s("div", {
178
+ className: "flex items-center gap-2",
179
+ children: [/* @__PURE__ */ o("h3", {
180
+ className: "font-semibold text-text-primary",
181
+ children: e.name
182
+ }), e.isDefault && /* @__PURE__ */ o("span", {
183
+ className: "rounded-full bg-action-primary-bg/10 px-2 py-0.5 text-xs font-medium text-primary",
184
+ children: h("i18n.languages.badges.default", "Default")
185
+ })]
186
+ }),
187
+ /* @__PURE__ */ o("p", {
188
+ className: "mt-1 text-sm text-text-secondary",
189
+ children: e.nativeName
190
+ }),
191
+ /* @__PURE__ */ s("div", {
192
+ className: "mt-2 flex items-center gap-3 text-xs text-text-tertiary tabular-nums",
193
+ children: [
194
+ /* @__PURE__ */ o("span", { children: h("i18n.languages.card.code", "Code: {{code}}", { code: e.code }) }),
195
+ /* @__PURE__ */ o("span", {
196
+ "aria-hidden": "true",
197
+ children: "•"
198
+ }),
199
+ /* @__PURE__ */ o("span", { children: e.direction === "ltr" ? h("i18n.shared.direction.ltr", "LTR") : h("i18n.shared.direction.rtl", "RTL") })
200
+ ]
201
+ })
202
+ ]
203
+ }), /* @__PURE__ */ o("span", {
204
+ className: `mt-1 size-2 rounded-full ${e.status === "active" ? "bg-status-success-text motion-safe:animate-vc-glow-pulse" : "bg-text-tertiary"}`,
205
+ title: e.status === "active" ? h("i18n.shared.status.active", "Active") : h("i18n.shared.status.inactive", "Inactive"),
206
+ "aria-label": e.status === "active" ? h("i18n.shared.status.active", "Active") : h("i18n.shared.status.inactive", "Inactive")
207
+ })]
208
+ })
145
209
  })
146
210
  }, e.id))
147
211
  })
148
- })
149
- ]
212
+ ]
213
+ })]
150
214
  });
151
215
  };
152
216
  //#endregion
153
- export { c as LanguagesListPage };
217
+ export { m as LanguagesListPage };