Skip to content

Commit 75ad0fd

Browse files
authored
Merge pull request #10 from PJ-Snap/patch-1
Update organization_components.py
2 parents 4641530 + 020fb9f commit 75ad0fd

File tree

5 files changed

+1116
-955
lines changed

5 files changed

+1116
-955
lines changed

Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ tasks:
5757
- git diff --quiet --staged || (echo "There are staged changes. They must be committed first" && exit 1)
5858
- git diff --quiet || (echo "There are unstaged changes. They must be committed first." && exit 1)
5959

60-
- uv run hatch version | xargs -I {} git tag -a v{} -m "Release v{}"
60+
- uvx hatch version | xargs -I {} git tag -a v{} -m "Release v{}"
6161
- git push --follow-tags
6262

6363
pre-commit-all:

custom_components/reflex_clerk_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.0.1"
1+
__version__ = "1.0.2"
22

33
from .authentication_components import sign_in, sign_up
44
from .clerk_provider import (
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
from typing import Optional
2+
3+
from reflex_clerk_api.base import ClerkBase
4+
5+
6+
class CreateOrganization(ClerkBase):
7+
"""
8+
The CreateOrganization component provides a form for users to create new organizations.
9+
10+
This component renders Clerk's <CreateOrganization /> React component,
11+
allowing users to set up new organizations with customizable appearance and routing.
12+
13+
Props:
14+
appearance: Optional object to style your components. Will only affect Clerk components.
15+
path: The path where the component is mounted when routing is set to 'path'.
16+
routing: The routing strategy for your pages. Defaults to 'path' for frameworks
17+
that handle routing, or 'hash' for other SDKs.
18+
after_create_organization_url: The full URL or path to navigate to after creating an organization.
19+
fallback: An optional element to be rendered while the component is mounting.
20+
"""
21+
22+
tag = "CreateOrganization"
23+
24+
# Optional props that CreateOrganization supports
25+
appearance: Optional[str] = None
26+
path: Optional[str] = None
27+
routing: Optional[str] = None
28+
after_create_organization_url: Optional[str] = None
29+
fallback: Optional[str] = None
30+
31+
32+
class OrganizationProfile(ClerkBase):
33+
"""
34+
The OrganizationProfile component allows users to manage their organization membership and security settings.
35+
36+
This component renders Clerk's <OrganizationProfile /> React component,
37+
allowing users to manage organization information, members, billing, and security settings.
38+
39+
Props:
40+
appearance: Optional object to style your components. Will only affect Clerk components.
41+
path: The path where the component is mounted when routing is set to 'path'.
42+
routing: The routing strategy for your pages. Defaults to 'path' for frameworks
43+
that handle routing, or 'hash' for other SDKs.
44+
after_leave_organization_url: The full URL or path to navigate to after leaving an organization.
45+
custom_pages: An array of custom pages to add to the organization profile.
46+
fallback: An optional element to be rendered while the component is mounting.
47+
"""
48+
49+
tag = "OrganizationProfile"
50+
51+
# Optional props that OrganizationProfile supports
52+
appearance: Optional[str] = None
53+
path: Optional[str] = None
54+
routing: Optional[str] = None
55+
after_leave_organization_url: Optional[str] = None
56+
custom_pages: Optional[str] = None
57+
fallback: Optional[str] = None
58+
59+
60+
class OrganizationSwitcher(ClerkBase):
61+
"""
62+
The OrganizationSwitcher component displays the currently active organization and allows users to switch between organizations.
63+
64+
This component renders Clerk's <OrganizationSwitcher /> React component,
65+
providing a dropdown interface for organization switching with customizable appearance.
66+
67+
Props:
68+
appearance: Optional object to style your components. Will only affect Clerk components.
69+
organization_profile_mode: Controls whether selecting the organization opens as a modal or navigates to a page.
70+
organization_profile_url: The full URL or path leading to the organization management interface.
71+
create_organization_mode: Controls whether selecting create organization opens as a modal or navigates to a page.
72+
create_organization_url: The full URL or path leading to the create organization interface.
73+
after_leave_organization_url: The full URL or path to navigate to after leaving an organization.
74+
after_create_organization_url: The full URL or path to navigate to after creating an organization.
75+
after_select_organization_url: The full URL or path to navigate to after selecting an organization.
76+
default_open: Controls whether the OrganizationSwitcher should open by default during the first render.
77+
hide_personal_account: Controls whether the personal account option is hidden in the switcher.
78+
fallback: An optional element to be rendered while the component is mounting.
79+
"""
80+
81+
tag = "OrganizationSwitcher"
82+
83+
# Optional props that OrganizationSwitcher supports
84+
appearance: Optional[str] = None
85+
organization_profile_mode: Optional[str] = None
86+
organization_profile_url: Optional[str] = None
87+
create_organization_mode: Optional[str] = None
88+
create_organization_url: Optional[str] = None
89+
after_leave_organization_url: Optional[str] = None
90+
after_create_organization_url: Optional[str] = None
91+
after_select_organization_url: Optional[str] = None
92+
default_open: Optional[str] = None
93+
hide_personal_account: Optional[str] = None
94+
fallback: Optional[str] = None
95+
96+
97+
class OrganizationList(ClerkBase):
98+
"""
99+
The OrganizationList component displays a list of organizations that the user is a member of.
100+
101+
This component renders Clerk's <OrganizationList /> React component,
102+
providing an interface to view and manage organization memberships.
103+
104+
Props:
105+
appearance: Optional object to style your components. Will only affect Clerk components.
106+
after_create_organization_url: The full URL or path to navigate to after creating an organization.
107+
after_select_organization_url: The full URL or path to navigate to after selecting an organization.
108+
after_select_personal_url: The full URL or path to navigate to after selecting the personal account.
109+
create_organization_mode: Controls whether selecting create organization opens as a modal or navigates to a page.
110+
create_organization_url: The full URL or path leading to the create organization interface.
111+
hide_personal_account: Controls whether the personal account option is hidden in the list.
112+
skip_invitation_screen: Controls whether to skip the invitation screen when creating an organization.
113+
fallback: An optional element to be rendered while the component is mounting.
114+
"""
115+
116+
tag = "OrganizationList"
117+
118+
# Optional props that OrganizationList supports
119+
appearance: Optional[str] = None
120+
after_create_organization_url: Optional[str] = None
121+
after_select_organization_url: Optional[str] = None
122+
after_select_personal_url: Optional[str] = None
123+
create_organization_mode: Optional[str] = None
124+
create_organization_url: Optional[str] = None
125+
hide_personal_account: Optional[str] = None
126+
skip_invitation_screen: Optional[str] = None
127+
fallback: Optional[str] = None
128+
129+
130+
create_organization = CreateOrganization.create
131+
organization_profile = OrganizationProfile.create
132+
organization_switcher = OrganizationSwitcher.create
133+
organization_list = OrganizationList.create

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,5 @@ dev = [
7171
"ruff>=0.9.10",
7272
"semver>=3.0.4",
7373
"reflex==0.7.5", # https://github.com/reflex-dev/reflex/issues/5114 -- Pinned until this is fixed
74+
"hatchling>=1.27.0",
7475
]

0 commit comments

Comments
 (0)