-
Notifications
You must be signed in to change notification settings - Fork 467
feat(ui): Reverification block views #9598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1b47ddf
feat(ui): make Card footer divider content-aware
austincalvelage 6fb7556
feat(ui): add reverification views
austincalvelage 0953593
docs(swingset): add reverification stories
austincalvelage 09e0292
chore(repo): add reverification changeset
austincalvelage e8c6127
feat(ui): add max width to Card
austincalvelage 1eb26d4
feat(ui): remove Otp size variants
austincalvelage 0191c76
chore(repo): make reverification changeset empty
austincalvelage File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| --- | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import * as Stories from './reverification-backup-code.stories'; | ||
|
|
||
| # ReverificationBackupCode | ||
|
|
||
| The backup-code card content used by the reverification flow. | ||
|
|
||
| <Story name='Default' storyModule={Stories} composition={[{ name: 'Card', href: '/components/card', layer: 'Components' }]} /> |
39 changes: 39 additions & 0 deletions
39
packages/swingset/src/stories/reverification-backup-code.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { ReverificationBackupCode } from '@clerk/ui/mosaic/blocks/reverification'; | ||
| import React from 'react'; | ||
|
|
||
| import type { StoryMeta } from '@/lib/types'; | ||
|
|
||
| import { ReverificationStoryCard } from './reverification-story-card'; | ||
|
|
||
| export { default as __source } from './reverification-backup-code.stories?raw'; | ||
|
|
||
| export const meta: StoryMeta = { | ||
| group: 'Blocks', | ||
| title: 'ReverificationBackupCode', | ||
| label: 'Backup code', | ||
| navigation: { category: 'Reverification' }, | ||
| source: 'packages/ui/src/mosaic/blocks/reverification/reverification-backup-code.tsx', | ||
| }; | ||
|
|
||
| export function Default() { | ||
| const [value, setValue] = React.useState(''); | ||
|
|
||
| return ( | ||
| <ReverificationStoryCard> | ||
| <ReverificationBackupCode | ||
| messages={{ | ||
| title: 'Enter a backup code', | ||
| description: 'Enter the backup code you received when setting up two-step authentication', | ||
| fieldLabel: 'Backup code', | ||
| secondaryActionLabel: 'Cancel', | ||
| primaryActionLabel: 'Continue', | ||
| pendingLabel: 'Verifying', | ||
| }} | ||
| value={value} | ||
| onValueChange={setValue} | ||
| onSubmit={() => undefined} | ||
| onCancel={() => setValue('')} | ||
| /> | ||
| </ReverificationStoryCard> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import * as Stories from './reverification-help.stories'; | ||
|
|
||
| # ReverificationHelp | ||
|
|
||
| The help card content used by the reverification flow. | ||
|
|
||
| <Story name='Default' storyModule={Stories} composition={[{ name: 'Card', href: '/components/card', layer: 'Components' }]} /> |
33 changes: 33 additions & 0 deletions
33
packages/swingset/src/stories/reverification-help.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import { ReverificationHelp } from '@clerk/ui/mosaic/blocks/reverification'; | ||
|
|
||
| import type { StoryMeta } from '@/lib/types'; | ||
|
|
||
| import { ReverificationStoryCard } from './reverification-story-card'; | ||
|
|
||
| export { default as __source } from './reverification-help.stories?raw'; | ||
|
|
||
| export const meta: StoryMeta = { | ||
| group: 'Blocks', | ||
| title: 'ReverificationHelp', | ||
| label: 'Help', | ||
| navigation: { category: 'Reverification' }, | ||
| source: 'packages/ui/src/mosaic/blocks/reverification/reverification-help.tsx', | ||
| }; | ||
|
|
||
| export function Default() { | ||
| return ( | ||
| <ReverificationStoryCard> | ||
| <ReverificationHelp | ||
| messages={{ | ||
| title: 'Get help', | ||
| description: | ||
| 'If you have trouble verifying your account, email us and we will work with you to restore access as soon as possible.', | ||
| backButton: 'Back', | ||
| supportButton: 'Email support', | ||
| }} | ||
| onEmailSupport={() => undefined} | ||
| onBack={() => undefined} | ||
| /> | ||
| </ReverificationStoryCard> | ||
| ); | ||
| } |
7 changes: 7 additions & 0 deletions
7
packages/swingset/src/stories/reverification-method-picker.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import * as Stories from './reverification-method-picker.stories'; | ||
|
|
||
| # ReverificationMethodPicker | ||
|
|
||
| The alternative-method picker content used by the reverification flow. | ||
|
|
||
| <Story name='Default' storyModule={Stories} composition={[{ name: 'Card', href: '/components/card', layer: 'Components' }]} /> |
44 changes: 44 additions & 0 deletions
44
packages/swingset/src/stories/reverification-method-picker.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import { ReverificationMethodPicker } from '@clerk/ui/mosaic/blocks/reverification'; | ||
| import React from 'react'; | ||
|
|
||
| import type { StoryMeta } from '@/lib/types'; | ||
|
|
||
| import { ReverificationStoryCard } from './reverification-story-card'; | ||
|
|
||
| export { default as __source } from './reverification-method-picker.stories?raw'; | ||
|
|
||
| export const meta: StoryMeta = { | ||
| group: 'Blocks', | ||
| title: 'ReverificationMethodPicker', | ||
| label: 'Method picker', | ||
| navigation: { category: 'Reverification' }, | ||
| source: 'packages/ui/src/mosaic/blocks/reverification/reverification-method-picker.tsx', | ||
| }; | ||
|
|
||
| export function Default() { | ||
| const [pendingMethodId, setPendingMethodId] = React.useState<string>(); | ||
|
|
||
| return ( | ||
| <ReverificationStoryCard> | ||
| <ReverificationMethodPicker | ||
| messages={{ | ||
| title: 'Use another method', | ||
| description: 'Facing issues? You can use any of these methods for verification.', | ||
| backButton: 'Back', | ||
| helpText: 'Don’t have any of these?', | ||
| helpButton: 'Get help', | ||
| }} | ||
| methods={[ | ||
| { id: 'password', label: 'Continue with your password', icon: 'security-lock-square' }, | ||
| { id: 'phone', label: 'Send SMS code to ••• ••• 1234', icon: 'security-phone' }, | ||
| { id: 'totp', label: 'Use your authenticator app', icon: 'security-authenticator' }, | ||
| { id: 'passkey', label: 'Use your passkey', icon: 'security-passkey' }, | ||
| ]} | ||
| pendingMethodId={pendingMethodId} | ||
| onSelect={setPendingMethodId} | ||
| onHelp={() => undefined} | ||
| onBack={() => setPendingMethodId(undefined)} | ||
| /> | ||
| </ReverificationStoryCard> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import * as Stories from './reverification-otp.stories'; | ||
|
|
||
| # ReverificationOTP | ||
|
|
||
| The one-time-code card content used by the reverification flow. | ||
|
|
||
| <Story name='Default' storyModule={Stories} composition={[{ name: 'Card', href: '/components/card', layer: 'Components' }]} /> | ||
|
|
||
| <Story name='Authenticator' storyModule={Stories} composition={[{ name: 'Card', href: '/components/card', layer: 'Components' }]} /> | ||
|
Comment on lines
+3
to
+9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win Add the required documentation sections. Each reverification page must include Apply this to:
📍 Affects 2 files
🤖 Prompt for AI AgentsSource: Coding guidelines |
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.