@acmekit/dashboard 2.13.21 → 2.13.23

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,8 +5,9 @@ import {
5
5
  prettifyRedactedToken
6
6
  } from "./chunk-J6XIB6ZU.mjs";
7
7
  import {
8
- StatusCell
9
- } from "./chunk-WILMJYUB.mjs";
8
+ DateCell,
9
+ PlaceholderCell
10
+ } from "./chunk-QZOY6YYT.mjs";
10
11
  import {
11
12
  _DataTable,
12
13
  useDataTable
@@ -14,9 +15,7 @@ import {
14
15
  import {
15
16
  useQueryParams
16
17
  } from "./chunk-C76H5USB.mjs";
17
- import {
18
- useDate
19
- } from "./chunk-DFFLVEZ5.mjs";
18
+ import "./chunk-DFFLVEZ5.mjs";
20
19
  import "./chunk-535OVBXR.mjs";
21
20
  import {
22
21
  SingleColumnPage
@@ -48,57 +47,59 @@ import { useLocation } from "react-router-dom";
48
47
  // src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/api-key-management-list-table.tsx
49
48
  import { Button, Container, Heading, Text } from "@acmekit/ui";
50
49
  import { keepPreviousData } from "@tanstack/react-query";
51
- import { useTranslation as useTranslation5 } from "react-i18next";
50
+ import { useTranslation as useTranslation4 } from "react-i18next";
52
51
  import { Link } from "react-router-dom";
53
52
 
54
53
  // src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/use-api-key-management-table-columns.tsx
55
54
  import { Badge } from "@acmekit/ui";
56
55
  import { createColumnHelper } from "@tanstack/react-table";
57
56
  import { useMemo } from "react";
58
- import { useTranslation as useTranslation3 } from "react-i18next";
59
-
60
- // src/components/table/table-cells/common/date-cell/date-cell.tsx
61
- import { Tooltip } from "@acmekit/ui";
62
- import { useTranslation } from "react-i18next";
63
-
64
- // src/components/table/table-cells/common/placeholder-cell/placeholder-cell.tsx
65
- import { jsx } from "react/jsx-runtime";
66
- var PlaceholderCell = () => {
67
- return /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx("span", { className: "text-ui-fg-muted", children: "-" }) });
68
- };
57
+ import { useTranslation as useTranslation2 } from "react-i18next";
69
58
 
70
- // src/components/table/table-cells/common/date-cell/date-cell.tsx
71
- import { jsx as jsx2 } from "react/jsx-runtime";
72
- var DateCell = ({ date }) => {
73
- const { getFullDate } = useDate();
74
- if (!date) {
75
- return /* @__PURE__ */ jsx2(PlaceholderCell, {});
76
- }
77
- return /* @__PURE__ */ jsx2("div", { className: "flex h-full w-full items-center overflow-hidden", children: /* @__PURE__ */ jsx2(
78
- Tooltip,
79
- {
80
- className: "z-10",
81
- content: /* @__PURE__ */ jsx2("span", { className: "text-pretty", children: `${getFullDate({
82
- date,
83
- includeTime: true
84
- })}` }),
85
- children: /* @__PURE__ */ jsx2("span", { className: "truncate", children: getFullDate({ date, includeTime: false }) })
86
- }
87
- ) });
59
+ // src/components/table/table-cells/common/status-cell/status-cell.tsx
60
+ import { clx } from "@acmekit/ui";
61
+ import { jsx, jsxs } from "react/jsx-runtime";
62
+ var StatusCell = ({ color, children }) => {
63
+ return /* @__PURE__ */ jsxs("div", { className: "txt-compact-small text-ui-fg-subtle flex h-full w-full items-center gap-x-2 overflow-hidden", children: [
64
+ /* @__PURE__ */ jsx(
65
+ "div",
66
+ {
67
+ role: "presentation",
68
+ className: "flex h-5 w-2 items-center justify-center",
69
+ children: /* @__PURE__ */ jsx(
70
+ "div",
71
+ {
72
+ className: clx(
73
+ "h-2 w-2 rounded-sm shadow-[0px_0px_0px_1px_rgba(0,0,0,0.12)_inset]",
74
+ {
75
+ "bg-ui-tag-neutral-icon": color === "grey",
76
+ "bg-ui-tag-green-icon": color === "green",
77
+ "bg-ui-tag-red-icon": color === "red",
78
+ "bg-ui-tag-blue-icon": color === "blue",
79
+ "bg-ui-tag-orange-icon": color === "orange",
80
+ "bg-ui-tag-purple-icon": color === "purple"
81
+ }
82
+ )
83
+ }
84
+ )
85
+ }
86
+ ),
87
+ /* @__PURE__ */ jsx("span", { className: "truncate", children })
88
+ ] });
88
89
  };
89
90
 
90
91
  // src/components/table/table-cells/common/text-cell/text-cell.tsx
91
- import { clx } from "@acmekit/ui";
92
- import { jsx as jsx3 } from "react/jsx-runtime";
92
+ import { clx as clx2 } from "@acmekit/ui";
93
+ import { jsx as jsx2 } from "react/jsx-runtime";
93
94
  var TextCell = ({ text, align = "left", maxWidth = 220 }) => {
94
95
  if (!text) {
95
- return /* @__PURE__ */ jsx3(PlaceholderCell, {});
96
+ return /* @__PURE__ */ jsx2(PlaceholderCell, {});
96
97
  }
97
98
  const stringLength = text.toString().length;
98
- return /* @__PURE__ */ jsx3(ConditionalTooltip, { content: text, showTooltip: stringLength > 20, children: /* @__PURE__ */ jsx3(
99
+ return /* @__PURE__ */ jsx2(ConditionalTooltip, { content: text, showTooltip: stringLength > 20, children: /* @__PURE__ */ jsx2(
99
100
  "div",
100
101
  {
101
- className: clx("flex h-full w-full items-center gap-x-3 overflow-hidden", {
102
+ className: clx2("flex h-full w-full items-center gap-x-3 overflow-hidden", {
102
103
  "justify-start text-start": align === "left",
103
104
  "justify-center text-center": align === "center",
104
105
  "justify-end text-end": align === "right"
@@ -106,7 +107,7 @@ var TextCell = ({ text, align = "left", maxWidth = 220 }) => {
106
107
  style: {
107
108
  maxWidth
108
109
  },
109
- children: /* @__PURE__ */ jsx3("span", { className: "truncate", children: text })
110
+ children: /* @__PURE__ */ jsx2("span", { className: "truncate", children: text })
110
111
  }
111
112
  ) });
112
113
  };
@@ -114,14 +115,14 @@ var TextCell = ({ text, align = "left", maxWidth = 220 }) => {
114
115
  // src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/api-key-row-actions.tsx
115
116
  import { PencilSquare, SquareTwoStack, Trash, XCircle } from "@acmekit/icons";
116
117
  import { toast, usePrompt } from "@acmekit/ui";
117
- import { useTranslation as useTranslation2 } from "react-i18next";
118
- import { jsx as jsx4 } from "react/jsx-runtime";
118
+ import { useTranslation } from "react-i18next";
119
+ import { jsx as jsx3 } from "react/jsx-runtime";
119
120
  var ApiKeyRowActions = ({
120
121
  apiKey
121
122
  }) => {
122
123
  const { mutateAsync: revokeAsync } = useRevokeApiKey(apiKey.id);
123
124
  const { mutateAsync: deleteAsync } = useDeleteApiKey(apiKey.id);
124
- const { t } = useTranslation2();
125
+ const { t } = useTranslation();
125
126
  const prompt = usePrompt();
126
127
  const handleDelete = async () => {
127
128
  const res = await prompt({
@@ -177,14 +178,14 @@ var ApiKeyRowActions = ({
177
178
  navigator.clipboard.writeText(apiKey.token);
178
179
  toast.success(t("apiKeyManagement.actions.copySuccessToast"));
179
180
  };
180
- return /* @__PURE__ */ jsx4(
181
+ return /* @__PURE__ */ jsx3(
181
182
  ActionMenu,
182
183
  {
183
184
  groups: [
184
185
  {
185
186
  actions: [
186
187
  {
187
- icon: /* @__PURE__ */ jsx4(PencilSquare, {}),
188
+ icon: /* @__PURE__ */ jsx3(PencilSquare, {}),
188
189
  label: t("actions.edit"),
189
190
  to: `${apiKey.id}/edit`
190
191
  },
@@ -192,7 +193,7 @@ var ApiKeyRowActions = ({
192
193
  {
193
194
  label: t("apiKeyManagement.actions.copy"),
194
195
  onClick: handleCopyToken,
195
- icon: /* @__PURE__ */ jsx4(SquareTwoStack, {})
196
+ icon: /* @__PURE__ */ jsx3(SquareTwoStack, {})
196
197
  }
197
198
  ] : []
198
199
  ]
@@ -200,13 +201,13 @@ var ApiKeyRowActions = ({
200
201
  {
201
202
  actions: [
202
203
  {
203
- icon: /* @__PURE__ */ jsx4(XCircle, {}),
204
+ icon: /* @__PURE__ */ jsx3(XCircle, {}),
204
205
  label: t("apiKeyManagement.actions.revoke"),
205
206
  onClick: handleRevoke,
206
207
  disabled: !!apiKey.revoked_at
207
208
  },
208
209
  {
209
- icon: /* @__PURE__ */ jsx4(Trash, {}),
210
+ icon: /* @__PURE__ */ jsx3(Trash, {}),
210
211
  label: t("actions.delete"),
211
212
  onClick: handleDelete,
212
213
  disabled: !apiKey.revoked_at
@@ -219,55 +220,55 @@ var ApiKeyRowActions = ({
219
220
  };
220
221
 
221
222
  // src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/use-api-key-management-table-columns.tsx
222
- import { jsx as jsx5 } from "react/jsx-runtime";
223
+ import { jsx as jsx4 } from "react/jsx-runtime";
223
224
  var columnHelper = createColumnHelper();
224
225
  var useApiKeyManagementTableColumns = () => {
225
- const { t } = useTranslation3();
226
+ const { t } = useTranslation2();
226
227
  return useMemo(
227
228
  () => [
228
229
  columnHelper.accessor("title", {
229
230
  header: t("fields.title"),
230
- cell: ({ getValue }) => /* @__PURE__ */ jsx5("div", { className: "flex size-full items-center", children: /* @__PURE__ */ jsx5("span", { className: "truncate", children: getValue() }) })
231
+ cell: ({ getValue }) => /* @__PURE__ */ jsx4("div", { className: "flex size-full items-center", children: /* @__PURE__ */ jsx4("span", { className: "truncate", children: getValue() }) })
231
232
  }),
232
233
  columnHelper.accessor("redacted", {
233
234
  header: "Token",
234
235
  cell: ({ getValue }) => {
235
236
  const token = getValue();
236
- return /* @__PURE__ */ jsx5(Badge, { size: "2xsmall", children: prettifyRedactedToken(token) });
237
+ return /* @__PURE__ */ jsx4(Badge, { size: "2xsmall", children: prettifyRedactedToken(token) });
237
238
  }
238
239
  }),
239
240
  columnHelper.accessor("type", {
240
241
  header: t("fields.type"),
241
242
  cell: ({ getValue }) => {
242
243
  const { label } = getApiKeyTypeProps(getValue(), t);
243
- return /* @__PURE__ */ jsx5(TextCell, { text: label });
244
+ return /* @__PURE__ */ jsx4(TextCell, { text: label });
244
245
  }
245
246
  }),
246
247
  columnHelper.accessor("revoked_at", {
247
248
  header: t("fields.status"),
248
249
  cell: ({ getValue }) => {
249
250
  const { color, label } = getApiKeyStatusProps(getValue(), t);
250
- return /* @__PURE__ */ jsx5(StatusCell, { color, children: label });
251
+ return /* @__PURE__ */ jsx4(StatusCell, { color, children: label });
251
252
  }
252
253
  }),
253
254
  columnHelper.accessor("last_used_at", {
254
255
  header: t("apiKeyManagement.table.lastUsedAtHeader"),
255
256
  cell: ({ getValue }) => {
256
257
  const date = getValue();
257
- return /* @__PURE__ */ jsx5(DateCell, { date });
258
+ return /* @__PURE__ */ jsx4(DateCell, { date });
258
259
  }
259
260
  }),
260
261
  columnHelper.accessor("created_at", {
261
262
  header: t("fields.created"),
262
263
  cell: ({ getValue }) => {
263
264
  const date = getValue();
264
- return /* @__PURE__ */ jsx5(DateCell, { date });
265
+ return /* @__PURE__ */ jsx4(DateCell, { date });
265
266
  }
266
267
  }),
267
268
  columnHelper.display({
268
269
  id: "actions",
269
270
  cell: ({ row }) => {
270
- return /* @__PURE__ */ jsx5(ApiKeyRowActions, { apiKey: row.original });
271
+ return /* @__PURE__ */ jsx4(ApiKeyRowActions, { apiKey: row.original });
271
272
  }
272
273
  })
273
274
  ],
@@ -276,9 +277,9 @@ var useApiKeyManagementTableColumns = () => {
276
277
  };
277
278
 
278
279
  // src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/use-api-key-management-table-filters.tsx
279
- import { useTranslation as useTranslation4 } from "react-i18next";
280
+ import { useTranslation as useTranslation3 } from "react-i18next";
280
281
  var useApiKeyManagementTableFilters = () => {
281
- const { t } = useTranslation4();
282
+ const { t } = useTranslation3();
282
283
  let filters = [];
283
284
  const dateFilters = [
284
285
  { label: t("fields.createdAt"), key: "created_at", type: "date" },
@@ -315,12 +316,12 @@ var useApiKeyManagementTableQuery = ({
315
316
  };
316
317
 
317
318
  // src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/api-key-management-list-table.tsx
318
- import { jsx as jsx6, jsxs } from "react/jsx-runtime";
319
+ import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
319
320
  var PAGE_SIZE = 20;
320
321
  var ApiKeyManagementListTable = ({
321
322
  keyType
322
323
  }) => {
323
- const { t } = useTranslation5();
324
+ const { t } = useTranslation4();
324
325
  const { searchParams, raw } = useApiKeyManagementTableQuery({
325
326
  pageSize: PAGE_SIZE
326
327
  });
@@ -345,15 +346,15 @@ var ApiKeyManagementListTable = ({
345
346
  if (isError) {
346
347
  throw error;
347
348
  }
348
- return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
349
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
350
- /* @__PURE__ */ jsxs("div", { children: [
351
- /* @__PURE__ */ jsx6(Heading, { level: "h1", children: keyType === "client" ? t(`apiKeyManagement.domain.client`) : t("apiKeyManagement.domain.secret") }),
352
- /* @__PURE__ */ jsx6(Text, { className: "text-ui-fg-subtle", size: "small", children: keyType === "client" ? t(`apiKeyManagement.subtitle.client`) : t("apiKeyManagement.subtitle.secret") })
349
+ return /* @__PURE__ */ jsxs2(Container, { className: "divide-y p-0", children: [
350
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
351
+ /* @__PURE__ */ jsxs2("div", { children: [
352
+ /* @__PURE__ */ jsx5(Heading, { level: "h1", children: keyType === "client" ? t(`apiKeyManagement.domain.client`) : t("apiKeyManagement.domain.secret") }),
353
+ /* @__PURE__ */ jsx5(Text, { className: "text-ui-fg-subtle", size: "small", children: keyType === "client" ? t(`apiKeyManagement.subtitle.client`) : t("apiKeyManagement.subtitle.secret") })
353
354
  ] }),
354
- /* @__PURE__ */ jsx6(Link, { to: "create", children: /* @__PURE__ */ jsx6(Button, { variant: "secondary", size: "small", children: t("actions.create") }) })
355
+ /* @__PURE__ */ jsx5(Link, { to: "create", children: /* @__PURE__ */ jsx5(Button, { variant: "secondary", size: "small", children: t("actions.create") }) })
355
356
  ] }),
356
- /* @__PURE__ */ jsx6(
357
+ /* @__PURE__ */ jsx5(
357
358
  _DataTable,
358
359
  {
359
360
  table,
@@ -378,12 +379,12 @@ var ApiKeyManagementListTable = ({
378
379
  };
379
380
 
380
381
  // src/routes/api-key-management/api-key-management-list/api-key-management-list.tsx
381
- import { jsx as jsx7 } from "react/jsx-runtime";
382
+ import { jsx as jsx6 } from "react/jsx-runtime";
382
383
  var ApiKeyManagementList = () => {
383
384
  const { pathname } = useLocation();
384
385
  const { getWidgets } = useExtension();
385
386
  const keyType = getApiKeyTypeFromPathname(pathname);
386
- return /* @__PURE__ */ jsx7(
387
+ return /* @__PURE__ */ jsx6(
387
388
  SingleColumnPage,
388
389
  {
389
390
  hasOutlet: true,
@@ -391,7 +392,7 @@ var ApiKeyManagementList = () => {
391
392
  before: getWidgets("api_key.list.before"),
392
393
  after: getWidgets("api_key.list.after")
393
394
  },
394
- children: /* @__PURE__ */ jsx7(ApiKeyManagementListTable, { keyType })
395
+ children: /* @__PURE__ */ jsx6(ApiKeyManagementListTable, { keyType })
395
396
  }
396
397
  );
397
398
  };