@prenta/admin 2.1.0 → 2.3.0

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 (50) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/__tests__/components/batch-ai-actions.test.d.ts +2 -0
  3. package/dist/__tests__/components/batch-ai-actions.test.d.ts.map +1 -0
  4. package/dist/__tests__/components/batch-ai-actions.test.js +42 -0
  5. package/dist/__tests__/components/batch-ai-actions.test.js.map +1 -0
  6. package/dist/__tests__/components/document-locale-switcher.test.d.ts +2 -0
  7. package/dist/__tests__/components/document-locale-switcher.test.d.ts.map +1 -0
  8. package/dist/__tests__/components/document-locale-switcher.test.js +78 -0
  9. package/dist/__tests__/components/document-locale-switcher.test.js.map +1 -0
  10. package/dist/components/BatchAiActions.d.ts +15 -0
  11. package/dist/components/BatchAiActions.d.ts.map +1 -0
  12. package/dist/components/BatchAiActions.js +47 -0
  13. package/dist/components/BatchAiActions.js.map +1 -0
  14. package/dist/components/DocumentLocaleSwitcher.d.ts +15 -0
  15. package/dist/components/DocumentLocaleSwitcher.d.ts.map +1 -0
  16. package/dist/components/DocumentLocaleSwitcher.js +66 -0
  17. package/dist/components/DocumentLocaleSwitcher.js.map +1 -0
  18. package/dist/components/ui/Badge.d.ts +1 -1
  19. package/dist/components/ui/Button.d.ts +1 -1
  20. package/dist/prenta-admin.css +1 -1
  21. package/dist/views/CollectionList.d.ts.map +1 -1
  22. package/dist/views/CollectionList.js +2 -1
  23. package/dist/views/CollectionList.js.map +1 -1
  24. package/dist/views/Pages/PagesListView.d.ts.map +1 -1
  25. package/dist/views/Pages/PagesListView.js +4 -3
  26. package/dist/views/Pages/PagesListView.js.map +1 -1
  27. package/dist/views/Posts/PostsListView.d.ts.map +1 -1
  28. package/dist/views/Posts/PostsListView.js +4 -3
  29. package/dist/views/Posts/PostsListView.js.map +1 -1
  30. package/dist/views/page-editor/EditorTopBar.d.ts +4 -1
  31. package/dist/views/page-editor/EditorTopBar.d.ts.map +1 -1
  32. package/dist/views/page-editor/EditorTopBar.js +2 -2
  33. package/dist/views/page-editor/EditorTopBar.js.map +1 -1
  34. package/dist/views/page-editor/PageSectionEditor.d.ts.map +1 -1
  35. package/dist/views/page-editor/PageSectionEditor.js +2 -1
  36. package/dist/views/page-editor/PageSectionEditor.js.map +1 -1
  37. package/dist/views/post-editor/PostSectionEditor.d.ts.map +1 -1
  38. package/dist/views/post-editor/PostSectionEditor.js +2 -1
  39. package/dist/views/post-editor/PostSectionEditor.js.map +1 -1
  40. package/package.json +3 -3
  41. package/src/__tests__/components/batch-ai-actions.test.tsx +52 -0
  42. package/src/__tests__/components/document-locale-switcher.test.tsx +111 -0
  43. package/src/components/BatchAiActions.tsx +83 -0
  44. package/src/components/DocumentLocaleSwitcher.tsx +140 -0
  45. package/src/views/CollectionList.tsx +6 -0
  46. package/src/views/Pages/PagesListView.tsx +12 -0
  47. package/src/views/Posts/PostsListView.tsx +8 -0
  48. package/src/views/page-editor/EditorTopBar.tsx +4 -0
  49. package/src/views/page-editor/PageSectionEditor.tsx +12 -0
  50. package/src/views/post-editor/PostSectionEditor.tsx +12 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @actuate-media/cms-admin
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d51bb58: Document lists can queue meta descriptions, alt text, or summaries for the selected rows. The batch is confirmed first, each document counts against the daily AI cap, and the drafts are not published.
8
+
9
+ ## 2.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 8cf5922: Page and post editors can switch to another locale of the same document. Choosing a locale that does not exist yet creates a draft translation in that locale.
14
+
3
15
  ## 2.1.0
4
16
 
5
17
  ### Minor Changes
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=batch-ai-actions.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch-ai-actions.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/components/batch-ai-actions.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // @vitest-environment happy-dom
3
+ import { fireEvent, render, screen, waitFor } from '@testing-library/react';
4
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
5
+ import { BatchAiActions } from '../../components/BatchAiActions.js';
6
+ import { cmsApi } from '../../lib/api.js';
7
+ vi.mock('../../lib/api.js', () => ({
8
+ cmsApi: vi.fn(),
9
+ }));
10
+ const cmsApiMock = vi.mocked(cmsApi);
11
+ describe('BatchAiActions', () => {
12
+ beforeEach(() => {
13
+ cmsApiMock.mockReset();
14
+ });
15
+ it('confirms, then queues drafts without a publish status', async () => {
16
+ cmsApiMock.mockResolvedValue({ data: { jobId: 'job-1', count: 2 }, status: 202 });
17
+ const onQueued = vi.fn();
18
+ render(_jsx(BatchAiActions, { documents: [
19
+ { collection: 'pages', id: 'page-1' },
20
+ { collection: 'pages', id: 'page-2' },
21
+ ], onQueued: onQueued }));
22
+ fireEvent.click(screen.getByRole('button', { name: 'Summaries' }));
23
+ expect(screen.getByText(/Nothing is published/)).toBeTruthy();
24
+ expect(screen.getByText(/daily AI cap/)).toBeTruthy();
25
+ fireEvent.click(screen.getByRole('button', { name: 'Queue drafts' }));
26
+ await waitFor(() => expect(onQueued).toHaveBeenCalled());
27
+ const body = JSON.parse(String(cmsApiMock.mock.calls[0]?.[1]?.body));
28
+ expect(cmsApiMock).toHaveBeenCalledWith('/ai/batch', {
29
+ method: 'POST',
30
+ body: expect.any(String),
31
+ });
32
+ expect(body).toEqual({
33
+ operation: 'summarize',
34
+ documents: [
35
+ { collection: 'pages', id: 'page-1' },
36
+ { collection: 'pages', id: 'page-2' },
37
+ ],
38
+ });
39
+ expect(body).not.toHaveProperty('status');
40
+ });
41
+ });
42
+ //# sourceMappingURL=batch-ai-actions.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch-ai-actions.test.js","sourceRoot":"","sources":["../../../src/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sourceRoot":"","sources":["../../../src/__tests__/components/document-locale-switcher.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,78 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // @vitest-environment happy-dom
3
+ import { fireEvent, render, screen, waitFor } from '@testing-library/react';
4
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
5
+ import { DocumentLocaleSwitcher } from '../../components/DocumentLocaleSwitcher.js';
6
+ import { LocaleProvider } from '../../components/LocaleProvider.js';
7
+ import { cmsApi } from '../../lib/api.js';
8
+ vi.mock('../../lib/api.js', () => ({
9
+ cmsApi: vi.fn(),
10
+ }));
11
+ const cmsApiMock = vi.mocked(cmsApi);
12
+ const locales = {
13
+ i18n: {
14
+ defaultLocale: 'en',
15
+ locales: [
16
+ { code: 'en', label: 'English' },
17
+ { code: 'es', label: 'Spanish' },
18
+ ],
19
+ },
20
+ };
21
+ function renderSwitcher(onNavigate = vi.fn()) {
22
+ render(_jsx(LocaleProvider, { config: locales, children: _jsx(DocumentLocaleSwitcher, { collection: "pages", documentId: "page-1", canCreate: true, editorPath: (id) => `/pages/${id}/edit`, onNavigate: onNavigate }) }));
23
+ return onNavigate;
24
+ }
25
+ describe('DocumentLocaleSwitcher', () => {
26
+ beforeEach(() => {
27
+ cmsApiMock.mockReset();
28
+ cmsApiMock.mockResolvedValue({
29
+ data: {
30
+ locale: 'en',
31
+ translations: [{ id: 'page-1', locale: 'en', status: 'PUBLISHED', title: 'About' }],
32
+ },
33
+ status: 200,
34
+ });
35
+ });
36
+ it('hides itself when the site has a single locale', () => {
37
+ render(_jsx(LocaleProvider, { config: { i18n: { defaultLocale: 'en', locales: [{ code: 'en', label: 'English' }] } }, children: _jsx(DocumentLocaleSwitcher, { collection: "pages", documentId: "page-1", canCreate: true, editorPath: (id) => `/pages/${id}/edit`, onNavigate: vi.fn() }) }));
38
+ expect(screen.queryByRole('button', { name: /Translations/ })).toBeNull();
39
+ });
40
+ it('opens an existing translation', async () => {
41
+ cmsApiMock.mockResolvedValue({
42
+ data: {
43
+ locale: 'en',
44
+ translations: [
45
+ { id: 'page-1', locale: 'en', status: 'PUBLISHED', title: 'About' },
46
+ { id: 'page-es', locale: 'es', status: 'DRAFT', title: 'About' },
47
+ ],
48
+ },
49
+ status: 200,
50
+ });
51
+ const onNavigate = renderSwitcher();
52
+ await waitFor(() => expect(screen.getByRole('button', { name: 'Translations, English' })).toBeTruthy());
53
+ fireEvent.keyDown(screen.getByRole('button', { name: 'Translations, English' }), {
54
+ key: 'Enter',
55
+ });
56
+ fireEvent.click(screen.getByRole('menuitem', { name: /Spanish/ }));
57
+ expect(onNavigate).toHaveBeenCalledWith('/pages/page-es/edit');
58
+ expect(cmsApiMock).toHaveBeenCalledTimes(1);
59
+ });
60
+ it('creates a draft and opens it', async () => {
61
+ const onNavigate = renderSwitcher();
62
+ await waitFor(() => expect(screen.getByRole('button', { name: 'Translations, English' })).toBeTruthy());
63
+ cmsApiMock.mockResolvedValueOnce({
64
+ data: { id: 'page-es', locale: 'es', created: true },
65
+ status: 201,
66
+ });
67
+ fireEvent.keyDown(screen.getByRole('button', { name: 'Translations, English' }), {
68
+ key: 'Enter',
69
+ });
70
+ fireEvent.click(screen.getByRole('menuitem', { name: /Spanish/ }));
71
+ await waitFor(() => expect(onNavigate).toHaveBeenCalledWith('/pages/page-es/edit'));
72
+ expect(cmsApiMock).toHaveBeenLastCalledWith('/collections/pages/page-1/translations', {
73
+ method: 'POST',
74
+ body: JSON.stringify({ locale: 'es' }),
75
+ });
76
+ });
77
+ });
78
+ //# sourceMappingURL=document-locale-switcher.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-locale-switcher.test.js","sourceRoot":"","sources":["../../../src/__tests__/components/document-locale-switcher.test.tsx"],"names":[],"mappings":";AAAA,gCAAgC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAC3E,OAAO,EAAE,UAAU,EAAE,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,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;QAClE,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAC,CAAA;QACnF,MAAM,CAAC,UAAU,CAAC,CAAC,wBAAwB,CAAC,wCAAwC,EAAE;YACpF,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;SACvC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,15 @@
1
+ interface BatchAiActionsProps {
2
+ documents: Array<{
3
+ collection: string;
4
+ id: string;
5
+ }>;
6
+ onQueued?: () => void;
7
+ buttonClassName?: string;
8
+ }
9
+ /**
10
+ * Queues a list-view AI batch after a confirm that names the daily cap.
11
+ * The server writes field drafts and does not publish.
12
+ */
13
+ export declare function BatchAiActions({ documents, onQueued, buttonClassName }: BatchAiActionsProps): import("react/jsx-runtime").JSX.Element;
14
+ export {};
15
+ //# sourceMappingURL=BatchAiActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchAiActions.d.ts","sourceRoot":"","sources":["../../src/components/BatchAiActions.tsx"],"names":[],"mappings":"AAeA,UAAU,mBAAmB;IAC3B,SAAS,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE,mBAAmB,2CAyD3F"}
@@ -0,0 +1,47 @@
1
+ 'use client';
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from 'react';
4
+ import { toast } from 'sonner';
5
+ import { cmsApi } from '../lib/api.js';
6
+ import { ConfirmDialog } from './ui/ConfirmDialog.js';
7
+ const LABELS = {
8
+ meta: 'Meta descriptions',
9
+ 'alt-text': 'Alt text',
10
+ summarize: 'Summaries',
11
+ };
12
+ /**
13
+ * Queues a list-view AI batch after a confirm that names the daily cap.
14
+ * The server writes field drafts and does not publish.
15
+ */
16
+ export function BatchAiActions({ documents, onQueued, buttonClassName }) {
17
+ const [operation, setOperation] = useState(null);
18
+ const [busy, setBusy] = useState(false);
19
+ const buttonClass = buttonClassName ??
20
+ 'text-foreground hover:bg-accent rounded-md px-2 py-1 text-sm transition-colors';
21
+ async function confirm() {
22
+ if (!operation || busy)
23
+ return;
24
+ setBusy(true);
25
+ const result = await cmsApi('/ai/batch', {
26
+ method: 'POST',
27
+ body: JSON.stringify({ operation, documents }),
28
+ });
29
+ setBusy(false);
30
+ setOperation(null);
31
+ if (result.error || !result.data?.jobId) {
32
+ toast.error(result.error ?? 'Could not queue the batch');
33
+ return;
34
+ }
35
+ toast.success(`Queued ${LABELS[operation].toLowerCase()} for ${result.data.count} ${result.data.count === 1 ? 'document' : 'documents'}`);
36
+ onQueued?.();
37
+ }
38
+ return (_jsxs(_Fragment, { children: [Object.keys(LABELS).map((key) => (_jsx("button", { type: "button", disabled: busy || documents.length === 0, onClick: () => setOperation(key), className: buttonClass, children: LABELS[key] }, key))), _jsx(ConfirmDialog, { open: operation !== null, onClose: () => {
39
+ if (!busy)
40
+ setOperation(null);
41
+ }, onConfirm: () => {
42
+ void confirm();
43
+ }, title: operation ? `Write ${LABELS[operation].toLowerCase()}?` : 'Write drafts?', description: operation
44
+ ? `This queues ${LABELS[operation].toLowerCase()} for ${documents.length} selected ${documents.length === 1 ? 'document' : 'documents'}. Each document uses one request against the daily AI cap. Nothing is published.`
45
+ : '', confirmLabel: busy ? 'Queuing…' : 'Queue drafts' })] }));
46
+ }
47
+ //# sourceMappingURL=BatchAi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E,EAER,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,GAChD,IACD,CACJ,CAAA;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ interface DocumentLocaleSwitcherProps {
2
+ collection: string;
3
+ documentId: string;
4
+ canCreate: boolean;
5
+ editorPath: (id: string) => string;
6
+ onNavigate: (path: string) => void;
7
+ }
8
+ /**
9
+ * Switches the open document to another locale, creating a draft translation
10
+ * when that locale does not exist yet. Hidden when the site has fewer than
11
+ * two locales — the header language control is a different setting.
12
+ */
13
+ export declare function DocumentLocaleSwitcher({ collection, documentId, canCreate, editorPath, onNavigate, }: DocumentLocaleSwitcherProps): import("react/jsx-runtime").JSX.Element | null;
14
+ export {};
15
+ //# sourceMappingURL=DocumentLocaleSwitcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentLocaleSwitcher.d.ts","sourceRoot":"","sources":["../../src/components/DocumentLocaleSwitcher.tsx"],"names":[],"mappings":"AA4BA,UAAU,2BAA2B;IACnC,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAA;IAClC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,GACX,EAAE,2BAA2B,kDA4F7B"}
@@ -0,0 +1,66 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from 'react';
4
+ import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
5
+ import { ChevronDown, Globe } from 'lucide-react';
6
+ import { toast } from 'sonner';
7
+ import { cmsApi } from '../lib/api.js';
8
+ import { adminPortalContainer } from '../lib/portal-container.js';
9
+ import { useLocale } from './LocaleProvider.js';
10
+ /**
11
+ * Switches the open document to another locale, creating a draft translation
12
+ * when that locale does not exist yet. Hidden when the site has fewer than
13
+ * two locales — the header language control is a different setting.
14
+ */
15
+ export function DocumentLocaleSwitcher({ collection, documentId, canCreate, editorPath, onNavigate, }) {
16
+ const { locales } = useLocale();
17
+ const enabled = locales.length > 1;
18
+ const [currentLocale, setCurrentLocale] = useState(null);
19
+ const [siblings, setSiblings] = useState([]);
20
+ const [busy, setBusy] = useState(false);
21
+ useEffect(() => {
22
+ if (!enabled)
23
+ return;
24
+ let cancelled = false;
25
+ cmsApi(`/collections/${encodeURIComponent(collection)}/${encodeURIComponent(documentId)}/translations`).then((result) => {
26
+ if (cancelled || !result.data)
27
+ return;
28
+ setCurrentLocale(result.data.locale);
29
+ setSiblings(result.data.translations);
30
+ });
31
+ return () => {
32
+ cancelled = true;
33
+ };
34
+ }, [collection, documentId, enabled]);
35
+ if (!enabled)
36
+ return null;
37
+ const current = locales.find((locale) => locale.code === currentLocale);
38
+ const label = current?.code.toUpperCase() ?? 'Locale';
39
+ async function choose(code) {
40
+ const sibling = siblings.find((row) => row.locale === code);
41
+ if (sibling) {
42
+ if (sibling.id !== documentId)
43
+ onNavigate(editorPath(sibling.id));
44
+ return;
45
+ }
46
+ if (!canCreate || busy)
47
+ return;
48
+ setBusy(true);
49
+ const result = await cmsApi(`/collections/${encodeURIComponent(collection)}/${encodeURIComponent(documentId)}/translations`, { method: 'POST', body: JSON.stringify({ locale: code }) });
50
+ setBusy(false);
51
+ if (result.error || !result.data?.id) {
52
+ toast.error(result.error ?? 'Could not create the translation');
53
+ return;
54
+ }
55
+ onNavigate(editorPath(result.data.id));
56
+ }
57
+ return (_jsxs(DropdownMenu.Root, { children: [_jsx(DropdownMenu.Trigger, { asChild: true, children: _jsxs("button", { type: "button", disabled: busy, "aria-label": `Translations, ${current?.label ?? 'locale not set'}`, title: "Open or create a translation", className: "text-muted-foreground hover:text-foreground hover:bg-accent inline-flex shrink-0 items-center gap-1 rounded-lg px-2 py-1 text-sm disabled:cursor-not-allowed disabled:opacity-50", children: [_jsx(Globe, { className: "h-4 w-4", "aria-hidden": true }), label, _jsx(ChevronDown, { className: "h-3.5 w-3.5", "aria-hidden": true })] }) }), _jsx(DropdownMenu.Portal, { container: adminPortalContainer(), children: _jsx(DropdownMenu.Content, { align: "start", sideOffset: 6, className: "border-border bg-popover z-[120] min-w-40 rounded-lg border p-1 shadow-md", children: locales.map((locale) => {
58
+ const sibling = siblings.find((row) => row.locale === locale.code);
59
+ const isCurrent = locale.code === currentLocale;
60
+ const canChoose = Boolean(sibling) || canCreate;
61
+ return (_jsxs(DropdownMenu.Item, { disabled: !canChoose || busy, onSelect: () => {
62
+ void choose(locale.code);
63
+ }, className: "hover:bg-accent focus:bg-accent data-[disabled]:text-muted-foreground flex cursor-pointer items-center justify-between gap-3 rounded-md px-2.5 py-1.5 text-sm outline-none data-[disabled]:cursor-not-allowed", children: [_jsx("span", { children: locale.label }), _jsx("span", { className: "text-muted-foreground text-xs", children: isCurrent ? 'Current' : sibling ? sibling.status : 'New draft' })] }, locale.code));
64
+ }) }) })] }));
65
+ }
66
+ //# sourceMappingURL=DocumentLocaleSwitcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentLocaleSwitcher.js","sourceRoot":"","sources":["../../src/components/DocumentLocaleSwitcher.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;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 +1,7 @@
1
1
  import type { HTMLAttributes, ReactNode } from 'react';
2
2
  import { type VariantProps } from '../../lib/cv.js';
3
3
  declare const badge: (props?: ({
4
- tone?: "success" | "warning" | "info" | "danger" | "neutral" | "primary" | undefined;
4
+ tone?: "success" | "warning" | "info" | "primary" | "danger" | "neutral" | undefined;
5
5
  size?: "sm" | "md" | "lg" | undefined;
6
6
  } & {
7
7
  class?: string | false | null | undefined;
@@ -1,7 +1,7 @@
1
1
  import { type ButtonHTMLAttributes, type ReactNode } from 'react';
2
2
  import { type VariantProps } from '../../lib/cv.js';
3
3
  declare const button: (props?: ({
4
- variant?: "link" | "danger" | "primary" | "secondary" | "ghost" | "outline" | undefined;
4
+ variant?: "link" | "primary" | "secondary" | "danger" | "ghost" | "outline" | undefined;
5
5
  size?: "sm" | "md" | "lg" | "icon" | "xs" | undefined;
6
6
  } & {
7
7
  class?: string | false | null | undefined;