@gntik-ai/blocks 0.10.0 → 0.12.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 +1761 -1231
- package/dist/index.js +3280 -1088
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/ai/PromptEditor/PromptEditor.tsx +2 -2
- package/src/ai/PromptEditor/examples/controlled-variables.tsx +1 -1
- package/src/ai/TraceWaterfall/TraceWaterfall.tsx +2 -2
- package/src/auth/ForgotPasswordForm/ForgotPasswordForm.labels.test.tsx +179 -0
- package/src/auth/ForgotPasswordForm/ForgotPasswordForm.test.tsx +6 -0
- package/src/auth/ForgotPasswordForm/ForgotPasswordForm.tsx +63 -25
- package/src/auth/ForgotPasswordForm/block.meta.ts +22 -1
- package/src/auth/ForgotPasswordForm/examples/Labels.tsx +29 -0
- package/src/auth/ForgotPasswordForm/examples/LargeFields.tsx +6 -0
- package/src/auth/MfaChallenge/MfaChallenge.labels.test.tsx +139 -0
- package/src/auth/MfaChallenge/MfaChallenge.test.tsx +9 -0
- package/src/auth/MfaChallenge/MfaChallenge.tsx +74 -25
- package/src/auth/MfaChallenge/block.meta.ts +29 -1
- package/src/auth/MfaChallenge/examples/Labels.tsx +28 -0
- package/src/auth/MfaChallenge/examples/LargeFields.tsx +6 -0
- package/src/auth/ResetPasswordForm/ResetPasswordForm.labels.test.tsx +104 -0
- package/src/auth/ResetPasswordForm/ResetPasswordForm.test.tsx +7 -0
- package/src/auth/ResetPasswordForm/ResetPasswordForm.tsx +47 -18
- package/src/auth/ResetPasswordForm/block.meta.ts +17 -1
- package/src/auth/ResetPasswordForm/examples/Labels.tsx +28 -0
- package/src/auth/ResetPasswordForm/examples/LargeFields.tsx +6 -0
- package/src/auth/SignInForm/SignInForm.labels.test.tsx +137 -0
- package/src/auth/SignInForm/SignInForm.test.tsx +7 -0
- package/src/auth/SignInForm/SignInForm.tsx +48 -17
- package/src/auth/SignInForm/block.meta.ts +22 -1
- package/src/auth/SignInForm/examples/Labels.tsx +29 -0
- package/src/auth/SignInForm/examples/LargeFields.tsx +6 -0
- package/src/auth/SignUpForm/SignUpForm.labels.test.tsx +217 -0
- package/src/auth/SignUpForm/SignUpForm.test.tsx +22 -0
- package/src/auth/SignUpForm/SignUpForm.tsx +72 -27
- package/src/auth/SignUpForm/block.meta.ts +27 -1
- package/src/auth/SignUpForm/examples/Labels.tsx +29 -0
- package/src/auth/SignUpForm/examples/LargeFields.tsx +6 -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/__snapshots__/field-size.test.tsx.snap +11 -0
- package/src/auth/field-size.test.tsx +21 -0
- package/src/auth/large-examples.test.tsx +30 -0
- package/src/auth/shared.i18n.test.tsx +71 -0
- package/src/auth/shared.tsx +55 -13
- package/src/billing/PaymentMethodCard/PaymentMethodCard.tsx +1 -1
- package/src/billing/PlanCard/PlanCard.baseline.test.tsx +3 -2
- package/src/billing/PlanCard/__snapshots__/PlanCard.baseline.test.tsx.snap +2 -2
- package/src/billing/PlanDefinitionCard/examples/Compact.tsx +1 -4
- package/src/billing/PlanDefinitionCard/examples/Full.tsx +1 -4
- package/src/builders/CodePanel/CodePanel.tsx +2 -2
- package/src/builders/FlowBuilder/FlowBuilder.tsx +4 -19
- package/src/builders/FlowBuilder/parts.tsx +4 -4
- package/src/builders/LogViewer/LogViewer.follow.test.tsx +29 -0
- package/src/builders/LogViewer/LogViewer.levels.test.tsx +49 -0
- package/src/builders/LogViewer/LogViewer.test.tsx +24 -0
- package/src/builders/LogViewer/LogViewer.tsx +96 -28
- package/src/builders/LogViewer/LogViewer.wrap.test.tsx +181 -0
- package/src/builders/LogViewer/block.meta.ts +7 -1
- package/src/builders/LogViewer/examples/Spanish.tsx +2 -1
- package/src/builders/LogViewer/examples/Wrap.tsx +62 -0
- package/src/builders/LogViewer/use-wrapped-log-rows.ts +42 -0
- package/src/data-display/ActivityFeed/ActivityFeed.tsx +1 -1
- package/src/data-display/ChartCard/ChartCard.tsx +2 -2
- package/src/data-display/ChartCard/examples/ContainerPanel.tsx +16 -0
- package/src/data-display/CommentThread/CommentThread.test.tsx +70 -1
- package/src/data-display/CommentThread/CommentThread.tsx +22 -6
- package/src/data-display/CommentThread/block.meta.ts +1 -1
- package/src/data-display/CommentThread/examples/RenderedBody.tsx +20 -0
- package/src/data-display/DescriptionListCard/DescriptionListCard.options.test.tsx +64 -0
- package/src/data-display/DescriptionListCard/DescriptionListCard.test.tsx +24 -1
- package/src/data-display/DescriptionListCard/DescriptionListCard.tsx +52 -37
- package/src/data-display/DescriptionListCard/block.meta.ts +2 -1
- package/src/data-display/DescriptionListCard/examples/Spanish.tsx +9 -1
- package/src/data-display/KpiRow/KpiRow.doc.ts +14 -0
- package/src/data-display/KpiRow/KpiRow.test.tsx +11 -0
- package/src/data-display/KpiRow/KpiRow.tsx +72 -55
- package/src/data-display/KpiRow/examples/ContainerPanel.tsx +47 -0
- package/src/data-display/ResourceCardGrid/ResourceCardGrid.doc.ts +19 -0
- package/src/data-display/ResourceCardGrid/ResourceCardGrid.test.tsx +13 -0
- package/src/data-display/ResourceCardGrid/ResourceCardGrid.tsx +49 -40
- package/src/data-display/ResourceCardGrid/examples/ContainerPanel.tsx +18 -0
- package/src/data-display/StatusTimeline/StatusTimeline.tsx +1 -1
- package/src/feedback/EmptyStates/EmptyStates.test.tsx +42 -0
- package/src/feedback/EmptyStates/EmptyStates.tsx +37 -17
- package/src/feedback/EmptyStates/NoAccessEmpty.options.test.tsx +38 -0
- package/src/feedback/EmptyStates/block.meta.ts +1 -1
- package/src/feedback/EmptyStates/examples/HiddenAction.tsx +13 -0
- package/src/feedback/EmptyStates/examples/Spanish.tsx +7 -0
- package/src/feedback/ErrorPanel/ErrorPanel.tsx +13 -15
- package/src/forms/CreateApiKeyDialog/CreateApiKeyDialog.labels.test.tsx +115 -0
- package/src/forms/CreateApiKeyDialog/CreateApiKeyDialog.lifecycle.test.tsx +123 -0
- package/src/forms/CreateApiKeyDialog/CreateApiKeyDialog.tsx +153 -122
- package/src/forms/CreateApiKeyDialog/block.meta.ts +34 -2
- 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.controlled.test.tsx +482 -0
- package/src/forms/FileUploadPanel/FileUploadPanel.drag.test.tsx +60 -0
- package/src/forms/FileUploadPanel/FileUploadPanel.labels.test.tsx +126 -0
- package/src/forms/FileUploadPanel/FileUploadPanel.lifecycle.test.tsx +165 -0
- package/src/forms/FileUploadPanel/FileUploadPanel.tsx +336 -75
- package/src/forms/FileUploadPanel/block.meta.ts +26 -1
- package/src/forms/FileUploadPanel/examples/AutoCancel.tsx +38 -0
- package/src/forms/FileUploadPanel/examples/Labels.tsx +29 -0
- package/src/forms/FileUploadPanel/examples/ManualForm.tsx +36 -0
- package/src/forms/FileUploadPanel/fixtures.ts +31 -16
- package/src/forms/FileUploadPanel/simulate-upload.test.ts +24 -0
- package/src/forms/FormSection/FormSection.labels.test.tsx +37 -0
- package/src/forms/FormSection/FormSection.test.tsx +11 -0
- package/src/forms/FormSection/FormSection.tsx +34 -25
- package/src/forms/FormSection/block.meta.ts +7 -1
- package/src/forms/FormSection/examples/ContainerPanel.tsx +16 -0
- package/src/forms/FormSection/examples/Labels.tsx +27 -0
- package/src/forms/InviteMembersDialog/InviteMembersDialog.labels.test.tsx +87 -0
- package/src/forms/InviteMembersDialog/InviteMembersDialog.lifecycle.test.tsx +80 -0
- package/src/forms/InviteMembersDialog/InviteMembersDialog.tsx +121 -105
- package/src/forms/InviteMembersDialog/block.meta.ts +21 -2
- 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 +10 -7
- 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/hooks/index.ts +2 -0
- package/src/hooks/useTableData.integration.test.tsx +89 -0
- package/src/hooks/useTableData.test.tsx +613 -0
- package/src/hooks/useTableData.ts +377 -0
- package/src/index.ts +1 -0
- package/src/marketing/ComparisonTable/ComparisonTable.tsx +2 -2
- package/src/marketing/FeatureGrid/FeatureGrid.tsx +1 -1
- package/src/marketing/LogoCloud/LogoCloud.doc.ts +13 -0
- package/src/marketing/LogoCloud/LogoCloud.test.tsx +155 -0
- package/src/marketing/LogoCloud/LogoCloud.tsx +89 -0
- package/src/marketing/LogoCloud/block.meta.ts +10 -0
- package/src/marketing/LogoCloud/examples/CaptionStart.tsx +6 -0
- package/src/marketing/LogoCloud/examples/Custom.tsx +25 -0
- package/src/marketing/LogoCloud/examples/Empty.tsx +6 -0
- package/src/marketing/LogoCloud/examples/Grid.tsx +13 -0
- package/src/marketing/LogoCloud/examples/Row.tsx +6 -0
- package/src/marketing/LogoCloud/examples/UnderHero.tsx +13 -0
- package/src/marketing/LogoCloud/fixtures.ts +23 -0
- package/src/marketing/PricingTable/PricingTable.tsx +1 -1
- package/src/marketing/SiteFooter/SiteFooter.doc.ts +18 -0
- package/src/marketing/SiteFooter/SiteFooter.test.tsx +236 -0
- package/src/marketing/SiteFooter/SiteFooter.tsx +160 -0
- package/src/marketing/SiteFooter/block.meta.ts +10 -0
- package/src/marketing/SiteFooter/examples/Centered.tsx +15 -0
- package/src/marketing/SiteFooter/examples/Columns.tsx +15 -0
- package/src/marketing/SiteFooter/examples/Custom.tsx +35 -0
- package/src/marketing/SiteFooter/examples/Empty.tsx +6 -0
- package/src/marketing/SiteFooter/examples/Simple.tsx +14 -0
- package/src/marketing/SiteFooter/fixtures.ts +36 -0
- package/src/marketing/index.ts +6 -0
- package/src/page-chrome/PageHeader/EditableTitle.test.tsx +26 -0
- package/src/page-chrome/PageHeader/PageHeader.options.test.tsx +34 -0
- package/src/page-chrome/PageHeader/PageHeader.tsx +11 -5
- package/src/page-chrome/PageHeader/block.meta.ts +1 -1
- package/src/page-chrome/PageHeader/examples/ContainerPanel.tsx +16 -0
- package/src/page-chrome/PageHeader/examples/EditableTitle.tsx +23 -0
- package/src/page-chrome/PageHeader/examples/Spanish.tsx +11 -0
- package/src/page-chrome/StickyActionBar/StickyActionBar.tsx +1 -1
- package/src/scheduling/AgendaList/AgendaList.tsx +39 -15
- package/src/scheduling/AgendaList/AgendaListZone.test.tsx +38 -0
- package/src/scheduling/AgendaList/block.meta.ts +1 -1
- package/src/scheduling/AgendaList/examples/TimeZone.tsx +28 -0
- package/src/scheduling/MonthCalendar/MonthCalendar.tsx +51 -40
- package/src/scheduling/MonthCalendar/MonthCalendarZone.test.tsx +44 -0
- package/src/scheduling/MonthCalendar/block.meta.ts +1 -1
- package/src/scheduling/MonthCalendar/examples/TimeZone.tsx +28 -0
- package/src/scheduling/WeekCalendar/WeekCalendar.tsx +37 -28
- package/src/scheduling/WeekCalendar/WeekCalendarZone.test.tsx +41 -0
- package/src/scheduling/WeekCalendar/block.meta.ts +1 -1
- package/src/scheduling/WeekCalendar/examples/TimeZone.tsx +28 -0
- package/src/scheduling/shared/CalendarHeader.tsx +26 -1
- package/src/scheduling/shared/dates.ts +102 -58
- package/src/scheduling/shared/events.ts +2 -2
- package/src/shell/AppSidebar/AppSidebar.context.test.tsx +175 -0
- package/src/shell/AppSidebar/AppSidebar.doc.ts +29 -0
- package/src/shell/AppSidebar/AppSidebar.tsx +97 -25
- package/src/shell/AppSidebar/block.meta.ts +1 -1
- package/src/shell/GlobalSearch/GlobalSearch.test.tsx +1 -0
- package/src/shell/GlobalSearch/GlobalSearch.tsx +1 -1
- package/src/tables/DataTable/DataTable.cross-page-selection.test.tsx +322 -0
- package/src/tables/DataTable/DataTable.cursor-example.test.tsx +67 -0
- package/src/tables/DataTable/DataTable.export.test.tsx +511 -0
- package/src/tables/DataTable/DataTable.inline-edit-focus.test.tsx +32 -0
- package/src/tables/DataTable/DataTable.labels.test.tsx +74 -0
- package/src/tables/DataTable/DataTable.layout.test.tsx +6 -5
- package/src/tables/DataTable/DataTable.link-actions.test.tsx +18 -0
- package/src/tables/DataTable/DataTable.server-pagination.test.tsx +329 -15
- package/src/tables/DataTable/DataTable.single-select.test.tsx +47 -7
- package/src/tables/DataTable/DataTable.test.tsx +140 -1
- package/src/tables/DataTable/DataTable.tsx +241 -80
- package/src/tables/DataTable/block.meta.ts +31 -3
- package/src/tables/DataTable/column-sizing.ts +2 -2
- package/src/tables/DataTable/data-table-props.ts +43 -6
- package/src/tables/DataTable/data-table-row.tsx +9 -5
- package/src/tables/DataTable/data-table-utils.ts +6 -0
- package/src/tables/DataTable/editable-cell.tsx +20 -79
- package/src/tables/DataTable/examples/client-selection.tsx +33 -0
- package/src/tables/DataTable/examples/csv-export.tsx +74 -0
- package/src/tables/DataTable/examples/cursor-load-more.tsx +87 -0
- package/src/tables/DataTable/examples/paginated-single-selection.tsx +46 -0
- package/src/tables/DataTable/examples/server-pagination.tsx +91 -44
- package/src/tables/DataTable/export-menu.tsx +58 -0
- package/src/tables/DataTable/header-cell.tsx +1 -1
- package/src/tables/DataTable/labels.ts +11 -0
- package/src/tables/DataTable/resize-handle.tsx +2 -2
- 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/DataTable/use-table-export.ts +117 -0
- package/src/tables/FilterBar/FilterBar.test.tsx +12 -0
- package/src/tables/FilterBar/FilterBar.tsx +5 -7
- package/src/team/ProfileHeader/ProfileHeader.picker.test.tsx +34 -0
- package/src/team/ProfileHeader/ProfileHeader.test.tsx +2 -2
- package/src/team/ProfileHeader/ProfileHeader.tsx +17 -24
- package/src/team/ProfileHeader/block.meta.ts +1 -1
- package/src/test/OptInDefaults.test.tsx +36 -0
- package/src/test/clipboard-fallback.test.tsx +49 -0
- package/src/test/copy-examples.test.tsx +29 -0
- package/src/test/copy-feedback.test.tsx +166 -0
- package/src/test/fixtures/opt-in-defaults.json +10 -0
- package/src/test/without-forced-colors.test.ts +44 -0
- package/src/test/without-forced-colors.ts +14 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Button, I18nProvider } from '@gntik-ai/ui';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { SsoButtons, type SsoButtonsLabels } from '../SsoButtons';
|
|
4
|
+
|
|
5
|
+
export default function Labels() {
|
|
6
|
+
const [spanish, setSpanish] = useState(false);
|
|
7
|
+
const [custom, setCustom] = useState(true);
|
|
8
|
+
const labels: Partial<SsoButtonsLabels> = { label: 'Identity providers' };
|
|
9
|
+
return (
|
|
10
|
+
<div className="grid gap-4">
|
|
11
|
+
<div className="flex flex-wrap gap-2">
|
|
12
|
+
<Button variant="secondary" aria-pressed={spanish} onClick={() => setSpanish(!spanish)}>
|
|
13
|
+
Spanish catalog
|
|
14
|
+
</Button>
|
|
15
|
+
<Button variant="secondary" aria-pressed={custom} onClick={() => setCustom(!custom)}>
|
|
16
|
+
Custom labels
|
|
17
|
+
</Button>
|
|
18
|
+
</div>
|
|
19
|
+
<I18nProvider locale={spanish ? 'es' : 'en'}>
|
|
20
|
+
<SsoButtons labels={custom ? labels : undefined} />
|
|
21
|
+
</I18nProvider>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`auth default markup > ForgotPasswordForm retains its default markup 1`] = `"<div class="w-full max-w-[392px]"><div class="mb-6"><p class="mb-2.5 font-mono text-[11px] tracking-[0.2em] text-primary-text label-case">Account recovery</p><h1 class="text-[24px] font-semibold tracking-tight text-balance text-foreground sm:text-[27px]">Forgot your password?</h1><p class="mt-2 text-[14px] leading-relaxed text-pretty text-muted-foreground">Enter the email you sign in with and we'll send you a reset link.</p></div><form noValidate="" aria-label="Reset password request" class="flex flex-col gap-4"><div class="flex min-w-0 flex-col gap-2"><label id="base-ui-_R_1q_" for="base-ui-_R_a_" class="inline-flex items-center gap-0.5 text-[13px] font-medium text-foreground data-disabled:cursor-disabled">Email</label><div class="flex w-full min-w-0 items-center rounded-md border border-border bg-background text-foreground shadow-sm transition-colors motion-reduce:transition-none has-[input:focus-visible]:border-primary/60 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-focus-ring data-invalid:border-destructive/70 has-[input[data-invalid]]:border-destructive/70 has-[input[aria-invalid=true]]:border-destructive/70 has-[input:disabled]:cursor-disabled has-[input:disabled]:bg-secondary/50 has-[input:disabled]:text-muted-foreground has-[input:read-only]:bg-secondary/40 h-control gap-tight px-field text-[13px]"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mail pointer-events-none shrink-0 text-muted-foreground" aria-hidden="true"><path d="m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"></path><rect x="2" y="4" width="20" height="16" rx="2"></rect></svg><input id="base-ui-_R_a_" type="email" autoComplete="email" placeholder="name@company.com" required="" class="h-full w-full min-w-0 bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-disabled disabled:text-muted-foreground read-only:text-muted-foreground text-[13px]" value=""/></div></div><button type="submit" tabindex="0" class="inline-flex shrink-0 items-center justify-center font-semibold whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 bg-primary text-primary-foreground shadow-sm not-data-[disabled]:hover:bg-primary/90 h-11 gap-2 px-5 text-[14.5px] rounded-lg mt-2 w-full">Send reset link</button></form><p class="mt-7 text-center"><a href="#" class="cursor-interactive rounded-sm font-medium underline-offset-4 transition-colors focus-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 text-muted-foreground hover:text-foreground underline decoration-current/40 hover:decoration-current inline-flex items-center gap-1.5 text-[13px]"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-left rtl:-scale-x-100" aria-hidden="true"><path d="m12 19-7-7 7-7"></path><path d="M19 12H5"></path></svg>Back to sign in</a></p></div>"`;
|
|
4
|
+
|
|
5
|
+
exports[`auth default markup > MfaChallenge retains its default markup 1`] = `"<div class="w-full max-w-[392px]"><div class="mb-6"><p class="mb-2.5 font-mono text-[11px] tracking-[0.2em] text-primary-text label-case">Two-step verification</p><h1 class="text-[24px] font-semibold tracking-tight text-balance text-foreground sm:text-[27px]">Enter your verification code</h1><p class="mt-2 text-[14px] leading-relaxed text-pretty text-muted-foreground">Open your authenticator app and enter the 6-digit code.</p></div><form noValidate="" aria-label="Verify your identity" class="flex flex-col gap-5"><div class="flex min-w-0 flex-col gap-2"><label id="base-ui-_R_3i_" for="base-ui-_R_i_" class="inline-flex items-center gap-0.5 text-[13px] font-medium text-foreground data-disabled:cursor-disabled">Verification code</label><div role="group" class="group/otp flex w-fit items-center gap-2 data-disabled:cursor-disabled"><input data-length="6" id="base-ui-_R_i_" type="text" inputMode="numeric" autoComplete="one-time-code" autoCorrect="off" spellCheck="false" enterKeyHint="next" maxLength="6" tabindex="0" pattern="\\d{1}" class="m-0 rounded-md border border-border bg-background p-0 text-center font-mono font-medium text-foreground shadow-sm caret-primary uppercase transition-colors motion-reduce:transition-none focus-visible:border-primary/60 focus-ring focus:outline-none data-filled:border-muted-foreground/40 data-invalid:border-destructive/70 group-data-invalid/otp:border-destructive/70 disabled:cursor-disabled disabled:bg-secondary/50 disabled:text-muted-foreground read-only:bg-secondary/40 h-11 w-10 text-[17px]" value=""/><input data-length="6" id="base-ui-_R_i_-2" type="text" inputMode="numeric" autoComplete="off" autoCorrect="off" spellCheck="false" enterKeyHint="next" tabindex="-1" pattern="\\d{1}" aria-label="Character 2 of 6" class="m-0 rounded-md border border-border bg-background p-0 text-center font-mono font-medium text-foreground shadow-sm caret-primary uppercase transition-colors motion-reduce:transition-none focus-visible:border-primary/60 focus-ring focus:outline-none data-filled:border-muted-foreground/40 data-invalid:border-destructive/70 group-data-invalid/otp:border-destructive/70 disabled:cursor-disabled disabled:bg-secondary/50 disabled:text-muted-foreground read-only:bg-secondary/40 h-11 w-10 text-[17px]" value=""/><input data-length="6" id="base-ui-_R_i_-3" type="text" inputMode="numeric" autoComplete="off" autoCorrect="off" spellCheck="false" enterKeyHint="next" tabindex="-1" pattern="\\d{1}" aria-label="Character 3 of 6" class="m-0 rounded-md border border-border bg-background p-0 text-center font-mono font-medium text-foreground shadow-sm caret-primary uppercase transition-colors motion-reduce:transition-none focus-visible:border-primary/60 focus-ring focus:outline-none data-filled:border-muted-foreground/40 data-invalid:border-destructive/70 group-data-invalid/otp:border-destructive/70 disabled:cursor-disabled disabled:bg-secondary/50 disabled:text-muted-foreground read-only:bg-secondary/40 h-11 w-10 text-[17px]" value=""/><div data-orientation="horizontal" role="separator" aria-orientation="horizontal" class="h-px w-2.5 shrink-0 rounded-full bg-muted-foreground/50"></div><input data-length="6" id="base-ui-_R_i_-4" type="text" inputMode="numeric" autoComplete="off" autoCorrect="off" spellCheck="false" enterKeyHint="next" tabindex="-1" pattern="\\d{1}" aria-label="Character 4 of 6" class="m-0 rounded-md border border-border bg-background p-0 text-center font-mono font-medium text-foreground shadow-sm caret-primary uppercase transition-colors motion-reduce:transition-none focus-visible:border-primary/60 focus-ring focus:outline-none data-filled:border-muted-foreground/40 data-invalid:border-destructive/70 group-data-invalid/otp:border-destructive/70 disabled:cursor-disabled disabled:bg-secondary/50 disabled:text-muted-foreground read-only:bg-secondary/40 h-11 w-10 text-[17px]" value=""/><input data-length="6" id="base-ui-_R_i_-5" type="text" inputMode="numeric" autoComplete="off" autoCorrect="off" spellCheck="false" enterKeyHint="next" tabindex="-1" pattern="\\d{1}" aria-label="Character 5 of 6" class="m-0 rounded-md border border-border bg-background p-0 text-center font-mono font-medium text-foreground shadow-sm caret-primary uppercase transition-colors motion-reduce:transition-none focus-visible:border-primary/60 focus-ring focus:outline-none data-filled:border-muted-foreground/40 data-invalid:border-destructive/70 group-data-invalid/otp:border-destructive/70 disabled:cursor-disabled disabled:bg-secondary/50 disabled:text-muted-foreground read-only:bg-secondary/40 h-11 w-10 text-[17px]" value=""/><input data-length="6" id="base-ui-_R_i_-6" type="text" inputMode="numeric" autoComplete="off" autoCorrect="off" spellCheck="false" enterKeyHint="done" tabindex="-1" pattern="\\d{1}" aria-label="Character 6 of 6" class="m-0 rounded-md border border-border bg-background p-0 text-center font-mono font-medium text-foreground shadow-sm caret-primary uppercase transition-colors motion-reduce:transition-none focus-visible:border-primary/60 focus-ring focus:outline-none data-filled:border-muted-foreground/40 data-invalid:border-destructive/70 group-data-invalid/otp:border-destructive/70 disabled:cursor-disabled disabled:bg-secondary/50 disabled:text-muted-foreground read-only:bg-secondary/40 h-11 w-10 text-[17px]" value=""/></div><input type="text" id="base-ui-_R_i_-hidden-input" autoComplete="one-time-code" inputMode="numeric" minLength="6" maxLength="6" pattern="\\d{6}" aria-hidden="true" tabindex="-1" style="clip-path:inset(50%);overflow:hidden;white-space:nowrap;border:0;padding:0;width:1px;height:1px;margin:0;position:fixed;top:0;left:0" value=""/></div><button type="submit" tabindex="0" class="inline-flex shrink-0 items-center justify-center font-semibold whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 bg-primary text-primary-foreground shadow-sm not-data-[disabled]:hover:bg-primary/90 h-11 gap-2 px-5 text-[14.5px] rounded-lg w-full">Verify</button></form><div class="mt-6 flex flex-wrap items-center justify-between gap-3 text-[13px]"><button type="button" tabindex="0" aria-pressed="false" class="inline-flex shrink-0 items-center justify-center font-semibold whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 text-muted-foreground not-data-[disabled]:hover:bg-secondary/70 not-data-[disabled]:hover:text-foreground h-8 gap-1.5 px-3 text-[12.5px] rounded-md">Use a backup code</button></div><span role="status" class="sr-only"></span></div>"`;
|
|
6
|
+
|
|
7
|
+
exports[`auth default markup > ResetPasswordForm retains its default markup 1`] = `"<div class="w-full max-w-[392px]"><div class="mb-6"><p class="mb-2.5 font-mono text-[11px] tracking-[0.2em] text-primary-text label-case">Account recovery</p><h1 class="text-[24px] font-semibold tracking-tight text-balance text-foreground sm:text-[27px]">Set a new password</h1><p class="mt-2 text-[14px] leading-relaxed text-pretty text-muted-foreground">Use at least 8 characters. Avoid passwords you use elsewhere.</p></div><form noValidate="" aria-label="Set a new password" class="flex flex-col gap-4"><div class="flex min-w-0 flex-col gap-2"><label id="base-ui-_R_3a_" for="base-ui-_R_a_" class="inline-flex items-center gap-0.5 text-[13px] font-medium text-foreground data-disabled:cursor-disabled">New password</label><div class="flex min-w-0 flex-col gap-2"><div class="flex w-full min-w-0 items-center rounded-md border border-border bg-background text-foreground shadow-sm transition-colors motion-reduce:transition-none has-[input:focus-visible]:border-primary/60 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-focus-ring data-invalid:border-destructive/70 has-[input[data-invalid]]:border-destructive/70 has-[input[aria-invalid=true]]:border-destructive/70 has-[input:disabled]:cursor-disabled has-[input:disabled]:bg-secondary/50 has-[input:disabled]:text-muted-foreground has-[input:read-only]:bg-secondary/40 h-control gap-tight px-field text-[13px] pe-1"><input id="base-ui-_R_a_" required="" type="password" autoComplete="new-password" class="h-full w-full min-w-0 bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-disabled disabled:text-muted-foreground read-only:text-muted-foreground text-[13px]" value=""/><span class="flex shrink-0 items-center text-muted-foreground select-none"><button type="button" tabindex="0" aria-label="Show password" aria-pressed="false" class="inline-flex items-center justify-center font-semibold whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 text-muted-foreground not-data-[disabled]:hover:bg-secondary/70 not-data-[disabled]:hover:text-foreground gap-1.5 text-[12.5px] rounded-md px-0 size-7 shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye" aria-hidden="true"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"></path><circle cx="12" cy="12" r="3"></circle></svg></button></span></div><div class="flex flex-col gap-1.5"><div class="grid grid-cols-4 gap-1" aria-hidden="true"><span class="h-1 rounded-full bg-secondary transition-colors motion-reduce:transition-none"></span><span class="h-1 rounded-full bg-secondary transition-colors motion-reduce:transition-none"></span><span class="h-1 rounded-full bg-secondary transition-colors motion-reduce:transition-none"></span><span class="h-1 rounded-full bg-secondary transition-colors motion-reduce:transition-none"></span></div><p id="_R_5a_" class="text-[12px] leading-4 text-muted-foreground">Use 12+ characters with a mix of letters, numbers and symbols.</p></div></div></div><div class="flex min-w-0 flex-col gap-2"><label id="base-ui-_R_3e_" for="base-ui-_R_e_" class="inline-flex items-center gap-0.5 text-[13px] font-medium text-foreground data-disabled:cursor-disabled">Confirm password</label><div class="flex w-full min-w-0 items-center rounded-md border border-border bg-background text-foreground shadow-sm transition-colors motion-reduce:transition-none has-[input:focus-visible]:border-primary/60 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-focus-ring data-invalid:border-destructive/70 has-[input[data-invalid]]:border-destructive/70 has-[input[aria-invalid=true]]:border-destructive/70 has-[input:disabled]:cursor-disabled has-[input:disabled]:bg-secondary/50 has-[input:disabled]:text-muted-foreground has-[input:read-only]:bg-secondary/40 h-control gap-tight px-field text-[13px] pe-1"><input id="base-ui-_R_e_" autoComplete="new-password" required="" type="password" class="h-full w-full min-w-0 bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-disabled disabled:text-muted-foreground read-only:text-muted-foreground text-[13px]" value=""/><span class="flex shrink-0 items-center text-muted-foreground select-none"><button type="button" tabindex="0" aria-label="Show password" aria-pressed="false" class="inline-flex items-center justify-center font-semibold whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 text-muted-foreground not-data-[disabled]:hover:bg-secondary/70 not-data-[disabled]:hover:text-foreground gap-1.5 text-[12.5px] rounded-md px-0 size-7 shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye" aria-hidden="true"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"></path><circle cx="12" cy="12" r="3"></circle></svg></button></span></div></div><button type="submit" tabindex="0" class="inline-flex shrink-0 items-center justify-center font-semibold whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 bg-primary text-primary-foreground shadow-sm not-data-[disabled]:hover:bg-primary/90 h-11 gap-2 px-5 text-[14.5px] rounded-lg mt-2 w-full">Update password</button></form></div>"`;
|
|
8
|
+
|
|
9
|
+
exports[`auth default markup > SignInForm retains its default markup 1`] = `"<div class="w-full max-w-[392px]"><div class="mb-6"><p class="mb-2.5 font-mono text-[11px] tracking-[0.2em] text-primary-text label-case">Secure access</p><h1 class="text-[24px] font-semibold tracking-tight text-balance text-foreground sm:text-[27px]">Sign in to your workspace</h1><p class="mt-2 text-[14px] leading-relaxed text-pretty text-muted-foreground">Use your work email to continue.</p></div><form noValidate="" aria-label="Sign in" class="flex flex-col gap-4"><div class="flex min-w-0 flex-col gap-2"><label id="base-ui-_R_6i_" for="base-ui-_R_i_" class="inline-flex items-center gap-0.5 text-[13px] font-medium text-foreground data-disabled:cursor-disabled">Email</label><div class="flex w-full min-w-0 items-center rounded-md border border-border bg-background text-foreground shadow-sm transition-colors motion-reduce:transition-none has-[input:focus-visible]:border-primary/60 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-focus-ring data-invalid:border-destructive/70 has-[input[data-invalid]]:border-destructive/70 has-[input[aria-invalid=true]]:border-destructive/70 has-[input:disabled]:cursor-disabled has-[input:disabled]:bg-secondary/50 has-[input:disabled]:text-muted-foreground has-[input:read-only]:bg-secondary/40 h-control gap-tight px-field text-[13px]"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mail pointer-events-none shrink-0 text-muted-foreground" aria-hidden="true"><path d="m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"></path><rect x="2" y="4" width="20" height="16" rx="2"></rect></svg><input id="base-ui-_R_i_" type="email" autoComplete="email" placeholder="name@company.com" required="" class="h-full w-full min-w-0 bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-disabled disabled:text-muted-foreground read-only:text-muted-foreground text-[13px]" value=""/></div></div><div class="flex min-w-0 flex-col gap-2"><div class="flex items-center justify-between gap-3"><label id="base-ui-_R_16q_" for="base-ui-_R_q_" class="inline-flex items-center gap-0.5 text-[13px] font-medium text-foreground data-disabled:cursor-disabled">Password</label><a href="#" class="cursor-interactive rounded-sm font-medium underline-offset-4 transition-colors focus-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 text-primary-text underline decoration-current/40 hover:decoration-current text-[12.5px]">Forgot password?</a></div><div class="flex w-full min-w-0 items-center rounded-md border border-border bg-background text-foreground shadow-sm transition-colors motion-reduce:transition-none has-[input:focus-visible]:border-primary/60 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-focus-ring data-invalid:border-destructive/70 has-[input[data-invalid]]:border-destructive/70 has-[input[aria-invalid=true]]:border-destructive/70 has-[input:disabled]:cursor-disabled has-[input:disabled]:bg-secondary/50 has-[input:disabled]:text-muted-foreground has-[input:read-only]:bg-secondary/40 h-control gap-tight px-field text-[13px] pe-1"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-lock pointer-events-none shrink-0 text-muted-foreground" aria-hidden="true"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg><input id="base-ui-_R_q_" required="" type="password" autoComplete="current-password" class="h-full w-full min-w-0 bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-disabled disabled:text-muted-foreground read-only:text-muted-foreground text-[13px]" value=""/><span class="flex shrink-0 items-center text-muted-foreground select-none"><button type="button" tabindex="0" aria-label="Show password" aria-pressed="false" class="inline-flex items-center justify-center font-semibold whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 text-muted-foreground not-data-[disabled]:hover:bg-secondary/70 not-data-[disabled]:hover:text-foreground gap-1.5 text-[12.5px] rounded-md px-0 size-7 shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye" aria-hidden="true"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"></path><circle cx="12" cy="12" r="3"></circle></svg></button></span></div></div><div class="grid grid-cols-[auto_1fr] items-start gap-x-3 gap-y-0.5"><label class="col-span-2 grid cursor-interactive grid-cols-subgrid items-start has-[[data-disabled]]:cursor-disabled has-[[data-disabled]]:opacity-70"><span data-checked="" role="checkbox" tabindex="0" id="base-ui-_R_n2_" aria-checked="true" class="inline-flex size-[18px] shrink-0 cursor-interactive items-center justify-center rounded-[5px] border border-border bg-background text-primary-foreground transition-colors motion-reduce:transition-none hover:border-muted-foreground/50 data-checked:border-primary data-checked:bg-primary data-indeterminate:border-primary data-indeterminate:bg-primary data-invalid:border-destructive/70 focus-ring data-disabled:cursor-disabled data-disabled:opacity-50 mt-px"><span data-checked="" class="flex items-center justify-center data-unchecked:hidden"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg></span></span><input id="base-ui-_R_n2H1_" style="clip-path:inset(50%);overflow:hidden;white-space:nowrap;border:0;padding:0;width:1px;height:1px;margin:0;position:fixed;top:0;left:0" tabindex="-1" type="checkbox" aria-hidden="true" checked=""/><span class="text-[13px] leading-5 font-medium text-foreground select-none">Keep me signed in</span></label></div><button type="submit" tabindex="0" class="inline-flex shrink-0 items-center justify-center font-semibold whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 bg-primary text-primary-foreground shadow-sm not-data-[disabled]:hover:bg-primary/90 h-11 gap-2 px-5 text-[14.5px] rounded-lg mt-2 w-full">Sign in</button></form><div class="my-6 flex items-center gap-3" role="presentation"><span class="h-px flex-1 bg-border"></span><span class="font-mono text-[10.5px] font-semibold tracking-[0.2em] text-muted-foreground label-case">Or continue with</span><span class="h-px flex-1 bg-border"></span></div><div role="group" aria-label="Single sign-on" class="grid gap-2.5"><button type="button" tabindex="0" class="inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 border border-border bg-card text-foreground shadow-sm not-data-[disabled]:hover:bg-secondary/70 h-11 gap-2 px-5 rounded-lg w-full text-[13.5px] font-medium"><svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-building-complex lucide-building-2" aria-hidden="true"><path d="M10 12h4"></path><path d="M10 8h4"></path><path d="M14 21v-3a2 2 0 0 0-4 0v3"></path><path d="M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2"></path><path d="M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16"></path></svg>Continue with SSO</button><button type="button" tabindex="0" class="inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 border border-border bg-card text-foreground shadow-sm not-data-[disabled]:hover:bg-secondary/70 h-11 gap-2 px-5 rounded-lg w-full text-[13.5px] font-medium"><svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-globe" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"></path><path d="M2 12h20"></path></svg>Continue with Google</button><button type="button" tabindex="0" class="inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 border border-border bg-card text-foreground shadow-sm not-data-[disabled]:hover:bg-secondary/70 h-11 gap-2 px-5 rounded-lg w-full text-[13.5px] font-medium"><svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-key-round" aria-hidden="true"><path d="M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"></path><circle cx="16.5" cy="7.5" r=".5" fill="currentColor"></circle></svg>Continue with a passkey</button></div><p class="mt-7 text-center text-[13px] text-muted-foreground">New here? <a href="#" class="cursor-interactive rounded-sm font-medium underline-offset-4 transition-colors focus-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 text-primary-text underline decoration-current/40 hover:decoration-current">Create an account</a></p></div>"`;
|
|
10
|
+
|
|
11
|
+
exports[`auth default markup > SignUpForm retains its default markup 1`] = `"<div class="w-full max-w-[392px]"><div class="mb-6"><p class="mb-2.5 font-mono text-[11px] tracking-[0.2em] text-primary-text label-case">Get started</p><h1 class="text-[24px] font-semibold tracking-tight text-balance text-foreground sm:text-[27px]">Create your account</h1><p class="mt-2 text-[14px] leading-relaxed text-pretty text-muted-foreground">Set up a workspace for your team in a couple of minutes.</p></div><form noValidate="" aria-label="Create account" class="flex flex-col gap-4"><div class="flex min-w-0 flex-col gap-2"><label id="base-ui-_R_1ll_" for="base-ui-_R_5l_" class="inline-flex items-center gap-0.5 text-[13px] font-medium text-foreground data-disabled:cursor-disabled">Full name</label><div class="flex w-full min-w-0 items-center rounded-md border border-border bg-background text-foreground shadow-sm transition-colors motion-reduce:transition-none has-[input:focus-visible]:border-primary/60 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-focus-ring data-invalid:border-destructive/70 has-[input[data-invalid]]:border-destructive/70 has-[input[aria-invalid=true]]:border-destructive/70 has-[input:disabled]:cursor-disabled has-[input:disabled]:bg-secondary/50 has-[input:disabled]:text-muted-foreground has-[input:read-only]:bg-secondary/40 h-control gap-tight px-field text-[13px]"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-user pointer-events-none shrink-0 text-muted-foreground" aria-hidden="true"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg><input id="base-ui-_R_5l_" autoComplete="name" placeholder="Avery Collins" required="" class="h-full w-full min-w-0 bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-disabled disabled:text-muted-foreground read-only:text-muted-foreground text-[13px]" value=""/></div></div><div class="flex min-w-0 flex-col gap-2"><label id="base-ui-_R_1pl_" for="base-ui-_R_9l_" class="inline-flex items-center gap-0.5 text-[13px] font-medium text-foreground data-disabled:cursor-disabled">Work email</label><div class="flex w-full min-w-0 items-center rounded-md border border-border bg-background text-foreground shadow-sm transition-colors motion-reduce:transition-none has-[input:focus-visible]:border-primary/60 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-focus-ring data-invalid:border-destructive/70 has-[input[data-invalid]]:border-destructive/70 has-[input[aria-invalid=true]]:border-destructive/70 has-[input:disabled]:cursor-disabled has-[input:disabled]:bg-secondary/50 has-[input:disabled]:text-muted-foreground has-[input:read-only]:bg-secondary/40 h-control gap-tight px-field text-[13px]"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mail pointer-events-none shrink-0 text-muted-foreground" aria-hidden="true"><path d="m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"></path><rect x="2" y="4" width="20" height="16" rx="2"></rect></svg><input id="base-ui-_R_9l_" type="email" autoComplete="email" placeholder="name@company.com" required="" class="h-full w-full min-w-0 bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-disabled disabled:text-muted-foreground read-only:text-muted-foreground text-[13px]" value=""/></div></div><div class="flex min-w-0 flex-col gap-2"><label id="base-ui-_R_e5_" for="base-ui-_R_25_" class="inline-flex items-center gap-0.5 text-[13px] font-medium text-foreground data-disabled:cursor-disabled">Password</label><div class="flex min-w-0 flex-col gap-2"><div class="flex w-full min-w-0 items-center rounded-md border border-border bg-background text-foreground shadow-sm transition-colors motion-reduce:transition-none has-[input:focus-visible]:border-primary/60 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-focus-ring data-invalid:border-destructive/70 has-[input[data-invalid]]:border-destructive/70 has-[input[aria-invalid=true]]:border-destructive/70 has-[input:disabled]:cursor-disabled has-[input:disabled]:bg-secondary/50 has-[input:disabled]:text-muted-foreground has-[input:read-only]:bg-secondary/40 h-control gap-tight px-field text-[13px] pe-1"><input id="base-ui-_R_25_" required="" type="password" autoComplete="new-password" class="h-full w-full min-w-0 bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-disabled disabled:text-muted-foreground read-only:text-muted-foreground text-[13px]" value=""/><span class="flex shrink-0 items-center text-muted-foreground select-none"><button type="button" tabindex="0" aria-label="Show password" aria-pressed="false" class="inline-flex items-center justify-center font-semibold whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 text-muted-foreground not-data-[disabled]:hover:bg-secondary/70 not-data-[disabled]:hover:text-foreground gap-1.5 text-[12.5px] rounded-md px-0 size-7 shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye" aria-hidden="true"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"></path><circle cx="12" cy="12" r="3"></circle></svg></button></span></div><div class="flex flex-col gap-1.5"><div class="grid grid-cols-4 gap-1" aria-hidden="true"><span class="h-1 rounded-full bg-secondary transition-colors motion-reduce:transition-none"></span><span class="h-1 rounded-full bg-secondary transition-colors motion-reduce:transition-none"></span><span class="h-1 rounded-full bg-secondary transition-colors motion-reduce:transition-none"></span><span class="h-1 rounded-full bg-secondary transition-colors motion-reduce:transition-none"></span></div><p id="_R_m5_" class="text-[12px] leading-4 text-muted-foreground">Use 12+ characters with a mix of letters, numbers and symbols.</p></div></div></div><div><div class="grid grid-cols-[auto_1fr] items-start gap-x-3 gap-y-0.5"><label class="col-span-2 grid cursor-interactive grid-cols-subgrid items-start has-[[data-disabled]]:cursor-disabled has-[[data-disabled]]:opacity-70"><span data-unchecked="" role="checkbox" tabindex="0" id="base-ui-_R_5ml_" aria-checked="false" class="inline-flex size-[18px] shrink-0 cursor-interactive items-center justify-center rounded-[5px] border border-border bg-background text-primary-foreground transition-colors motion-reduce:transition-none hover:border-muted-foreground/50 data-checked:border-primary data-checked:bg-primary data-indeterminate:border-primary data-indeterminate:bg-primary data-invalid:border-destructive/70 focus-ring data-disabled:cursor-disabled data-disabled:opacity-50 mt-px"></span><input id="base-ui-_R_5mlH1_" style="clip-path:inset(50%);overflow:hidden;white-space:nowrap;border:0;padding:0;width:1px;height:1px;margin:0;position:fixed;top:0;left:0" tabindex="-1" type="checkbox" aria-hidden="true"/><span class="text-[13px] leading-5 font-medium text-foreground select-none">I agree to the <a href="#" class="cursor-interactive rounded-sm font-medium underline-offset-4 transition-colors focus-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 text-primary-text underline decoration-current/40 hover:decoration-current">Terms</a> and <a href="#" class="cursor-interactive rounded-sm font-medium underline-offset-4 transition-colors focus-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 text-primary-text underline decoration-current/40 hover:decoration-current">Privacy Policy</a>.</span></label></div></div><button type="submit" tabindex="0" class="inline-flex shrink-0 items-center justify-center font-semibold whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 bg-primary text-primary-foreground shadow-sm not-data-[disabled]:hover:bg-primary/90 h-11 gap-2 px-5 text-[14.5px] rounded-lg mt-2 w-full">Create account</button></form><div class="my-6 flex items-center gap-3" role="presentation"><span class="h-px flex-1 bg-border"></span><span class="font-mono text-[10.5px] font-semibold tracking-[0.2em] text-muted-foreground label-case">Or sign up with</span><span class="h-px flex-1 bg-border"></span></div><div role="group" aria-label="Single sign-on" class="grid gap-2.5"><button type="button" tabindex="0" class="inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 border border-border bg-card text-foreground shadow-sm not-data-[disabled]:hover:bg-secondary/70 h-11 gap-2 px-5 rounded-lg w-full text-[13.5px] font-medium"><svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-building-complex lucide-building-2" aria-hidden="true"><path d="M10 12h4"></path><path d="M10 8h4"></path><path d="M14 21v-3a2 2 0 0 0-4 0v3"></path><path d="M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2"></path><path d="M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16"></path></svg>Continue with SSO</button><button type="button" tabindex="0" class="inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 border border-border bg-card text-foreground shadow-sm not-data-[disabled]:hover:bg-secondary/70 h-11 gap-2 px-5 rounded-lg w-full text-[13.5px] font-medium"><svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-globe" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"></path><path d="M2 12h20"></path></svg>Continue with Google</button><button type="button" tabindex="0" class="inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 border border-border bg-card text-foreground shadow-sm not-data-[disabled]:hover:bg-secondary/70 h-11 gap-2 px-5 rounded-lg w-full text-[13.5px] font-medium"><svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-key-round" aria-hidden="true"><path d="M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"></path><circle cx="16.5" cy="7.5" r=".5" fill="currentColor"></circle></svg>Continue with a passkey</button></div><p class="mt-7 text-center text-[13px] text-muted-foreground">Already have an account? <a href="#" class="cursor-interactive rounded-sm font-medium underline-offset-4 transition-colors focus-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 text-primary-text underline decoration-current/40 hover:decoration-current">Sign in</a></p></div>"`;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { renderToStaticMarkup } from 'react-dom/server';
|
|
2
|
+
import { SignInForm } from './SignInForm/SignInForm';
|
|
3
|
+
import { SignUpForm } from './SignUpForm/SignUpForm';
|
|
4
|
+
import { ResetPasswordForm } from './ResetPasswordForm/ResetPasswordForm';
|
|
5
|
+
import { ForgotPasswordForm } from './ForgotPasswordForm/ForgotPasswordForm';
|
|
6
|
+
import { MfaChallenge } from './MfaChallenge/MfaChallenge';
|
|
7
|
+
|
|
8
|
+
// Captured before adding fieldSize: default auth markup must remain identical.
|
|
9
|
+
describe('auth default markup', () => {
|
|
10
|
+
it.each([
|
|
11
|
+
['SignInForm', SignInForm],
|
|
12
|
+
['SignUpForm', SignUpForm],
|
|
13
|
+
['ResetPasswordForm', ResetPasswordForm],
|
|
14
|
+
['ForgotPasswordForm', ForgotPasswordForm],
|
|
15
|
+
['MfaChallenge', MfaChallenge],
|
|
16
|
+
] as const)('%s retains its default markup', (_name, Form) => {
|
|
17
|
+
const markup = renderToStaticMarkup(<Form />);
|
|
18
|
+
expect(markup).toMatchSnapshot();
|
|
19
|
+
expect(renderToStaticMarkup(<Form fieldSize="auto" />)).toBe(markup);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ThemeProvider } from '@gntik-ai/ui';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import userEvent from '@testing-library/user-event';
|
|
4
|
+
import { expectNoAxeViolations } from '../test/a11y';
|
|
5
|
+
import SignInLarge from './SignInForm/examples/LargeFields';
|
|
6
|
+
import SignUpLarge from './SignUpForm/examples/LargeFields';
|
|
7
|
+
import ResetLarge from './ResetPasswordForm/examples/LargeFields';
|
|
8
|
+
import ForgotLarge from './ForgotPasswordForm/examples/LargeFields';
|
|
9
|
+
import MfaLarge from './MfaChallenge/examples/LargeFields';
|
|
10
|
+
|
|
11
|
+
for (const theme of ['dark', 'light', 'high_contrast'] as const) {
|
|
12
|
+
it.each([
|
|
13
|
+
['sign-in', SignInLarge],
|
|
14
|
+
['sign-up', SignUpLarge],
|
|
15
|
+
['reset', ResetLarge],
|
|
16
|
+
['forgot', ForgotLarge],
|
|
17
|
+
['mfa', MfaLarge],
|
|
18
|
+
] as const)('%s large example is accessible in ' + theme, async (name, Example) => {
|
|
19
|
+
const { container } = render(
|
|
20
|
+
<ThemeProvider defaultMode={theme} storageKey={null}>
|
|
21
|
+
<Example />
|
|
22
|
+
</ThemeProvider>,
|
|
23
|
+
);
|
|
24
|
+
await expectNoAxeViolations(container);
|
|
25
|
+
if (name === 'mfa') {
|
|
26
|
+
await userEvent.click(screen.getByRole('button', { name: 'Use a backup code' }));
|
|
27
|
+
await expectNoAxeViolations(container);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { act, renderHook } from '@testing-library/react';
|
|
2
|
+
import { I18nProvider, useI18n } from '@gntik-ai/ui';
|
|
3
|
+
import { authIdentifierError, authSignUpFieldError, useAsyncSubmit } from './shared';
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
const wrapper = ({ children }: { children: ReactNode }) => <I18nProvider locale="es">{children}</I18nProvider>;
|
|
6
|
+
it('preserves legacy helper signatures and English outputs', () => {
|
|
7
|
+
expect(authIdentifierError('')).toBe('Enter a valid email address.');
|
|
8
|
+
expect(authIdentifierError('', { type: 'text' })).toBe('Enter a valid identifier.');
|
|
9
|
+
expect(authSignUpFieldError('', { id: 'name', label: 'Full name', required: true })).toBe('Enter Full name.');
|
|
10
|
+
expect(authSignUpFieldError('bad', { id: 'email', label: 'Email', type: 'email' })).toBe(
|
|
11
|
+
'Enter a valid email address.',
|
|
12
|
+
);
|
|
13
|
+
});
|
|
14
|
+
it('accepts a provider translator and keeps explicit validation messages first', () => {
|
|
15
|
+
const { result } = renderHook(() => useI18n(), { wrapper });
|
|
16
|
+
expect(authIdentifierError('', undefined, undefined, result.current.t)).toBe(
|
|
17
|
+
'Introduce una dirección de correo válida.',
|
|
18
|
+
);
|
|
19
|
+
expect(authIdentifierError('x', { type: 'text', minLength: 3 }, undefined, result.current.t)).toBe(
|
|
20
|
+
'Introduce un identificador válido.',
|
|
21
|
+
);
|
|
22
|
+
expect(authSignUpFieldError('', { id: 'name', label: 'Nombre', required: true }, result.current.t)).toBe(
|
|
23
|
+
'Introduce Nombre.',
|
|
24
|
+
);
|
|
25
|
+
expect(authSignUpFieldError('bad', { id: 'email', label: 'Email', type: 'email' }, result.current.t)).toBe(
|
|
26
|
+
'Introduce una dirección de correo válida.',
|
|
27
|
+
);
|
|
28
|
+
expect(authIdentifierError('', undefined, { identifierRequired: 'Explicit required' }, result.current.t)).toBe(
|
|
29
|
+
'Explicit required',
|
|
30
|
+
);
|
|
31
|
+
expect(
|
|
32
|
+
authSignUpFieldError(
|
|
33
|
+
'',
|
|
34
|
+
{ id: 'name', label: 'Nombre', required: true, messages: { required: 'Explicit field' } },
|
|
35
|
+
result.current.t,
|
|
36
|
+
),
|
|
37
|
+
).toBe('Explicit field');
|
|
38
|
+
});
|
|
39
|
+
it('localises non-Error async rejections and honours explicit fallback', async () => {
|
|
40
|
+
const { result, rerender } = renderHook(({ fallback }: { fallback?: string }) => useAsyncSubmit(fallback), {
|
|
41
|
+
wrapper,
|
|
42
|
+
initialProps: { fallback: undefined as string | undefined },
|
|
43
|
+
});
|
|
44
|
+
await act(async () => {
|
|
45
|
+
await result.current.run(() => Promise.reject(null));
|
|
46
|
+
});
|
|
47
|
+
expect(result.current.error).toBe('Algo salió mal. Inténtalo de nuevo.');
|
|
48
|
+
rerender({ fallback: 'Explicit failure' });
|
|
49
|
+
await act(async () => {
|
|
50
|
+
await result.current.run(() => Promise.reject(null));
|
|
51
|
+
});
|
|
52
|
+
expect(result.current.error).toBe('Explicit failure');
|
|
53
|
+
await act(async () => {
|
|
54
|
+
await result.current.run(() => Promise.reject(new Error('Server message')));
|
|
55
|
+
});
|
|
56
|
+
expect(result.current.error).toBe('Server message');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('resolves explicit validation fallbacks before labels and treats undefined as absent', () => {
|
|
60
|
+
expect(
|
|
61
|
+
authIdentifierError('', undefined, { identifierRequired: undefined }, undefined, {
|
|
62
|
+
identifierRequired: 'Custom required',
|
|
63
|
+
}),
|
|
64
|
+
).toBe('Custom required');
|
|
65
|
+
expect(
|
|
66
|
+
authIdentifierError('x', { type: 'text', minLength: 3 }, { identifierInvalid: 'Explicit invalid' }, undefined, {
|
|
67
|
+
identifierTooShort: 'Custom short',
|
|
68
|
+
}),
|
|
69
|
+
).toBe('Explicit invalid');
|
|
70
|
+
expect(authSignUpFieldError('', { id: 'literal', label: '$&', required: true })).toBe('Enter $&.');
|
|
71
|
+
});
|
package/src/auth/shared.tsx
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { cn } from '@gntik-ai/ui';
|
|
1
|
+
import { cn, en, useI18n, type I18n } from '@gntik-ai/ui';
|
|
2
2
|
import { useState, type ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
+
export interface AuthFieldSizeProps {
|
|
5
|
+
/** Field size: auto follows density (default); lg matches the 44px submit button. */
|
|
6
|
+
fieldSize?: 'auto' | 'lg';
|
|
7
|
+
}
|
|
8
|
+
|
|
4
9
|
export interface AuthHeaderProps {
|
|
5
10
|
eyebrow?: ReactNode;
|
|
6
11
|
title: ReactNode;
|
|
@@ -15,7 +20,7 @@ export function AuthHeader({ eyebrow, title, description, headingLevel: Heading
|
|
|
15
20
|
return (
|
|
16
21
|
<div className={cn('mb-6', className)}>
|
|
17
22
|
{eyebrow != null && (
|
|
18
|
-
<p className="mb-2.5 font-mono text-[11px] tracking-[0.2em] text-primary-text
|
|
23
|
+
<p className="mb-2.5 font-mono text-[11px] tracking-[0.2em] text-primary-text label-case">{eyebrow}</p>
|
|
19
24
|
)}
|
|
20
25
|
{Heading != null && title != null && (
|
|
21
26
|
<Heading className="text-[24px] font-semibold tracking-tight text-balance text-foreground sm:text-[27px]">
|
|
@@ -34,7 +39,7 @@ export function AuthDivider({ children }: { children: ReactNode }) {
|
|
|
34
39
|
return (
|
|
35
40
|
<div className="my-6 flex items-center gap-3" role="presentation">
|
|
36
41
|
<span className="h-px flex-1 bg-border" />
|
|
37
|
-
<span className="font-mono text-[10.5px] font-semibold tracking-[0.2em] text-muted-foreground
|
|
42
|
+
<span className="font-mono text-[10.5px] font-semibold tracking-[0.2em] text-muted-foreground label-case">
|
|
38
43
|
{children}
|
|
39
44
|
</span>
|
|
40
45
|
<span className="h-px flex-1 bg-border" />
|
|
@@ -45,7 +50,8 @@ export function AuthDivider({ children }: { children: ReactNode }) {
|
|
|
45
50
|
export const authFormClass = 'w-full max-w-[392px]';
|
|
46
51
|
|
|
47
52
|
/** Loading + error state around an async submit handler. A rejection's message becomes the error. */
|
|
48
|
-
export function useAsyncSubmit(fallbackError
|
|
53
|
+
export function useAsyncSubmit(fallbackError?: string) {
|
|
54
|
+
const { t } = useI18n();
|
|
49
55
|
const [loading, setLoading] = useState(false);
|
|
50
56
|
const [error, setError] = useState<string | null>(null);
|
|
51
57
|
const run = async (fn: () => void | Promise<void>) => {
|
|
@@ -57,7 +63,7 @@ export function useAsyncSubmit(fallbackError = 'Something went wrong. Try again.
|
|
|
57
63
|
return true;
|
|
58
64
|
} catch (e) {
|
|
59
65
|
setLoading(false);
|
|
60
|
-
setError(e instanceof Error ? e.message : fallbackError);
|
|
66
|
+
setError(e instanceof Error ? e.message : (fallbackError ?? t('authValidation.fallbackError')));
|
|
61
67
|
return false;
|
|
62
68
|
}
|
|
63
69
|
};
|
|
@@ -98,17 +104,32 @@ export interface AuthFormAccessibilityProps {
|
|
|
98
104
|
'aria-labelledby'?: string;
|
|
99
105
|
}
|
|
100
106
|
|
|
101
|
-
export function authIdentifierError(
|
|
107
|
+
export function authIdentifierError(
|
|
108
|
+
value: string,
|
|
109
|
+
config?: AuthIdentifierConfig,
|
|
110
|
+
messages?: AuthValidationMessages,
|
|
111
|
+
t?: I18n['t'],
|
|
112
|
+
labels?: AuthValidationMessages,
|
|
113
|
+
) {
|
|
102
114
|
const trimmed = value.trim();
|
|
103
|
-
const fallback =
|
|
104
|
-
|
|
115
|
+
const fallback =
|
|
116
|
+
config?.type === 'text'
|
|
117
|
+
? (t?.('authValidation.identifierInvalid') ?? en['authValidation.identifierInvalid'])
|
|
118
|
+
: (t?.('authValidation.emailInvalid') ?? en['authValidation.emailInvalid']);
|
|
119
|
+
if (!trimmed) return messages?.identifierRequired ?? labels?.identifierRequired ?? fallback;
|
|
105
120
|
if (config?.minLength !== undefined && trimmed.length < config.minLength)
|
|
106
|
-
return
|
|
121
|
+
return (
|
|
122
|
+
messages?.identifierTooShort ??
|
|
123
|
+
messages?.identifierInvalid ??
|
|
124
|
+
labels?.identifierTooShort ??
|
|
125
|
+
labels?.identifierInvalid ??
|
|
126
|
+
fallback
|
|
127
|
+
);
|
|
107
128
|
if (
|
|
108
129
|
((config?.type ?? 'email') === 'email' && !EMAIL_RE.test(trimmed)) ||
|
|
109
130
|
(config?.maxLength !== undefined && trimmed.length > config.maxLength)
|
|
110
131
|
)
|
|
111
|
-
return messages?.identifierInvalid ?? fallback;
|
|
132
|
+
return messages?.identifierInvalid ?? labels?.identifierInvalid ?? fallback;
|
|
112
133
|
return null;
|
|
113
134
|
}
|
|
114
135
|
|
|
@@ -125,11 +146,32 @@ export interface AuthSignUpField {
|
|
|
125
146
|
messages?: { required?: string; invalid?: string };
|
|
126
147
|
}
|
|
127
148
|
|
|
128
|
-
export
|
|
149
|
+
export interface AuthSignUpFieldLabels {
|
|
150
|
+
fieldRequired: (label: string) => string;
|
|
151
|
+
fieldInvalid: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function authSignUpFieldError(
|
|
155
|
+
value: string,
|
|
156
|
+
field: AuthSignUpField,
|
|
157
|
+
t?: I18n['t'],
|
|
158
|
+
labels?: Partial<AuthSignUpFieldLabels>,
|
|
159
|
+
) {
|
|
129
160
|
const trimmed = value.trim();
|
|
130
|
-
if (!trimmed)
|
|
161
|
+
if (!trimmed)
|
|
162
|
+
return field.required
|
|
163
|
+
? (field.messages?.required ??
|
|
164
|
+
labels?.fieldRequired?.(field.label) ??
|
|
165
|
+
t?.('authValidation.fieldRequired', { label: field.label }) ??
|
|
166
|
+
en['authValidation.fieldRequired'].replace('{label}', () => field.label))
|
|
167
|
+
: null;
|
|
131
168
|
if (field.type === 'email' && !EMAIL_RE.test(trimmed))
|
|
132
|
-
return
|
|
169
|
+
return (
|
|
170
|
+
field.messages?.invalid ??
|
|
171
|
+
labels?.fieldInvalid ??
|
|
172
|
+
t?.('authValidation.emailInvalid') ??
|
|
173
|
+
en['authValidation.emailInvalid']
|
|
174
|
+
);
|
|
133
175
|
return null;
|
|
134
176
|
}
|
|
135
177
|
|
|
@@ -75,7 +75,7 @@ export function PaymentMethodCard({
|
|
|
75
75
|
<div className="flex flex-wrap items-center gap-4 px-5 py-4">
|
|
76
76
|
<span
|
|
77
77
|
aria-hidden
|
|
78
|
-
className="grid h-10 w-14 shrink-0 place-items-center rounded-md border border-border bg-secondary font-mono text-[10.5px] font-semibold tracking-wide text-foreground
|
|
78
|
+
className="grid h-10 w-14 shrink-0 place-items-center rounded-md border border-border bg-secondary font-mono text-[10.5px] font-semibold tracking-wide text-foreground label-case"
|
|
79
79
|
>
|
|
80
80
|
{method.brand.slice(0, 4)}
|
|
81
81
|
</span>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { render } from '@testing-library/react';
|
|
2
2
|
import { PlanCard, type BillingPlan } from './PlanCard';
|
|
3
|
+
import { withoutForcedColors } from '../../test/without-forced-colors';
|
|
3
4
|
|
|
4
5
|
const full: BillingPlan = {
|
|
5
6
|
name: 'Fixture Plan',
|
|
@@ -16,11 +17,11 @@ const full: BillingPlan = {
|
|
|
16
17
|
describe('PlanCard billing DOM baseline', () => {
|
|
17
18
|
it('preserves the no-props billing header', () => {
|
|
18
19
|
const { container } = render(<PlanCard />);
|
|
19
|
-
expect(container.outerHTML).toMatchSnapshot();
|
|
20
|
+
expect(withoutForcedColors(container).outerHTML).toMatchSnapshot();
|
|
20
21
|
});
|
|
21
22
|
|
|
22
23
|
it('preserves the FULL billing header', () => {
|
|
23
24
|
const { container } = render(<PlanCard plan={full} upgradeLabel="Upgrade" manageLabel="Manage" />);
|
|
24
|
-
expect(container.outerHTML).toMatchSnapshot();
|
|
25
|
+
expect(withoutForcedColors(container).outerHTML).toMatchSnapshot();
|
|
25
26
|
});
|
|
26
27
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`PlanCard billing DOM baseline > preserves the FULL billing header 1`] = `"<div><div class="overflow-hidden rounded-xl border border-border text-card-foreground bg-card shadow-sm p-6"><div class="flex flex-col gap-5 sm:flex-row sm:items-start sm:justify-between"><div class="min-w-0"><div class="flex flex-wrap items-center gap-2"><h3 class="text-[17px] font-semibold tracking-tight text-foreground">Fixture Plan plan</h3><span class="inline-flex max-w-full shrink-0 items-center gap-1.5 font-semibold whitespace-nowrap select-none h-chip px-2.5 font-mono text-[10.5px] rounded-md
|
|
3
|
+
exports[`PlanCard billing DOM baseline > preserves the FULL billing header 1`] = `"<div><div class="overflow-hidden rounded-xl border border-border text-card-foreground bg-card shadow-sm p-6"><div class="flex flex-col gap-5 sm:flex-row sm:items-start sm:justify-between"><div class="min-w-0"><div class="flex flex-wrap items-center gap-2"><h3 class="text-[17px] font-semibold tracking-tight text-foreground">Fixture Plan plan</h3><span data-tone="success" class="inline-flex max-w-full shrink-0 items-center gap-1.5 font-semibold whitespace-nowrap select-none [--badge-bg-alpha:15%] [--badge-border-alpha:45%] bg-tone/(--badge-bg-alpha) text-tone-chip-text h-chip px-2.5 font-mono text-[10.5px] rounded-md"><span aria-hidden="true" class="size-1.5 shrink-0 rounded-full bg-tone"></span>Active</span></div><p class="mt-1 text-[13px] text-muted-foreground">Renews January 1, 2027 · 2 seats</p><p class="mt-4 flex items-baseline gap-1.5"><span class="text-[30px] font-semibold tracking-tight text-foreground tabular-nums">€10</span><span class="text-[13px] text-muted-foreground">/ month</span></p><p class="mt-1 text-[12px] text-muted-foreground">Billed monthly</p></div><div class="flex flex-col items-start gap-3 sm:items-end"><div data-orientation="horizontal" role="group" aria-label="Billing cycle" class="inline-flex data-[orientation=vertical]:flex-col data-disabled:opacity-50 items-center gap-0.5 rounded-lg border border-border bg-card p-0.5 shadow-sm"><button type="button" data-pressed="" aria-disabled="false" tabindex="0" aria-pressed="true" class="inline-flex shrink-0 items-center justify-center gap-2 font-medium whitespace-nowrap text-muted-foreground transition-colors select-none hover:text-foreground data-pressed:bg-secondary data-pressed:text-foreground focus-visible:relative focus-visible:z-raised focus-ring data-disabled:cursor-disabled data-disabled:opacity-50 data-disabled:hover:text-muted-foreground rounded-md data-pressed:shadow-sm h-7 px-2.5 text-[12px]">Monthly</button><button type="button" aria-disabled="false" tabindex="-1" aria-pressed="false" class="inline-flex shrink-0 items-center justify-center gap-2 font-medium whitespace-nowrap text-muted-foreground transition-colors select-none hover:text-foreground data-pressed:bg-secondary data-pressed:text-foreground focus-visible:relative focus-visible:z-raised focus-ring data-disabled:cursor-disabled data-disabled:opacity-50 data-disabled:hover:text-muted-foreground rounded-md data-pressed:shadow-sm h-7 px-2.5 text-[12px]">Annual</button></div><div class="flex flex-wrap items-center gap-2"><button type="button" tabindex="0" class="inline-flex shrink-0 items-center justify-center font-semibold whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 border border-border bg-card text-foreground shadow-sm not-data-[disabled]:hover:bg-secondary/70 h-control gap-1.5 px-control text-[13px] rounded-lg">Manage</button><button type="button" tabindex="0" class="inline-flex shrink-0 items-center justify-center font-semibold whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 bg-primary text-primary-foreground shadow-sm not-data-[disabled]:hover:bg-primary/90 h-control gap-1.5 px-control text-[13px] rounded-lg"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sparkles lucide-stars" aria-hidden="true"><path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"></path><path d="M20 2v4"></path><path d="M22 4h-4"></path><circle cx="4" cy="20" r="2"></circle></svg>Upgrade</button></div></div></div><ul aria-label="Fixture Plan plan features" class="mt-5 grid gap-x-6 gap-y-2 border-t border-border pt-5 sm:grid-cols-2"><li class="flex items-start gap-2 text-[13px] text-foreground"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check mt-0.5 shrink-0 text-primary-text" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg>Feature A</li><li class="flex items-start gap-2 text-[13px] text-foreground"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check mt-0.5 shrink-0 text-primary-text" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg>Feature B</li></ul></div></div>"`;
|
|
4
4
|
|
|
5
|
-
exports[`PlanCard billing DOM baseline > preserves the no-props billing header 1`] = `"<div><div class="overflow-hidden rounded-xl border border-border text-card-foreground bg-card shadow-sm p-6"><div class="flex flex-col gap-5 sm:flex-row sm:items-start sm:justify-between"><div class="min-w-0"><div class="flex flex-wrap items-center gap-2"><h3 class="text-[17px] font-semibold tracking-tight text-foreground">Scale plan</h3><span class="inline-flex max-w-full shrink-0 items-center gap-1.5 font-semibold whitespace-nowrap select-none h-chip px-2.5 font-mono text-[10.5px] rounded-md
|
|
5
|
+
exports[`PlanCard billing DOM baseline > preserves the no-props billing header 1`] = `"<div><div class="overflow-hidden rounded-xl border border-border text-card-foreground bg-card shadow-sm p-6"><div class="flex flex-col gap-5 sm:flex-row sm:items-start sm:justify-between"><div class="min-w-0"><div class="flex flex-wrap items-center gap-2"><h3 class="text-[17px] font-semibold tracking-tight text-foreground">Scale plan</h3><span data-tone="success" class="inline-flex max-w-full shrink-0 items-center gap-1.5 font-semibold whitespace-nowrap select-none [--badge-bg-alpha:15%] [--badge-border-alpha:45%] bg-tone/(--badge-bg-alpha) text-tone-chip-text h-chip px-2.5 font-mono text-[10.5px] rounded-md"><span aria-hidden="true" class="size-1.5 shrink-0 rounded-full bg-tone"></span>Active</span></div><p class="mt-1 text-[13px] text-muted-foreground">Renews June 1, 2026 · 50 seats · 2 regions</p><p class="mt-4 flex items-baseline gap-1.5"><span class="text-[30px] font-semibold tracking-tight text-foreground tabular-nums">$1,200</span><span class="text-[13px] text-muted-foreground">/ month</span></p><p class="mt-1 text-[12px] text-muted-foreground">Billed monthly</p></div><div class="flex flex-col items-start gap-3 sm:items-end"><div data-orientation="horizontal" role="group" aria-label="Billing cycle" class="inline-flex data-[orientation=vertical]:flex-col data-disabled:opacity-50 items-center gap-0.5 rounded-lg border border-border bg-card p-0.5 shadow-sm"><button type="button" data-pressed="" aria-disabled="false" tabindex="0" aria-pressed="true" class="inline-flex shrink-0 items-center justify-center gap-2 font-medium whitespace-nowrap text-muted-foreground transition-colors select-none hover:text-foreground data-pressed:bg-secondary data-pressed:text-foreground focus-visible:relative focus-visible:z-raised focus-ring data-disabled:cursor-disabled data-disabled:opacity-50 data-disabled:hover:text-muted-foreground rounded-md data-pressed:shadow-sm h-7 px-2.5 text-[12px]">Monthly</button><button type="button" aria-disabled="false" tabindex="-1" aria-pressed="false" class="inline-flex shrink-0 items-center justify-center gap-2 font-medium whitespace-nowrap text-muted-foreground transition-colors select-none hover:text-foreground data-pressed:bg-secondary data-pressed:text-foreground focus-visible:relative focus-visible:z-raised focus-ring data-disabled:cursor-disabled data-disabled:opacity-50 data-disabled:hover:text-muted-foreground rounded-md data-pressed:shadow-sm h-7 px-2.5 text-[12px]">Annual −17%</button></div><div class="flex flex-wrap items-center gap-2"><button type="button" tabindex="0" class="inline-flex shrink-0 items-center justify-center font-semibold whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 border border-border bg-card text-foreground shadow-sm not-data-[disabled]:hover:bg-secondary/70 h-control gap-1.5 px-control text-[13px] rounded-lg">Manage</button><button type="button" tabindex="0" class="inline-flex shrink-0 items-center justify-center font-semibold whitespace-nowrap transition-colors select-none cursor-interactive focus-ring data-[disabled]:cursor-disabled data-[disabled]:opacity-50 bg-primary text-primary-foreground shadow-sm not-data-[disabled]:hover:bg-primary/90 h-control gap-1.5 px-control text-[13px] rounded-lg"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sparkles lucide-stars" aria-hidden="true"><path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"></path><path d="M20 2v4"></path><path d="M22 4h-4"></path><circle cx="4" cy="20" r="2"></circle></svg>Upgrade plan</button></div></div></div><ul aria-label="Scale plan features" class="mt-5 grid gap-x-6 gap-y-2 border-t border-border pt-5 sm:grid-cols-2"><li class="flex items-start gap-2 text-[13px] text-foreground"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check mt-0.5 shrink-0 text-primary-text" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg>500,000 requests / month</li><li class="flex items-start gap-2 text-[13px] text-foreground"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check mt-0.5 shrink-0 text-primary-text" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg>120M tokens / month</li><li class="flex items-start gap-2 text-[13px] text-foreground"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check mt-0.5 shrink-0 text-primary-text" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg>20 GB storage</li><li class="flex items-start gap-2 text-[13px] text-foreground"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check mt-0.5 shrink-0 text-primary-text" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg>Audit log and SSO</li><li class="flex items-start gap-2 text-[13px] text-foreground"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check mt-0.5 shrink-0 text-primary-text" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg>Email support · 1 business day</li></ul></div></div>"`;
|
|
@@ -10,10 +10,7 @@ export default function Compact() {
|
|
|
10
10
|
actions={
|
|
11
11
|
<>
|
|
12
12
|
<Button onClick={() => window.alert('Edit')}>Edit</Button>
|
|
13
|
-
<a
|
|
14
|
-
href="#tenants"
|
|
15
|
-
className="text-primary-text underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring"
|
|
16
|
-
>
|
|
13
|
+
<a href="#tenants" className="text-primary-text underline focus-ring">
|
|
17
14
|
View tenants
|
|
18
15
|
</a>
|
|
19
16
|
</>
|
|
@@ -10,10 +10,7 @@ export default function Full() {
|
|
|
10
10
|
actions={
|
|
11
11
|
<>
|
|
12
12
|
<Button onClick={() => window.alert('Edit')}>Edit</Button>
|
|
13
|
-
<a
|
|
14
|
-
href="#tenants"
|
|
15
|
-
className="text-primary-text underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring"
|
|
16
|
-
>
|
|
13
|
+
<a href="#tenants" className="text-primary-text underline focus-ring">
|
|
17
14
|
View tenants
|
|
18
15
|
</a>
|
|
19
16
|
</>
|
|
@@ -198,7 +198,7 @@ export function CodePanel({
|
|
|
198
198
|
</Tabs>
|
|
199
199
|
<div className="border-t border-border">
|
|
200
200
|
<div className="flex items-center gap-3 bg-secondary/35 px-3 py-2">
|
|
201
|
-
<ProblemsHeading className="text-[12px] font-semibold tracking-wide text-foreground
|
|
201
|
+
<ProblemsHeading className="text-[12px] font-semibold tracking-wide text-foreground label-case">
|
|
202
202
|
Problems
|
|
203
203
|
</ProblemsHeading>
|
|
204
204
|
<span className="font-mono text-[11px] text-muted-foreground">
|
|
@@ -217,7 +217,7 @@ export function CodePanel({
|
|
|
217
217
|
<button
|
|
218
218
|
type="button"
|
|
219
219
|
onClick={() => selectProblem(p)}
|
|
220
|
-
className="flex w-full items-start gap-2 px-3 py-1.5 text-start text-[12.5px] hover:bg-secondary/60 focus-
|
|
220
|
+
className="flex w-full items-start gap-2 px-3 py-1.5 text-start text-[12.5px] hover:bg-secondary/60 focus-ring-inset"
|
|
221
221
|
>
|
|
222
222
|
<SevIcon size={14} aria-hidden className={cn('mt-0.5 shrink-0', sev.className)} />
|
|
223
223
|
<span className="sr-only">{sev.label}:</span>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { useEffect, useRef, useState,
|
|
1
|
+
import { useEffect, useRef, useState, type ReactNode } from 'react';
|
|
2
|
+
import { breakpointQuery } from '@gntik-ai/tokens/runtime';
|
|
2
3
|
import { Play } from '@gntik-ai/icons';
|
|
3
4
|
import { FlowCanvas, type FlowCanvasProps, type FlowNode, type FlowNodeData, type FlowNodeKind } from '@gntik-ai/flow';
|
|
4
|
-
import { Button, ResizablePanel, ResizablePanelGroup, ResizeHandle, cn } from '@gntik-ai/ui';
|
|
5
|
+
import { Button, ResizablePanel, ResizablePanelGroup, ResizeHandle, cn, useMediaQuery } from '@gntik-ai/ui';
|
|
5
6
|
import {
|
|
6
7
|
builderConsole,
|
|
7
8
|
builderEdges,
|
|
@@ -88,22 +89,6 @@ export interface FlowBuilderProps<Kind extends string = FlowNodeKind> extends Fl
|
|
|
88
89
|
export type FlowRunResult = ConsoleEntry[] | void | undefined;
|
|
89
90
|
|
|
90
91
|
const NO_ISSUES: NonNullable<FlowBuilderProps['validationIssues']> = [];
|
|
91
|
-
const WIDE_QUERY = '(min-width: 768px)';
|
|
92
|
-
|
|
93
|
-
function subscribeWide(onChange: () => void) {
|
|
94
|
-
if (typeof window === 'undefined' || !window.matchMedia) return () => {};
|
|
95
|
-
const mql = window.matchMedia(WIDE_QUERY);
|
|
96
|
-
mql.addEventListener?.('change', onChange);
|
|
97
|
-
return () => mql.removeEventListener?.('change', onChange);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function useIsWide() {
|
|
101
|
-
return useSyncExternalStore(
|
|
102
|
-
subscribeWide,
|
|
103
|
-
() => (typeof window !== 'undefined' && window.matchMedia ? window.matchMedia(WIDE_QUERY).matches : true),
|
|
104
|
-
() => true,
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
92
|
|
|
108
93
|
function clock() {
|
|
109
94
|
return new Date().toLocaleTimeString('en-GB', { hour12: false });
|
|
@@ -144,7 +129,7 @@ export function FlowBuilder<Kind extends string = FlowNodeKind>({
|
|
|
144
129
|
const flow = useRef<
|
|
145
130
|
Parameters<NonNullable<FlowCanvasProps<FlowNode<Kind | FlowNodeKind>, FlowEdge>['onInit']>>[0] | null
|
|
146
131
|
>(null);
|
|
147
|
-
const wide =
|
|
132
|
+
const wide = useMediaQuery(breakpointQuery('md'), true);
|
|
148
133
|
const panelAs = TitleTag === 'h2' ? 'h3' : TitleTag === 'h3' ? 'h4' : 'h5';
|
|
149
134
|
const { nodes, edges, setNodes, setEdges, onNodesChange, onEdgesChange } = useBuilderGraph<Kind>(
|
|
150
135
|
{ nodes: initialNodes, edges: initialEdges },
|
|
@@ -16,7 +16,7 @@ import type { ConsoleEntry, PaletteItem } from './fixtures';
|
|
|
16
16
|
export type PanelHeading = 'h3' | 'h4' | 'h5';
|
|
17
17
|
|
|
18
18
|
const panelTitle =
|
|
19
|
-
'px-3 pt-3 pb-2 font-mono text-[10.5px] font-medium tracking-[0.12em] text-muted-foreground
|
|
19
|
+
'px-3 pt-3 pb-2 font-mono text-[10.5px] font-medium tracking-[0.12em] text-muted-foreground label-case';
|
|
20
20
|
|
|
21
21
|
export interface NodePaletteProps {
|
|
22
22
|
items: PaletteItem[];
|
|
@@ -41,7 +41,7 @@ export function NodePalette({ items, onAdd, titleAs: TitleTag = 'h3' }: NodePale
|
|
|
41
41
|
onClick={() => onAdd(item)}
|
|
42
42
|
aria-label={`Add ${item.title}`}
|
|
43
43
|
title={item.description}
|
|
44
|
-
className="group flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-start hover:bg-secondary/70 focus-
|
|
44
|
+
className="group flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-start hover:bg-secondary/70 focus-ring"
|
|
45
45
|
>
|
|
46
46
|
<span className={cn('grid size-7 shrink-0 place-items-center rounded-md', KIND_CHIP[item.kind])}>
|
|
47
47
|
<KindGlyph kind={item.kind} size={14} />
|
|
@@ -177,7 +177,7 @@ export function RunConsole({ entries, onClear, titleAs: TitleTag = 'h3' }: RunCo
|
|
|
177
177
|
role="log"
|
|
178
178
|
aria-label="Run console"
|
|
179
179
|
tabIndex={0}
|
|
180
|
-
className="flex-1 overflow-y-auto px-3 py-2 font-mono text-[11.5px] focus-
|
|
180
|
+
className="flex-1 overflow-y-auto px-3 py-2 font-mono text-[11.5px] focus-ring-inset"
|
|
181
181
|
>
|
|
182
182
|
{entries.length === 0 ? (
|
|
183
183
|
<p className="font-sans text-[12.5px] text-muted-foreground">No output yet. Run the flow to see its steps.</p>
|
|
@@ -185,7 +185,7 @@ export function RunConsole({ entries, onClear, titleAs: TitleTag = 'h3' }: RunCo
|
|
|
185
185
|
entries.map((e) => (
|
|
186
186
|
<p key={e.id} className="flex gap-3 py-0.5">
|
|
187
187
|
<span className="shrink-0 text-muted-foreground tabular-nums">{e.time}</span>
|
|
188
|
-
<span className={cn('w-14 shrink-0
|
|
188
|
+
<span className={cn('w-14 shrink-0 label-case', CONSOLE_LEVEL[e.level])}>{e.level}</span>
|
|
189
189
|
<span className="min-w-0 text-foreground">{e.message}</span>
|
|
190
190
|
</p>
|
|
191
191
|
))
|