-
Notifications
You must be signed in to change notification settings - Fork 380
feat(clerk-js,clerk-react,types): Introduce TaskChooseOrganization
#6446
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
LauraBeatris
merged 43 commits into
main
from
laura/orgs-764-introduce-new-ui-for-taskselectorganization-component-2
Aug 6, 2025
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
96dd1b0
Remove tasks handling from orgs AIOs
LauraBeatris 0f1f9b8
Add component to sandbox playground
LauraBeatris c1bbf90
Add localization keys
LauraBeatris 0309250
Add basic UI structure with header and footer
LauraBeatris 52bd271
Add initial structure for create org screen
LauraBeatris 0469b25
chore: format template.html
iagodahlem 798efa1
Add basic version for org list screen
LauraBeatris dfdee22
Extract organization avatar to a shared component
LauraBeatris 6fc564b
Extract organization preview components to shared module
LauraBeatris d99c7d3
Introduce specific descriptors for `TaskSelectOrganization`
LauraBeatris 8a06eff
refactor: update TaskSelectOrganization spacing
iagodahlem e7966b6
fix: add missing translation keys
iagodahlem 7415b35
feat: implement signout action
iagodahlem 9365dd2
chore: update card gap
iagodahlem 5a8bf60
Always display slug field on create form
LauraBeatris 38ce37e
Handle sign out with multi-session
LauraBeatris 9498d48
Do not render identifier if not email or username
LauraBeatris 5395dde
Add unit tests
LauraBeatris f6ae7f6
Extract `useOrganizationListInView` to separate file
LauraBeatris 937abcd
Do not use OrganizationList components
LauraBeatris 4a9fa4a
Use common components on OrganizationList
LauraBeatris e5a7f47
Add changeset
LauraBeatris 98af5a0
chore: format template.html
iagodahlem d40e808
Truncate identifier
iagodahlem cff4295
Fix data mocking for tests
LauraBeatris edda41b
Bump `clerk.js` max bundle size
LauraBeatris 9aff5a7
Use default gap and remove unused styles
LauraBeatris af167c4
Update gap for avatar uploader button
LauraBeatris 1485c58
Update horizontal gap for sign out action
LauraBeatris 6ee7498
Update icon for avatar uploader
LauraBeatris 3978ebc
Update localization keys to remove `screen` prefix
LauraBeatris 6a84a0d
Update identifier truncate
iagodahlem 7313027
Fix footer layout
LauraBeatris b11fe3b
fix: address footer action alignment
iagodahlem 25b2551
Update guard to update to sign-in on undefined session
LauraBeatris a4e3c51
Revalidate server cache on `navigateToTask`
LauraBeatris 3fe79ee
Fix unit tests mock for `isEligibleForTouch`
LauraBeatris 0192b52
Remove logo field from create org form
LauraBeatris 1fc4022
Introduce different headings per screen
LauraBeatris bac7a96
Update copy per feedback
LauraBeatris 0b5fac0
Rollback unused changes
LauraBeatris caac240
Rename `TaskSelectOrganization` to `TaskChooseOrganization`
LauraBeatris 9497c2c
Introduce new changeset
LauraBeatris 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,13 @@ | ||
--- | ||
'@clerk/tanstack-react-start': patch | ||
'@clerk/localizations': patch | ||
'@clerk/react-router': patch | ||
'@clerk/clerk-js': patch | ||
'@clerk/testing': patch | ||
'@clerk/nextjs': patch | ||
'@clerk/clerk-react': patch | ||
'@clerk/remix': patch | ||
'@clerk/types': patch | ||
--- | ||
|
||
Introduce `TaskChooseOrganization` component which replaces `TaskSelectOrganization` with a new UI that make the experience similar to the previous `SignIn` and `SignUp` steps |
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
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
138 changes: 138 additions & 0 deletions
138
packages/clerk-js/src/ui/common/organizations/OrganizationPreview.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,138 @@ | ||
import type { UserOrganizationInvitationResource } from '@clerk/types'; | ||
import type { PropsWithChildren } from 'react'; | ||
import { forwardRef } from 'react'; | ||
|
||
import type { ElementDescriptor } from '@/ui/customizables/elementDescriptors'; | ||
import { OrganizationPreview } from '@/ui/elements/OrganizationPreview'; | ||
import { PreviewButton } from '@/ui/elements/PreviewButton'; | ||
|
||
import { Box, Button, Col, descriptors, Flex, Spinner } from '../../customizables'; | ||
import { SwitchArrowRight } from '../../icons'; | ||
import type { ThemableCssProp } from '../../styledSystem'; | ||
import { common } from '../../styledSystem'; | ||
|
||
type OrganizationPreviewListItemsProps = PropsWithChildren<{ | ||
elementDescriptor: ElementDescriptor; | ||
}>; | ||
|
||
export const OrganizationPreviewListItems = ({ elementDescriptor, children }: OrganizationPreviewListItemsProps) => { | ||
return ( | ||
<Col | ||
elementDescriptor={elementDescriptor} | ||
sx={t => ({ | ||
maxHeight: `calc(8 * ${t.sizes.$12})`, | ||
overflowY: 'auto', | ||
borderTopWidth: t.borderWidths.$normal, | ||
borderTopStyle: t.borderStyles.$solid, | ||
borderTopColor: t.colors.$borderAlpha100, | ||
...common.unstyledScrollbar(t), | ||
})} | ||
> | ||
{children} | ||
</Col> | ||
); | ||
}; | ||
|
||
const sharedStyles: ThemableCssProp = t => ({ | ||
padding: `${t.space.$4} ${t.space.$5}`, | ||
}); | ||
|
||
export const sharedMainIdentifierSx: ThemableCssProp = t => ({ | ||
color: t.colors.$colorForeground, | ||
':hover': { | ||
color: t.colors.$colorForeground, | ||
}, | ||
}); | ||
|
||
type OrganizationPreviewListItemProps = PropsWithChildren<{ | ||
elementId: React.ComponentProps<typeof OrganizationPreview>['elementId']; | ||
elementDescriptor: React.ComponentProps<typeof OrganizationPreview>['elementDescriptor']; | ||
organizationData: UserOrganizationInvitationResource['publicOrganizationData']; | ||
}>; | ||
|
||
export const OrganizationPreviewListItem = ({ | ||
children, | ||
elementId, | ||
elementDescriptor, | ||
organizationData, | ||
}: OrganizationPreviewListItemProps) => { | ||
return ( | ||
<Flex | ||
align='center' | ||
gap={2} | ||
sx={[ | ||
t => ({ | ||
minHeight: 'unset', | ||
justifyContent: 'space-between', | ||
borderTopWidth: t.borderWidths.$normal, | ||
borderTopStyle: t.borderStyles.$solid, | ||
borderTopColor: t.colors.$borderAlpha100, | ||
}), | ||
sharedStyles, | ||
]} | ||
elementDescriptor={elementDescriptor} | ||
> | ||
<OrganizationPreview | ||
elementId={elementId} | ||
mainIdentifierSx={sharedMainIdentifierSx} | ||
organization={organizationData} | ||
/> | ||
{children} | ||
</Flex> | ||
); | ||
}; | ||
|
||
export const OrganizationPreviewSpinner = forwardRef<HTMLDivElement>((_, ref) => { | ||
return ( | ||
<Box | ||
ref={ref} | ||
sx={t => ({ | ||
width: '100%', | ||
height: t.space.$12, | ||
position: 'relative', | ||
})} | ||
> | ||
<Box | ||
sx={{ | ||
margin: 'auto', | ||
position: 'absolute', | ||
left: '50%', | ||
top: '50%', | ||
transform: 'translateY(-50%) translateX(-50%)', | ||
}} | ||
> | ||
<Spinner | ||
size='sm' | ||
colorScheme='primary' | ||
elementDescriptor={descriptors.spinner} | ||
/> | ||
</Box> | ||
</Box> | ||
); | ||
}); | ||
|
||
export const OrganizationPreviewListItemButton = (props: Parameters<typeof Button>[0]) => { | ||
return ( | ||
<Button | ||
textVariant='buttonSmall' | ||
variant='outline' | ||
size='xs' | ||
{...props} | ||
/> | ||
); | ||
}; | ||
|
||
type OrganizationPreviewButtonProps = PropsWithChildren<{ | ||
onClick: () => void | Promise<void>; | ||
elementDescriptor: ElementDescriptor; | ||
}>; | ||
|
||
export const OrganizationPreviewButton = (props: OrganizationPreviewButtonProps) => { | ||
return ( | ||
<PreviewButton | ||
sx={[sharedStyles]} | ||
icon={SwitchArrowRight} | ||
{...props} | ||
/> | ||
); | ||
}; |
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.