@gntik-ai/blocks 0.9.0 → 0.11.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.
- package/dist/index.d.ts +426 -55
- package/dist/index.js +2275 -639
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/auth/ForgotPasswordForm/ForgotPasswordForm.labels.test.tsx +179 -0
- package/src/auth/ForgotPasswordForm/ForgotPasswordForm.tsx +59 -24
- package/src/auth/ForgotPasswordForm/block.meta.ts +22 -1
- package/src/auth/ForgotPasswordForm/examples/Labels.tsx +29 -0
- package/src/auth/MfaChallenge/MfaChallenge.labels.test.tsx +139 -0
- package/src/auth/MfaChallenge/MfaChallenge.tsx +69 -23
- package/src/auth/MfaChallenge/block.meta.ts +29 -1
- package/src/auth/MfaChallenge/examples/Labels.tsx +28 -0
- package/src/auth/ResetPasswordForm/ResetPasswordForm.labels.test.tsx +104 -0
- package/src/auth/ResetPasswordForm/ResetPasswordForm.tsx +42 -15
- package/src/auth/ResetPasswordForm/block.meta.ts +17 -1
- package/src/auth/ResetPasswordForm/examples/Labels.tsx +28 -0
- package/src/auth/SignInForm/SignInForm.labels.test.tsx +137 -0
- package/src/auth/SignInForm/SignInForm.tsx +43 -16
- package/src/auth/SignInForm/block.meta.ts +22 -1
- package/src/auth/SignInForm/examples/Labels.tsx +29 -0
- package/src/auth/SignUpForm/SignUpForm.labels.test.tsx +217 -0
- package/src/auth/SignUpForm/SignUpForm.tsx +65 -26
- package/src/auth/SignUpForm/block.meta.ts +27 -1
- package/src/auth/SignUpForm/examples/Labels.tsx +29 -0
- package/src/auth/SsoButtons/SsoButtons.labels.test.tsx +30 -0
- package/src/auth/SsoButtons/SsoButtons.tsx +10 -2
- package/src/auth/SsoButtons/block.meta.ts +8 -1
- package/src/auth/SsoButtons/examples/Labels.tsx +24 -0
- package/src/auth/shared.i18n.test.tsx +71 -0
- package/src/auth/shared.tsx +48 -11
- package/src/billing/CostBreakdown/CostBreakdown.test.tsx +10 -0
- package/src/billing/CostBreakdown/CostBreakdown.tsx +50 -43
- package/src/billing/SpendVsBudget/SpendVsBudget.test.tsx +10 -0
- package/src/billing/SpendVsBudget/SpendVsBudget.tsx +35 -31
- package/src/builders/FlowBuilder/FlowBuilder.test.tsx +237 -2
- package/src/builders/FlowBuilder/FlowBuilder.tsx +101 -29
- package/src/builders/FlowBuilder/block.meta.ts +1 -1
- package/src/builders/FlowBuilder/connections.ts +30 -12
- package/src/builders/FlowBuilder/examples/ControlledGraph.tsx +8 -0
- package/src/builders/FlowBuilder/graph-state.ts +78 -0
- package/src/builders/LogViewer/LogViewer.labels.test.tsx +90 -0
- package/src/builders/LogViewer/LogViewer.levels.test.tsx +49 -0
- package/src/builders/LogViewer/LogViewer.tsx +72 -18
- package/src/builders/LogViewer/LogViewer.wrap.test.tsx +181 -0
- package/src/builders/LogViewer/block.meta.ts +19 -1
- package/src/builders/LogViewer/examples/Spanish.tsx +30 -0
- package/src/builders/LogViewer/examples/Wrap.tsx +62 -0
- package/src/builders/LogViewer/use-wrapped-log-rows.ts +42 -0
- package/src/data-display/ChartCard/ChartCard.locale.test.tsx +15 -0
- package/src/data-display/ChartCard/ChartCard.test.tsx +9 -0
- package/src/data-display/ChartCard/ChartCard.tsx +81 -67
- package/src/data-display/ChartCard/block.meta.ts +1 -1
- package/src/data-display/DescriptionListCard/DescriptionListCard.labels.test.tsx +73 -0
- package/src/data-display/DescriptionListCard/DescriptionListCard.options.test.tsx +64 -0
- package/src/data-display/DescriptionListCard/DescriptionListCard.tsx +74 -23
- package/src/data-display/DescriptionListCard/block.meta.ts +11 -1
- package/src/data-display/DescriptionListCard/examples/Spanish.tsx +29 -0
- package/src/feedback/EmptyStates/EmptyStates.labels.test.tsx +185 -0
- package/src/feedback/EmptyStates/EmptyStates.tsx +101 -30
- package/src/feedback/EmptyStates/NoAccessEmpty.options.test.tsx +38 -0
- package/src/feedback/EmptyStates/block.meta.ts +73 -1
- package/src/feedback/EmptyStates/examples/Spanish.tsx +48 -0
- package/src/feedback/ErrorPanel/ErrorPanel.labels.test.tsx +99 -0
- package/src/feedback/ErrorPanel/ErrorPanel.tsx +38 -9
- package/src/feedback/ErrorPanel/block.meta.ts +19 -1
- package/src/feedback/ErrorPanel/examples/Spanish.tsx +30 -0
- package/src/feedback/InlineCallout/InlineCallout.labels.test.tsx +62 -0
- package/src/feedback/InlineCallout/InlineCallout.tsx +22 -9
- package/src/feedback/InlineCallout/block.meta.ts +9 -1
- package/src/feedback/InlineCallout/examples/Spanish.tsx +19 -0
- package/src/feedback/Skeletons/Skeletons.labels.test.tsx +24 -0
- package/src/forms/CreateApiKeyDialog/CreateApiKeyDialog.labels.test.tsx +115 -0
- package/src/forms/CreateApiKeyDialog/CreateApiKeyDialog.tsx +63 -21
- package/src/forms/CreateApiKeyDialog/block.meta.ts +22 -1
- package/src/forms/CreateApiKeyDialog/examples/Labels.tsx +29 -0
- package/src/forms/CredentialDisclosureDialog/CredentialDisclosureDialog.labels.test.tsx +165 -0
- package/src/forms/CredentialDisclosureDialog/CredentialDisclosureDialog.tsx +31 -8
- package/src/forms/CredentialDisclosureDialog/SecretCopy.tsx +16 -8
- package/src/forms/CredentialDisclosureDialog/block.meta.ts +19 -1
- package/src/forms/CredentialDisclosureDialog/examples/Labels.tsx +38 -0
- package/src/forms/DangerZone/ConfirmDestructiveDialog.tsx +17 -3
- package/src/forms/DangerZone/DangerZone.labels.test.tsx +87 -0
- package/src/forms/DangerZone/DangerZone.tsx +20 -5
- package/src/forms/DangerZone/block.meta.ts +10 -1
- package/src/forms/DangerZone/examples/Labels.tsx +29 -0
- package/src/forms/DateRangeFilter/DateRangeFilter.labels.test.tsx +52 -0
- package/src/forms/DateRangeFilter/DateRangeFilter.tsx +11 -3
- package/src/forms/DateRangeFilter/block.meta.ts +8 -1
- package/src/forms/DateRangeFilter/examples/Labels.tsx +28 -0
- package/src/forms/DialogWizard/DialogWizard.labels.test.tsx +37 -0
- package/src/forms/DialogWizard/DialogWizard.tsx +13 -2
- package/src/forms/DialogWizard/block.meta.ts +7 -1
- package/src/forms/DialogWizard/examples/Labels.tsx +39 -0
- package/src/forms/FileUploadPanel/FileUploadPanel.labels.test.tsx +126 -0
- package/src/forms/FileUploadPanel/FileUploadPanel.test.tsx +22 -1
- package/src/forms/FileUploadPanel/FileUploadPanel.tsx +85 -22
- package/src/forms/FileUploadPanel/block.meta.ts +22 -1
- package/src/forms/FileUploadPanel/examples/Labels.tsx +29 -0
- package/src/forms/FileUploadPanel/fixtures.ts +0 -12
- package/src/forms/FileUploadPanel/format-bytes.test.ts +8 -0
- package/src/forms/FormSection/FormSection.labels.test.tsx +37 -0
- package/src/forms/FormSection/FormSection.tsx +14 -3
- package/src/forms/FormSection/block.meta.ts +7 -1
- package/src/forms/FormSection/examples/Labels.tsx +27 -0
- package/src/forms/InviteMembersDialog/InviteMembersDialog.labels.test.tsx +87 -0
- package/src/forms/InviteMembersDialog/InviteMembersDialog.tsx +51 -16
- package/src/forms/InviteMembersDialog/block.meta.ts +20 -1
- package/src/forms/InviteMembersDialog/examples/Labels.tsx +28 -0
- package/src/forms/SettingsRow/SettingsRow.labels.test.tsx +33 -0
- package/src/forms/SettingsRow/SettingsRow.tsx +14 -3
- package/src/forms/SettingsRow/block.meta.ts +7 -1
- package/src/forms/SettingsRow/examples/Labels.tsx +27 -0
- package/src/forms/ValidationSummary/ValidationSummary.labels.test.tsx +47 -0
- package/src/forms/ValidationSummary/ValidationSummary.tsx +9 -3
- package/src/forms/ValidationSummary/block.meta.ts +6 -1
- package/src/forms/ValidationSummary/examples/Labels.tsx +24 -0
- package/src/forms/index.ts +5 -1
- package/src/forms/translated-content.tsx +12 -0
- package/src/page-chrome/PageHeader/PageHeader.labels.test.tsx +56 -0
- package/src/page-chrome/PageHeader/PageHeader.options.test.tsx +34 -0
- package/src/page-chrome/PageHeader/PageHeader.tsx +26 -5
- package/src/page-chrome/PageHeader/block.meta.ts +8 -1
- package/src/page-chrome/PageHeader/examples/Labels.tsx +16 -0
- package/src/page-chrome/PageHeader/examples/Spanish.tsx +11 -0
- package/src/scheduling/AgendaList/AgendaList.test.tsx +25 -0
- package/src/scheduling/AgendaList/AgendaList.tsx +7 -2
- package/src/scheduling/AgendaList/AgendaListLocale.test.tsx +11 -0
- package/src/scheduling/AgendaList/block.meta.ts +1 -1
- package/src/scheduling/AgendaList/examples/Locale.tsx +29 -0
- package/src/scheduling/MonthCalendar/MonthCalendar.test.tsx +111 -1
- package/src/scheduling/MonthCalendar/MonthCalendar.tsx +19 -9
- package/src/scheduling/MonthCalendar/block.meta.ts +1 -1
- package/src/scheduling/MonthCalendar/examples/Locale.tsx +19 -0
- package/src/scheduling/WeekCalendar/WeekCalendar.test.tsx +73 -2
- package/src/scheduling/WeekCalendar/WeekCalendar.tsx +26 -12
- package/src/scheduling/WeekCalendar/block.meta.ts +1 -1
- package/src/scheduling/WeekCalendar/examples/Locale.tsx +19 -0
- package/src/scheduling/shared/dates.test.ts +75 -0
- package/src/scheduling/shared/dates.ts +46 -22
- package/src/scheduling/shared/useSchedulingClock.ts +13 -0
- package/src/shell/GlobalSearch/GlobalSearch.test.tsx +12 -0
- package/src/shell/GlobalSearch/fixtures.ts +2 -2
- package/src/tables/DataTable/DataTable.cross-page-selection.test.tsx +322 -0
- package/src/tables/DataTable/DataTable.labels.test.tsx +74 -0
- package/src/tables/DataTable/DataTable.server-pagination.test.tsx +1 -1
- package/src/tables/DataTable/DataTable.single-select.test.tsx +47 -7
- package/src/tables/DataTable/DataTable.test.tsx +55 -0
- package/src/tables/DataTable/DataTable.tsx +134 -67
- package/src/tables/DataTable/block.meta.ts +21 -3
- package/src/tables/DataTable/data-table-props.ts +14 -5
- package/src/tables/DataTable/data-table-row.tsx +7 -3
- package/src/tables/DataTable/data-table-utils.ts +2 -0
- package/src/tables/DataTable/examples/client-selection.tsx +33 -0
- package/src/tables/DataTable/examples/paginated-single-selection.tsx +46 -0
- package/src/tables/DataTable/examples/server-pagination.tsx +55 -15
- package/src/tables/DataTable/labels.ts +4 -0
- package/src/tables/DataTable/selection-strip.tsx +31 -0
- package/src/tables/DataTable/single-selection.tsx +0 -7
- package/src/tables/DataTable/use-multiple-selection.ts +86 -0
- package/src/tables/PaginationFooter/PaginationFooter.i18n.test.tsx +26 -0
- package/src/test/OptInDefaults.test.tsx +27 -0
- package/src/test/fixtures/opt-in-defaults.json +10 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { I18nProvider, es } from '@gntik-ai/ui';
|
|
4
|
+
import {
|
|
5
|
+
FirstRunEmpty,
|
|
6
|
+
NoResultsEmpty,
|
|
7
|
+
NoAccessEmpty,
|
|
8
|
+
NotFoundEmpty,
|
|
9
|
+
type FirstRunEmptyLabels,
|
|
10
|
+
type NoResultsEmptyLabels,
|
|
11
|
+
type NoAccessEmptyLabels,
|
|
12
|
+
} from './EmptyStates';
|
|
13
|
+
import { firstRunSteps, notFoundSample } from './fixtures';
|
|
14
|
+
|
|
15
|
+
it('localizes first-run defaults and retains imported first-run and not-found fixtures', () => {
|
|
16
|
+
render(
|
|
17
|
+
<I18nProvider locale="es">
|
|
18
|
+
<FirstRunEmpty />
|
|
19
|
+
<NotFoundEmpty />
|
|
20
|
+
</I18nProvider>,
|
|
21
|
+
);
|
|
22
|
+
expect(screen.getByRole('heading', { name: es['emptyState.firstRun.title'] })).toHaveTextContent(
|
|
23
|
+
'Crea tu primer proyecto',
|
|
24
|
+
);
|
|
25
|
+
expect(screen.getByText(es['emptyState.firstRun.description'])).toBeVisible();
|
|
26
|
+
expect(screen.getByRole('button', { name: es['emptyState.firstRun.action'] })).toBeVisible();
|
|
27
|
+
expect(screen.getByRole('link', { name: es['emptyState.firstRun.guide'] })).toHaveAttribute('href', '#guide');
|
|
28
|
+
for (const step of firstRunSteps) expect(screen.getByText(step)).toBeVisible();
|
|
29
|
+
expect(screen.getByRole('heading', { name: notFoundSample.title })).toBeVisible();
|
|
30
|
+
expect(screen.getByText(notFoundSample.description)).toBeVisible();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('preserves first-run English and merges labels below explicit props', () => {
|
|
34
|
+
const { rerender } = render(<FirstRunEmpty />);
|
|
35
|
+
expect(screen.getByRole('heading', { name: 'Create your first project' })).toBeVisible();
|
|
36
|
+
expect(
|
|
37
|
+
screen.getByText(
|
|
38
|
+
'Projects group your services, environments and deployments. Start one from a repository in a couple of minutes.',
|
|
39
|
+
),
|
|
40
|
+
).toBeVisible();
|
|
41
|
+
expect(screen.getByRole('button', { name: 'New project' })).toBeVisible();
|
|
42
|
+
expect(screen.getByRole('link', { name: 'Read the guide' })).toBeVisible();
|
|
43
|
+
const labels: FirstRunEmptyLabels = {
|
|
44
|
+
title: 'Title override',
|
|
45
|
+
description: 'Description override',
|
|
46
|
+
action: 'Action override',
|
|
47
|
+
guide: 'Guide override',
|
|
48
|
+
};
|
|
49
|
+
const view = (overrides: Partial<FirstRunEmptyLabels>, explicit = false) => (
|
|
50
|
+
<I18nProvider locale="es">
|
|
51
|
+
<FirstRunEmpty
|
|
52
|
+
labels={overrides}
|
|
53
|
+
title={explicit ? 'Explicit title' : undefined}
|
|
54
|
+
description={explicit ? 'Explicit description' : undefined}
|
|
55
|
+
actionLabel={explicit ? 'Explicit action' : undefined}
|
|
56
|
+
secondary={explicit ? { label: 'Explicit guide', href: '#explicit' } : undefined}
|
|
57
|
+
/>
|
|
58
|
+
</I18nProvider>
|
|
59
|
+
);
|
|
60
|
+
rerender(view(labels));
|
|
61
|
+
expect(screen.getByRole('heading', { name: labels.title })).toBeVisible();
|
|
62
|
+
expect(screen.getByText(labels.description)).toBeVisible();
|
|
63
|
+
expect(screen.getByRole('button', { name: labels.action })).toBeVisible();
|
|
64
|
+
expect(screen.getByRole('link', { name: labels.guide })).toBeVisible();
|
|
65
|
+
rerender(view(labels, true));
|
|
66
|
+
expect(screen.getByRole('heading', { name: 'Explicit title' })).toBeVisible();
|
|
67
|
+
expect(screen.getByText('Explicit description')).toBeVisible();
|
|
68
|
+
expect(screen.getByRole('button', { name: 'Explicit action' })).toBeVisible();
|
|
69
|
+
expect(screen.getByRole('link', { name: 'Explicit guide' })).toHaveAttribute('href', '#explicit');
|
|
70
|
+
rerender(view({ action: 'Only action' }));
|
|
71
|
+
expect(screen.getByRole('heading', { name: es['emptyState.firstRun.title'] })).toBeVisible();
|
|
72
|
+
expect(screen.getByText(es['emptyState.firstRun.description'])).toBeVisible();
|
|
73
|
+
expect(screen.getByRole('link', { name: es['emptyState.firstRun.guide'] })).toBeVisible();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it.each([
|
|
77
|
+
[0, 'Revisa la ortografía o prueba una búsqueda más amplia.'],
|
|
78
|
+
[1, 'Revisa la ortografía o prueba una búsqueda más amplia con 1 filtro aplicado.'],
|
|
79
|
+
[2, 'Revisa la ortografía o prueba una búsqueda más amplia con 2 filtros aplicados.'],
|
|
80
|
+
])('localizes no-results with %i filters and keeps the query in its mono span', (filterCount, description) => {
|
|
81
|
+
const { container, rerender } = render(
|
|
82
|
+
<I18nProvider locale="es">
|
|
83
|
+
<NoResultsEmpty filterCount={filterCount} />
|
|
84
|
+
</I18nProvider>,
|
|
85
|
+
);
|
|
86
|
+
const heading = screen.getByRole('heading', { name: 'No hay projects que coincidan con “billing-api”' });
|
|
87
|
+
expect(heading.querySelector('span.font-mono')).toHaveTextContent('billing-api');
|
|
88
|
+
expect(screen.getByText(description)).toBeVisible();
|
|
89
|
+
if (filterCount > 0)
|
|
90
|
+
expect(screen.getByRole('button', { name: es['emptyState.noResults.clearFilters'] })).toBeVisible();
|
|
91
|
+
expect(screen.getByRole('button', { name: es['emptyState.noResults.clearSearch'] })).toBeVisible();
|
|
92
|
+
expect(container.textContent).not.toContain('{');
|
|
93
|
+
rerender(
|
|
94
|
+
<I18nProvider locale="es">
|
|
95
|
+
<NoResultsEmpty query="" filterCount={filterCount} />
|
|
96
|
+
</I18nProvider>,
|
|
97
|
+
);
|
|
98
|
+
expect(screen.getByRole('heading', { name: 'No se encontraron projects' })).toBeVisible();
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it('preserves English no-results markup and all per-key formatter overrides', () => {
|
|
102
|
+
const { rerender } = render(<NoResultsEmpty filterCount={1} />);
|
|
103
|
+
const heading = screen.getByRole('heading', { name: 'No projects match “billing-api”' });
|
|
104
|
+
expect(heading.innerHTML).toBe('No projects match “<span class="font-mono">billing-api</span>”');
|
|
105
|
+
expect(screen.getByText('Check the spelling or try a broader search with 1 filter applied.')).toBeVisible();
|
|
106
|
+
expect(screen.getByRole('button', { name: 'Clear filters' })).toBeVisible();
|
|
107
|
+
expect(screen.getByRole('button', { name: 'Clear search' })).toBeVisible();
|
|
108
|
+
rerender(<NoResultsEmpty query="" filterCount={2} />);
|
|
109
|
+
expect(screen.getByRole('heading', { name: 'No projects found' })).toBeVisible();
|
|
110
|
+
expect(screen.getByText('Check the spelling or try a broader search with 2 filters applied.')).toBeVisible();
|
|
111
|
+
const labels: NoResultsEmptyLabels = {
|
|
112
|
+
queryTitle: (entity, query) => `Query override ${entity}: ${query}`,
|
|
113
|
+
title: (entity) => `Title override ${entity}`,
|
|
114
|
+
description: (count) => `Description override ${count}`,
|
|
115
|
+
clearFilters: 'Filters override',
|
|
116
|
+
clearSearch: 'Search override',
|
|
117
|
+
};
|
|
118
|
+
const view = (overrides: Partial<NoResultsEmptyLabels>, query = 'billing-api') => (
|
|
119
|
+
<I18nProvider locale="es">
|
|
120
|
+
<NoResultsEmpty labels={overrides} query={query} />
|
|
121
|
+
</I18nProvider>
|
|
122
|
+
);
|
|
123
|
+
rerender(view(labels));
|
|
124
|
+
expect(screen.getByRole('heading', { name: 'Query override projects: billing-api' })).toBeVisible();
|
|
125
|
+
expect(screen.getByText('Description override 2')).toBeVisible();
|
|
126
|
+
expect(screen.getByRole('button', { name: labels.clearFilters })).toBeVisible();
|
|
127
|
+
expect(screen.getByRole('button', { name: labels.clearSearch })).toBeVisible();
|
|
128
|
+
rerender(view(labels, ''));
|
|
129
|
+
expect(screen.getByRole('heading', { name: 'Title override projects' })).toBeVisible();
|
|
130
|
+
rerender(view({ clearSearch: 'Only search' }));
|
|
131
|
+
expect(screen.getByRole('heading', { name: 'No hay projects que coincidan con “billing-api”' })).toBeVisible();
|
|
132
|
+
expect(
|
|
133
|
+
screen.getByText('Revisa la ortografía o prueba una búsqueda más amplia con 2 filtros aplicados.'),
|
|
134
|
+
).toBeVisible();
|
|
135
|
+
expect(screen.getByRole('button', { name: es['emptyState.noResults.clearFilters'] })).toBeVisible();
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('localizes access messages around unchanged sample resource and owner, including requested state', async () => {
|
|
139
|
+
const user = userEvent.setup();
|
|
140
|
+
render(
|
|
141
|
+
<I18nProvider locale="es">
|
|
142
|
+
<NoAccessEmpty />
|
|
143
|
+
</I18nProvider>,
|
|
144
|
+
);
|
|
145
|
+
expect(screen.getByRole('heading', { name: 'No tienes acceso a Billing' })).toBeVisible();
|
|
146
|
+
expect(screen.getByText('Pide a an organization admin que te asigne un rol con permisos de billing.')).toBeVisible();
|
|
147
|
+
await user.click(screen.getByRole('button', { name: es['emptyState.noAccess.request'] }));
|
|
148
|
+
expect(screen.getByRole('button', { name: es['emptyState.noAccess.requested'] })).toBeDisabled();
|
|
149
|
+
expect(screen.getByRole('status')).toHaveTextContent(es['emptyState.noAccess.sent']);
|
|
150
|
+
expect(document.body.textContent).not.toContain('{');
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('keeps English access messages and renders each access override verbatim with catalog fallback', async () => {
|
|
154
|
+
const user = userEvent.setup();
|
|
155
|
+
const { rerender } = render(<NoAccessEmpty />);
|
|
156
|
+
expect(screen.getByRole('heading', { name: 'You don’t have access to Billing' })).toBeVisible();
|
|
157
|
+
expect(
|
|
158
|
+
screen.getByText('Ask an organization admin to grant you a role that includes billing permissions.'),
|
|
159
|
+
).toBeVisible();
|
|
160
|
+
await user.click(screen.getByRole('button', { name: 'Request access' }));
|
|
161
|
+
expect(screen.getByRole('button', { name: 'Access requested' })).toBeDisabled();
|
|
162
|
+
expect(screen.getByRole('status')).toHaveTextContent('Access request sent');
|
|
163
|
+
const labels: NoAccessEmptyLabels = {
|
|
164
|
+
title: (resource) => `Title override ${resource}`,
|
|
165
|
+
description: (resource, owner) => `Description override ${resource}: ${owner}`,
|
|
166
|
+
request: 'Request override',
|
|
167
|
+
requested: 'Requested override',
|
|
168
|
+
sent: 'Sent override',
|
|
169
|
+
};
|
|
170
|
+
const view = (overrides: Partial<NoAccessEmptyLabels>) => (
|
|
171
|
+
<I18nProvider locale="es">
|
|
172
|
+
<NoAccessEmpty labels={overrides} />
|
|
173
|
+
</I18nProvider>
|
|
174
|
+
);
|
|
175
|
+
rerender(view(labels));
|
|
176
|
+
expect(screen.getByRole('heading', { name: 'Title override Billing' })).toBeVisible();
|
|
177
|
+
expect(screen.getByText('Description override Billing: an organization admin')).toBeVisible();
|
|
178
|
+
await user.click(screen.getByRole('button', { name: labels.request }));
|
|
179
|
+
expect(screen.getByRole('button', { name: labels.requested })).toBeDisabled();
|
|
180
|
+
expect(screen.getByRole('status')).toHaveTextContent(labels.sent);
|
|
181
|
+
rerender(view({ title: (resource) => `Only title ${resource}` }));
|
|
182
|
+
expect(screen.getByText('Pide a an organization admin que te asigne un rol con permisos de billing.')).toBeVisible();
|
|
183
|
+
expect(screen.getByRole('button', { name: es['emptyState.noAccess.requested'] })).toBeDisabled();
|
|
184
|
+
expect(screen.getByRole('status')).toHaveTextContent(es['emptyState.noAccess.sent']);
|
|
185
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Check, FolderPlus, Lock, SearchX } from '@gntik-ai/icons';
|
|
2
2
|
import type { LucideIcon } from '@gntik-ai/icons';
|
|
3
|
-
import { Button, EmptyState, Link, cn } from '@gntik-ai/ui';
|
|
3
|
+
import { Button, EmptyState, Link, cn, useI18n } from '@gntik-ai/ui';
|
|
4
4
|
import { useState, type ReactNode } from 'react';
|
|
5
5
|
import { firstRunSteps, noAccessSample, noResultsSample, notFoundSample } from './fixtures';
|
|
6
6
|
|
|
@@ -42,7 +42,16 @@ export function NotFoundEmpty({
|
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
export interface FirstRunEmptyLabels {
|
|
46
|
+
title: string;
|
|
47
|
+
description: string;
|
|
48
|
+
action: string;
|
|
49
|
+
guide: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
45
52
|
export interface FirstRunEmptyProps extends SharedEmptyProps {
|
|
53
|
+
/** Per-key copy overrides; explicit props take precedence over labels and catalog defaults. */
|
|
54
|
+
labels?: Partial<FirstRunEmptyLabels>;
|
|
46
55
|
icon?: LucideIcon;
|
|
47
56
|
title?: ReactNode;
|
|
48
57
|
description?: ReactNode;
|
|
@@ -57,16 +66,26 @@ export interface FirstRunEmptyProps extends SharedEmptyProps {
|
|
|
57
66
|
/** First-run state: nothing created yet; explains the value and offers the first action. */
|
|
58
67
|
export function FirstRunEmpty({
|
|
59
68
|
icon = FolderPlus,
|
|
60
|
-
title
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
title: titleProp,
|
|
70
|
+
labels,
|
|
71
|
+
description: descriptionProp,
|
|
72
|
+
actionLabel: actionLabelProp,
|
|
63
73
|
onAction,
|
|
64
|
-
secondary
|
|
74
|
+
secondary: secondaryProp,
|
|
65
75
|
steps = firstRunSteps,
|
|
66
76
|
titleAs,
|
|
67
77
|
bordered = true,
|
|
68
78
|
className,
|
|
69
79
|
}: FirstRunEmptyProps) {
|
|
80
|
+
const { t } = useI18n();
|
|
81
|
+
const title = titleProp === undefined ? (labels?.title ?? t('emptyState.firstRun.title')) : titleProp;
|
|
82
|
+
const description =
|
|
83
|
+
descriptionProp === undefined ? (labels?.description ?? t('emptyState.firstRun.description')) : descriptionProp;
|
|
84
|
+
const actionLabel = actionLabelProp ?? labels?.action ?? t('emptyState.firstRun.action');
|
|
85
|
+
const secondary =
|
|
86
|
+
secondaryProp === undefined
|
|
87
|
+
? { label: labels?.guide ?? t('emptyState.firstRun.guide'), href: '#guide' }
|
|
88
|
+
: secondaryProp;
|
|
70
89
|
return (
|
|
71
90
|
<EmptyState
|
|
72
91
|
icon={icon}
|
|
@@ -104,7 +123,18 @@ export function FirstRunEmpty({
|
|
|
104
123
|
);
|
|
105
124
|
}
|
|
106
125
|
|
|
126
|
+
export interface NoResultsEmptyLabels {
|
|
127
|
+
/** Replaces the complete query heading; catalog defaults retain the query’s monospace span. */
|
|
128
|
+
queryTitle: (entity: string, query: string) => string;
|
|
129
|
+
title: (entity: string) => string;
|
|
130
|
+
description: (filterCount: number) => string;
|
|
131
|
+
clearFilters: string;
|
|
132
|
+
clearSearch: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
107
135
|
export interface NoResultsEmptyProps extends SharedEmptyProps {
|
|
136
|
+
/** Per-key overrides; formatter arguments are caller data and results render verbatim. */
|
|
137
|
+
labels?: Partial<NoResultsEmptyLabels>;
|
|
108
138
|
/** The search text that matched nothing. */
|
|
109
139
|
query?: string;
|
|
110
140
|
/** Number of active filters (shows "Clear filters" when > 0). */
|
|
@@ -118,6 +148,7 @@ export interface NoResultsEmptyProps extends SharedEmptyProps {
|
|
|
118
148
|
/** No-results state for a filtered list or table: echoes the query and offers ways out. */
|
|
119
149
|
export function NoResultsEmpty({
|
|
120
150
|
query = noResultsSample.query,
|
|
151
|
+
labels,
|
|
121
152
|
filterCount = noResultsSample.filterCount,
|
|
122
153
|
entity = noResultsSample.entity,
|
|
123
154
|
onClearFilters,
|
|
@@ -126,7 +157,7 @@ export function NoResultsEmpty({
|
|
|
126
157
|
bordered = false,
|
|
127
158
|
className,
|
|
128
159
|
}: NoResultsEmptyProps) {
|
|
129
|
-
const
|
|
160
|
+
const { t } = useI18n();
|
|
130
161
|
return (
|
|
131
162
|
<EmptyState
|
|
132
163
|
icon={SearchX}
|
|
@@ -135,26 +166,31 @@ export function NoResultsEmpty({
|
|
|
135
166
|
bordered={bordered}
|
|
136
167
|
className={cn('mx-auto', className)}
|
|
137
168
|
title={
|
|
138
|
-
query
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
169
|
+
query
|
|
170
|
+
? (labels?.queryTitle?.(entity, query) ?? (
|
|
171
|
+
<>
|
|
172
|
+
{t('emptyState.noResults.queryTitleBefore', { entity })}
|
|
173
|
+
<span className="font-mono">{query}</span>
|
|
174
|
+
{t('emptyState.noResults.queryTitleAfter')}
|
|
175
|
+
</>
|
|
176
|
+
))
|
|
177
|
+
: (labels?.title?.(entity) ?? t('emptyState.noResults.title', { entity }))
|
|
178
|
+
}
|
|
179
|
+
description={
|
|
180
|
+
labels?.description?.(filterCount) ??
|
|
181
|
+
t('emptyState.noResults.description', { count: filterCount > 0 ? filterCount : 0 })
|
|
145
182
|
}
|
|
146
|
-
description={`Check the spelling or try a broader search${filters}.`}
|
|
147
183
|
primaryAction={
|
|
148
184
|
filterCount > 0 ? (
|
|
149
185
|
<Button variant="secondary" size="sm" onClick={onClearFilters}>
|
|
150
|
-
|
|
186
|
+
{labels?.clearFilters ?? t('emptyState.noResults.clearFilters')}
|
|
151
187
|
</Button>
|
|
152
188
|
) : undefined
|
|
153
189
|
}
|
|
154
190
|
secondaryAction={
|
|
155
191
|
query ? (
|
|
156
192
|
<Button variant="ghost" size="sm" onClick={onClearSearch}>
|
|
157
|
-
|
|
193
|
+
{labels?.clearSearch ?? t('emptyState.noResults.clearSearch')}
|
|
158
194
|
</Button>
|
|
159
195
|
) : undefined
|
|
160
196
|
}
|
|
@@ -162,13 +198,27 @@ export function NoResultsEmpty({
|
|
|
162
198
|
);
|
|
163
199
|
}
|
|
164
200
|
|
|
201
|
+
export interface NoAccessEmptyLabels {
|
|
202
|
+
title: (resource: string) => string;
|
|
203
|
+
description: (resource: string, owner: string) => string;
|
|
204
|
+
request: string;
|
|
205
|
+
requested: string;
|
|
206
|
+
sent: string;
|
|
207
|
+
}
|
|
208
|
+
|
|
165
209
|
export interface NoAccessEmptyProps extends SharedEmptyProps {
|
|
210
|
+
/** Per-key overrides; formatters receive the original resource and owner, without translation. */
|
|
211
|
+
labels?: Partial<NoAccessEmptyLabels>;
|
|
166
212
|
/** What the viewer cannot see. */
|
|
167
213
|
resource?: string;
|
|
168
214
|
/** Who can grant access. */
|
|
169
215
|
owner?: string;
|
|
170
216
|
/** Called on "Request access"; may return a promise (the button shows a spinner). */
|
|
171
217
|
onRequestAccess?: () => void | Promise<void>;
|
|
218
|
+
/** Show the request button and its status announcement (default true). */
|
|
219
|
+
showRequestAccess?: boolean;
|
|
220
|
+
/** One href link; secondary to the request button, or primary when the button is hidden. */
|
|
221
|
+
action?: { label: string; href: string };
|
|
172
222
|
/** Start in the "requested" state (e.g. a pending request exists). */
|
|
173
223
|
defaultRequested?: boolean;
|
|
174
224
|
}
|
|
@@ -176,13 +226,17 @@ export interface NoAccessEmptyProps extends SharedEmptyProps {
|
|
|
176
226
|
/** Permission state: the viewer lacks access; explains who can grant it and lets them ask. */
|
|
177
227
|
export function NoAccessEmpty({
|
|
178
228
|
resource = noAccessSample.resource,
|
|
229
|
+
labels,
|
|
179
230
|
owner = noAccessSample.owner,
|
|
180
231
|
onRequestAccess,
|
|
232
|
+
showRequestAccess = true,
|
|
233
|
+
action,
|
|
181
234
|
defaultRequested = false,
|
|
182
235
|
titleAs,
|
|
183
236
|
bordered = true,
|
|
184
237
|
className,
|
|
185
238
|
}: NoAccessEmptyProps) {
|
|
239
|
+
const { t } = useI18n();
|
|
186
240
|
const [state, setState] = useState<'idle' | 'pending' | 'requested'>(defaultRequested ? 'requested' : 'idle');
|
|
187
241
|
const request = async () => {
|
|
188
242
|
setState('pending');
|
|
@@ -193,29 +247,46 @@ export function NoAccessEmpty({
|
|
|
193
247
|
setState('idle');
|
|
194
248
|
}
|
|
195
249
|
};
|
|
250
|
+
const actionLink = action ? (
|
|
251
|
+
<Link underline="hover" href={action.href} className="inline-flex h-9 items-center px-2 text-[13px] font-semibold">
|
|
252
|
+
{action.label}
|
|
253
|
+
</Link>
|
|
254
|
+
) : undefined;
|
|
196
255
|
return (
|
|
197
256
|
<EmptyState
|
|
198
257
|
icon={Lock}
|
|
199
258
|
titleAs={titleAs}
|
|
200
259
|
bordered={bordered}
|
|
201
260
|
className={cn('mx-auto', className)}
|
|
202
|
-
title={
|
|
203
|
-
description={
|
|
261
|
+
title={labels?.title?.(resource) ?? t('emptyState.noAccess.title', { resource })}
|
|
262
|
+
description={
|
|
263
|
+
labels?.description?.(resource, owner) ??
|
|
264
|
+
t('emptyState.noAccess.description', { resource: resource.toLowerCase(), owner })
|
|
265
|
+
}
|
|
204
266
|
primaryAction={
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
267
|
+
showRequestAccess ? (
|
|
268
|
+
<Button
|
|
269
|
+
variant={state === 'requested' ? 'secondary' : 'primary'}
|
|
270
|
+
icon={state === 'requested' ? Check : undefined}
|
|
271
|
+
loading={state === 'pending'}
|
|
272
|
+
disabled={state === 'requested'}
|
|
273
|
+
onClick={() => void request()}
|
|
274
|
+
>
|
|
275
|
+
{state === 'requested'
|
|
276
|
+
? (labels?.requested ?? t('emptyState.noAccess.requested'))
|
|
277
|
+
: (labels?.request ?? t('emptyState.noAccess.request'))}
|
|
278
|
+
</Button>
|
|
279
|
+
) : (
|
|
280
|
+
actionLink
|
|
281
|
+
)
|
|
214
282
|
}
|
|
283
|
+
secondaryAction={showRequestAccess ? actionLink : undefined}
|
|
215
284
|
>
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
285
|
+
{showRequestAccess && (
|
|
286
|
+
<p role="status" className="sr-only">
|
|
287
|
+
{state === 'requested' ? (labels?.sent ?? t('emptyState.noAccess.sent')) : ''}
|
|
288
|
+
</p>
|
|
289
|
+
)}
|
|
219
290
|
</EmptyState>
|
|
220
291
|
);
|
|
221
292
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { expectNoAxeViolations } from '../../test/a11y';
|
|
3
|
+
import { FirstRunEmpty, NoAccessEmpty } from './EmptyStates';
|
|
4
|
+
|
|
5
|
+
it.each([false, true])('omits all actions and status when hidden (defaultRequested=%s)', async (defaultRequested) => {
|
|
6
|
+
const { container } = render(<NoAccessEmpty showRequestAccess={false} defaultRequested={defaultRequested} />);
|
|
7
|
+
expect(screen.queryByRole('button')).toBeNull();
|
|
8
|
+
expect(screen.queryByRole('link')).toBeNull();
|
|
9
|
+
expect(screen.queryByRole('status')).toBeNull();
|
|
10
|
+
expect(container.querySelector('h3 + p + div')).toBeNull();
|
|
11
|
+
expect(container).not.toHaveTextContent('Access request sent');
|
|
12
|
+
await expectNoAxeViolations(container);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it.each([false, true])(
|
|
16
|
+
'offers one href action in the right position (showRequestAccess=%s)',
|
|
17
|
+
async (showRequestAccess) => {
|
|
18
|
+
const action = { label: 'Volver al resumen', href: '/x' };
|
|
19
|
+
const { container, rerender } = render(<FirstRunEmpty secondary={action} />);
|
|
20
|
+
const referenceClassName = screen.getByRole('link', { name: action.label }).className;
|
|
21
|
+
rerender(<NoAccessEmpty action={action} showRequestAccess={showRequestAccess} />);
|
|
22
|
+
const link = screen.getByRole('link', { name: action.label });
|
|
23
|
+
expect(screen.getAllByRole('link')).toHaveLength(1);
|
|
24
|
+
expect(link).toHaveAttribute('href', '/x');
|
|
25
|
+
expect(link.className).toBe(referenceClassName);
|
|
26
|
+
expect(link.parentElement?.parentElement).toBe(container.firstElementChild);
|
|
27
|
+
if (showRequestAccess) {
|
|
28
|
+
const button = screen.getByRole('button', { name: 'Request access' });
|
|
29
|
+
expect(screen.getAllByRole('button')).toHaveLength(1);
|
|
30
|
+
expect(Array.from(link.parentElement!.children)).toEqual([button, link]);
|
|
31
|
+
} else {
|
|
32
|
+
expect(screen.queryByRole('button')).toBeNull();
|
|
33
|
+
expect(screen.queryByRole('status')).toBeNull();
|
|
34
|
+
expect(Array.from(link.parentElement!.children)).toEqual([link]);
|
|
35
|
+
}
|
|
36
|
+
await expectNoAxeViolations(container);
|
|
37
|
+
},
|
|
38
|
+
);
|
|
@@ -5,6 +5,78 @@ export const meta: BlockMeta = {
|
|
|
5
5
|
family: 'feedback',
|
|
6
6
|
status: 'beta',
|
|
7
7
|
description:
|
|
8
|
-
'Four canonical empty states: first run (with checklist), no results (clear filters/search), no access (request access) and not found (optional action).',
|
|
8
|
+
'Four canonical empty states: first run (with checklist), no results (clear filters/search), no access (request access) and not found (optional action). FirstRunEmpty, NoResultsEmpty and NoAccessEmpty accept labels?: Partial<FirstRunEmptyLabels>, Partial<NoResultsEmptyLabels> and Partial<NoAccessEmptyLabels> respectively. Each type has its own keys below; explicit title, description, actionLabel and secondary props win. Defaults follow I18nProvider (en/es). NoResultsEmpty keeps the query in a mono span unless queryTitle replaces the heading. NotFoundEmpty and all imported fixtures stay English. See the Catalog labels live preview. NoAccessEmpty accepts showRequestAccess?: boolean (default true): false hides both the request button and its status announcement, so defaultRequested has no visible effect. action?: { label: string; href: string } renders one kit Link, styled like FirstRunEmpty’s secondary link; it is secondaryAction after the request button, or primaryAction when showRequestAccess is false. With showRequestAccess=false and no action, it renders no actions. Omitting onRequestAccess still shows the button by default. See the Spanish live preview for no actions, a link alone, and a link with the request button.',
|
|
9
|
+
labels: [
|
|
10
|
+
{
|
|
11
|
+
key: 'FirstRunEmpty.labels.title',
|
|
12
|
+
type: 'string',
|
|
13
|
+
state: 'FirstRunEmpty: per-key override; formatters receive original data. Explicit props win.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
key: 'FirstRunEmpty.labels.description',
|
|
17
|
+
type: 'string',
|
|
18
|
+
state: 'FirstRunEmpty: per-key override; formatters receive original data. Explicit props win.',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: 'FirstRunEmpty.labels.action',
|
|
22
|
+
type: 'string',
|
|
23
|
+
state: 'FirstRunEmpty: per-key override; formatters receive original data. Explicit props win.',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
key: 'FirstRunEmpty.labels.guide',
|
|
27
|
+
type: 'string',
|
|
28
|
+
state: 'FirstRunEmpty: per-key override; formatters receive original data. Explicit props win.',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: 'NoResultsEmpty.labels.queryTitle',
|
|
32
|
+
type: '(entity: string, query: string) => string',
|
|
33
|
+
state: 'NoResultsEmpty: per-key override; formatters receive original data. Explicit props win.',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: 'NoResultsEmpty.labels.title',
|
|
37
|
+
type: '(entity: string) => string',
|
|
38
|
+
state: 'NoResultsEmpty: per-key override; formatters receive original data. Explicit props win.',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: 'NoResultsEmpty.labels.description',
|
|
42
|
+
type: '(filterCount: number) => string',
|
|
43
|
+
state: 'NoResultsEmpty: per-key override; formatters receive original data. Explicit props win.',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
key: 'NoResultsEmpty.labels.clearFilters',
|
|
47
|
+
type: 'string',
|
|
48
|
+
state: 'NoResultsEmpty: per-key override; formatters receive original data. Explicit props win.',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
key: 'NoResultsEmpty.labels.clearSearch',
|
|
52
|
+
type: 'string',
|
|
53
|
+
state: 'NoResultsEmpty: per-key override; formatters receive original data. Explicit props win.',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: 'NoAccessEmpty.labels.title',
|
|
57
|
+
type: '(resource: string) => string',
|
|
58
|
+
state: 'NoAccessEmpty: per-key override; formatters receive original data. Explicit props win.',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
key: 'NoAccessEmpty.labels.description',
|
|
62
|
+
type: '(resource: string, owner: string) => string',
|
|
63
|
+
state: 'NoAccessEmpty: per-key override; formatters receive original data. Explicit props win.',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: 'NoAccessEmpty.labels.request',
|
|
67
|
+
type: 'string',
|
|
68
|
+
state: 'NoAccessEmpty: per-key override; formatters receive original data. Explicit props win.',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
key: 'NoAccessEmpty.labels.requested',
|
|
72
|
+
type: 'string',
|
|
73
|
+
state: 'NoAccessEmpty: per-key override; formatters receive original data. Explicit props win.',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
key: 'NoAccessEmpty.labels.sent',
|
|
77
|
+
type: 'string',
|
|
78
|
+
state: 'NoAccessEmpty: per-key override; formatters receive original data. Explicit props win.',
|
|
79
|
+
},
|
|
80
|
+
],
|
|
9
81
|
uses: ['EmptyState', 'Button', 'Link'],
|
|
10
82
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { I18nProvider, Stack } from '@gntik-ai/ui';
|
|
2
|
+
import { FirstRunEmpty, NoResultsEmpty, NoAccessEmpty } from '../EmptyStates';
|
|
3
|
+
export default function Spanish() {
|
|
4
|
+
return (
|
|
5
|
+
<I18nProvider locale="es">
|
|
6
|
+
<Stack gap={6}>
|
|
7
|
+
<FirstRunEmpty />
|
|
8
|
+
<FirstRunEmpty
|
|
9
|
+
labels={{
|
|
10
|
+
title: 'Start a project',
|
|
11
|
+
description: 'Connect your repository.',
|
|
12
|
+
action: 'Create project',
|
|
13
|
+
guide: 'Open guide',
|
|
14
|
+
}}
|
|
15
|
+
/>
|
|
16
|
+
<NoResultsEmpty filterCount={1} />
|
|
17
|
+
<NoResultsEmpty filterCount={2} />
|
|
18
|
+
<NoResultsEmpty
|
|
19
|
+
labels={{
|
|
20
|
+
queryTitle: (entity, query) => `No ${entity} for ${query}`,
|
|
21
|
+
title: (entity) => `No ${entity} yet`,
|
|
22
|
+
description: (count) => `Try removing ${count} filters.`,
|
|
23
|
+
clearFilters: 'Reset filters',
|
|
24
|
+
clearSearch: 'Reset search',
|
|
25
|
+
}}
|
|
26
|
+
/>
|
|
27
|
+
<NoResultsEmpty query="" labels={{ title: (entity) => `No ${entity} yet` }} />
|
|
28
|
+
<NoAccessEmpty />
|
|
29
|
+
<NoAccessEmpty
|
|
30
|
+
labels={{
|
|
31
|
+
title: (resource) => `Access needed: ${resource}`,
|
|
32
|
+
description: (resource, owner) => `Contact ${owner} about ${resource}.`,
|
|
33
|
+
request: 'Ask for access',
|
|
34
|
+
requested: 'Request pending',
|
|
35
|
+
sent: 'Your request was sent',
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
<NoAccessEmpty resource="Restricted settings" showRequestAccess={false} />
|
|
39
|
+
<NoAccessEmpty
|
|
40
|
+
resource="Restricted resource"
|
|
41
|
+
showRequestAccess={false}
|
|
42
|
+
action={{ label: 'Back to overview', href: '#overview' }}
|
|
43
|
+
/>
|
|
44
|
+
<NoAccessEmpty resource="Shared resource" action={{ label: 'Back to overview', href: '#overview' }} />
|
|
45
|
+
</Stack>
|
|
46
|
+
</I18nProvider>
|
|
47
|
+
);
|
|
48
|
+
}
|