@better-auth-ui/heroui 1.6.2 → 1.6.4
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/components/auth/additional-field.d.ts +4 -0
- package/dist/components/auth/additional-field.js +270 -0
- package/dist/components/auth/auth-provider.d.ts +4 -6
- package/dist/components/auth/auth-provider.js +12 -11
- package/dist/components/auth/auth.d.ts +1 -1
- package/dist/components/auth/auth.js +54 -28
- package/dist/components/{settings/security → auth/delete-user}/danger-zone.d.ts +3 -4
- package/dist/components/{settings/security → auth/delete-user}/danger-zone.js +1 -1
- package/dist/components/{settings/security → auth/delete-user}/delete-user.d.ts +1 -1
- package/dist/components/auth/delete-user/delete-user.js +95 -0
- package/dist/components/{email → auth/email}/email-changed-email.d.ts +2 -2
- package/dist/components/{email → auth/email}/email-changed-email.js +7 -7
- package/dist/components/{email → auth/email}/email-verification-email.d.ts +2 -2
- package/dist/components/{email → auth/email}/email-verification-email.js +7 -7
- package/dist/components/auth/email/magic-link-email.d.ts +3 -0
- package/dist/components/{email → auth/email}/magic-link-email.js +7 -7
- package/dist/components/auth/email/new-device-email.d.ts +3 -0
- package/dist/components/{email → auth/email}/new-device-email.js +7 -7
- package/dist/components/auth/email/otp-email.d.ts +3 -0
- package/dist/components/{email → auth/email}/otp-email.js +6 -6
- package/dist/components/{email → auth/email}/password-changed-email.d.ts +2 -2
- package/dist/components/{email → auth/email}/password-changed-email.js +7 -7
- package/dist/components/{email → auth/email}/reset-password-email.d.ts +2 -2
- package/dist/components/{email → auth/email}/reset-password-email.js +7 -7
- package/dist/components/auth/error-toaster.d.ts +1 -0
- package/dist/components/auth/error-toaster.js +17 -0
- package/dist/components/auth/forgot-password.d.ts +2 -2
- package/dist/components/auth/forgot-password.js +42 -42
- package/dist/components/auth/magic-link/magic-link-button.d.ts +11 -0
- package/dist/components/auth/magic-link/magic-link-button.js +20 -0
- package/dist/components/auth/magic-link/magic-link.d.ts +16 -0
- package/dist/components/auth/magic-link/magic-link.js +87 -0
- package/dist/components/{settings/account → auth/multi-session}/manage-account.d.ts +2 -6
- package/dist/components/auth/multi-session/manage-account.js +49 -0
- package/dist/components/{settings/account → auth/multi-session}/manage-accounts.d.ts +1 -1
- package/dist/components/auth/multi-session/manage-accounts.js +34 -0
- package/dist/components/{user/switch-account-menu.d.ts → auth/multi-session/switch-account-submenu-content.d.ts} +3 -3
- package/dist/components/auth/multi-session/switch-account-submenu-content.js +29 -0
- package/dist/components/{user/switch-account-item.d.ts → auth/multi-session/switch-account-submenu-item.d.ts} +2 -2
- package/dist/components/auth/multi-session/switch-account-submenu-item.js +20 -0
- package/dist/components/auth/multi-session/switch-account-submenu.d.ts +13 -0
- package/dist/components/auth/multi-session/switch-account-submenu.js +24 -0
- package/dist/components/auth/passkey/passkey-button.d.ts +6 -0
- package/dist/components/auth/passkey/passkey-button.js +24 -0
- package/dist/components/auth/passkey/passkey.js +45 -0
- package/dist/components/{settings/security → auth/passkey}/passkeys.d.ts +1 -1
- package/dist/components/auth/passkey/passkeys.js +106 -0
- package/dist/components/auth/provider-button.d.ts +13 -0
- package/dist/components/auth/provider-button.js +25 -0
- package/dist/components/auth/provider-buttons.d.ts +3 -10
- package/dist/components/auth/provider-buttons.js +14 -22
- package/dist/components/auth/reset-password.d.ts +1 -1
- package/dist/components/auth/reset-password.js +110 -110
- package/dist/components/{settings → auth/settings}/account/account-settings.d.ts +5 -2
- package/dist/components/auth/settings/account/account-settings.js +20 -0
- package/dist/components/auth/settings/account/change-avatar.js +89 -0
- package/dist/components/{settings → auth/settings}/account/change-email.d.ts +1 -1
- package/dist/components/{settings → auth/settings}/account/change-email.js +17 -20
- package/dist/components/{settings → auth/settings}/account/user-profile.d.ts +3 -4
- package/dist/components/auth/settings/account/user-profile.js +86 -0
- package/dist/components/auth/settings/security/active-session.js +59 -0
- package/dist/components/{settings → auth/settings}/security/active-sessions.d.ts +1 -1
- package/dist/components/auth/settings/security/active-sessions.js +34 -0
- package/dist/components/{settings → auth/settings}/security/change-password.d.ts +1 -1
- package/dist/components/auth/settings/security/change-password.js +189 -0
- package/dist/components/auth/settings/security/linked-account.js +56 -0
- package/dist/components/{settings → auth/settings}/security/linked-accounts.d.ts +1 -1
- package/dist/components/auth/settings/security/linked-accounts.js +45 -0
- package/dist/components/{settings → auth/settings}/security/security-settings.d.ts +1 -1
- package/dist/components/auth/settings/security/security-settings.js +22 -0
- package/dist/components/auth/settings/settings.js +45 -0
- package/dist/components/auth/sign-in.d.ts +1 -1
- package/dist/components/auth/sign-in.js +64 -100
- package/dist/components/auth/sign-out.js +11 -11
- package/dist/components/auth/sign-up.d.ts +1 -1
- package/dist/components/auth/sign-up.js +123 -157
- package/dist/components/{settings/account → auth/theme}/appearance.d.ts +3 -6
- package/dist/components/auth/theme/appearance.js +72 -0
- package/dist/components/auth/theme/theme-toggle-item.d.ts +5 -0
- package/dist/components/auth/theme/theme-toggle-item.js +58 -0
- package/dist/components/auth/user/user-avatar.js +29 -0
- package/dist/components/{user → auth/user}/user-button.d.ts +2 -6
- package/dist/components/auth/user/user-button.js +55 -0
- package/dist/components/auth/user/user-view.js +37 -0
- package/dist/components/auth/username/sign-in-username.d.ts +14 -0
- package/dist/components/auth/username/sign-in-username.js +142 -0
- package/dist/components/auth/username/username-field.d.ts +8 -0
- package/dist/components/auth/username/username-field.js +51 -0
- package/dist/email.d.ts +7 -0
- package/dist/email.js +9 -0
- package/dist/index.d.ts +13 -27
- package/dist/index.js +22 -36
- package/dist/lib/auth/auth-plugin.d.ts +44 -0
- package/dist/lib/auth/delete-user-plugin.d.ts +17 -0
- package/dist/lib/auth/delete-user-plugin.js +10 -0
- package/dist/lib/auth/magic-link-plugin.d.ts +31 -0
- package/dist/lib/auth/magic-link-plugin.js +13 -0
- package/dist/lib/auth/multi-session-plugin.d.ts +18 -0
- package/dist/lib/auth/multi-session-plugin.js +12 -0
- package/dist/lib/auth/passkey-plugin.d.ts +20 -0
- package/dist/lib/auth/passkey-plugin.js +12 -0
- package/dist/lib/auth/theme-plugin.d.ts +68 -0
- package/dist/lib/auth/theme-plugin.js +23 -0
- package/dist/lib/auth/username-plugin.d.ts +63 -0
- package/dist/lib/auth/username-plugin.js +18 -0
- package/dist/plugins.d.ts +20 -0
- package/dist/plugins.js +21 -0
- package/package.json +22 -22
- package/src/components/auth/additional-field.tsx +554 -0
- package/src/components/auth/auth-provider.tsx +8 -5
- package/src/components/auth/auth.tsx +100 -36
- package/src/components/{settings/security → auth/delete-user}/danger-zone.tsx +3 -10
- package/src/components/{settings/security → auth/delete-user}/delete-user.tsx +31 -24
- package/src/components/{email → auth/email}/email-changed-email.tsx +2 -2
- package/src/components/{email → auth/email}/email-verification-email.tsx +2 -2
- package/src/components/{email → auth/email}/magic-link-email.tsx +2 -2
- package/src/components/{email → auth/email}/new-device-email.tsx +2 -2
- package/src/components/{email → auth/email}/otp-email.tsx +2 -2
- package/src/components/{email → auth/email}/password-changed-email.tsx +2 -2
- package/src/components/{email → auth/email}/reset-password-email.tsx +2 -2
- package/src/components/auth/error-toaster.tsx +25 -0
- package/src/components/auth/forgot-password.tsx +15 -13
- package/src/components/auth/magic-link/magic-link-button.tsx +61 -0
- package/src/components/auth/{magic-link.tsx → magic-link/magic-link.tsx} +52 -57
- package/src/components/{settings/account → auth/multi-session}/manage-account.tsx +15 -15
- package/src/components/{settings/account → auth/multi-session}/manage-accounts.tsx +16 -12
- package/src/components/{user/switch-account-menu.tsx → auth/multi-session/switch-account-submenu-content.tsx} +19 -17
- package/src/components/{user/switch-account-item.tsx → auth/multi-session/switch-account-submenu-item.tsx} +18 -8
- package/src/components/auth/multi-session/switch-account-submenu.tsx +50 -0
- package/src/components/auth/passkey/passkey-button.tsx +56 -0
- package/src/components/{settings/security → auth/passkey}/passkey.tsx +21 -9
- package/src/components/auth/passkey/passkeys.tsx +196 -0
- package/src/components/auth/provider-button.tsx +65 -0
- package/src/components/auth/provider-buttons.tsx +23 -45
- package/src/components/auth/reset-password.tsx +14 -9
- package/src/components/{settings → auth/settings}/account/account-settings.tsx +15 -13
- package/src/components/{settings → auth/settings}/account/change-avatar.tsx +4 -5
- package/src/components/{settings → auth/settings}/account/change-email.tsx +5 -6
- package/src/components/auth/settings/account/user-profile.tsx +171 -0
- package/src/components/{settings → auth/settings}/security/active-session.tsx +8 -6
- package/src/components/{settings → auth/settings}/security/active-sessions.tsx +5 -10
- package/src/components/{settings → auth/settings}/security/change-password.tsx +22 -14
- package/src/components/{settings → auth/settings}/security/linked-account.tsx +10 -16
- package/src/components/{settings → auth/settings}/security/linked-accounts.tsx +4 -9
- package/src/components/{settings → auth/settings}/security/security-settings.tsx +7 -6
- package/src/components/{settings → auth/settings}/settings.tsx +2 -2
- package/src/components/auth/sign-in.tsx +39 -80
- package/src/components/auth/sign-out.tsx +2 -2
- package/src/components/auth/sign-up.tsx +110 -147
- package/src/components/{settings/account → auth/theme}/appearance.tsx +18 -25
- package/src/components/auth/theme/theme-toggle-item.tsx +110 -0
- package/src/components/{user → auth/user}/user-avatar.tsx +12 -4
- package/src/components/{user → auth/user}/user-button.tsx +15 -88
- package/src/components/{user → auth/user}/user-view.tsx +12 -4
- package/src/components/auth/username/sign-in-username.tsx +283 -0
- package/src/components/auth/username/username-field.tsx +122 -0
- package/src/email.ts +9 -0
- package/src/index.tsx +13 -27
- package/src/lib/auth/auth-plugin.ts +67 -0
- package/src/lib/auth/delete-user-plugin.ts +15 -0
- package/src/lib/auth/magic-link-plugin.ts +26 -0
- package/src/lib/auth/multi-session-plugin.ts +17 -0
- package/src/lib/auth/passkey-plugin.ts +17 -0
- package/src/lib/auth/theme-plugin.ts +86 -0
- package/src/lib/auth/username-plugin.tsx +30 -0
- package/src/plugins.ts +23 -0
- package/dist/components/auth/magic-link-button.d.ts +0 -13
- package/dist/components/auth/magic-link-button.js +0 -16
- package/dist/components/auth/magic-link.d.ts +0 -17
- package/dist/components/auth/magic-link.js +0 -111
- package/dist/components/auth/passkey-button.d.ts +0 -4
- package/dist/components/auth/passkey-button.js +0 -24
- package/dist/components/email/magic-link-email.d.ts +0 -3
- package/dist/components/email/new-device-email.d.ts +0 -3
- package/dist/components/email/otp-email.d.ts +0 -3
- package/dist/components/settings/account/account-settings.js +0 -23
- package/dist/components/settings/account/appearance.js +0 -71
- package/dist/components/settings/account/change-avatar.js +0 -89
- package/dist/components/settings/account/manage-account.js +0 -51
- package/dist/components/settings/account/manage-accounts.js +0 -33
- package/dist/components/settings/account/user-profile.js +0 -106
- package/dist/components/settings/security/active-session.js +0 -62
- package/dist/components/settings/security/active-sessions.js +0 -34
- package/dist/components/settings/security/change-password.js +0 -192
- package/dist/components/settings/security/delete-user.js +0 -97
- package/dist/components/settings/security/linked-account.js +0 -62
- package/dist/components/settings/security/linked-accounts.js +0 -45
- package/dist/components/settings/security/passkey.js +0 -43
- package/dist/components/settings/security/passkeys.js +0 -53
- package/dist/components/settings/security/security-settings.js +0 -25
- package/dist/components/settings/settings.js +0 -45
- package/dist/components/user/switch-account-item.js +0 -20
- package/dist/components/user/switch-account-menu.js +0 -28
- package/dist/components/user/user-avatar.js +0 -29
- package/dist/components/user/user-button.js +0 -91
- package/dist/components/user/user-view.js +0 -37
- package/dist/core.d.ts +0 -1
- package/dist/core.js +0 -1
- package/dist/react-exports.d.ts +0 -1
- package/dist/react-exports.js +0 -1
- package/src/components/auth/magic-link-button.tsx +0 -43
- package/src/components/auth/passkey-button.tsx +0 -36
- package/src/components/settings/account/user-profile.tsx +0 -218
- package/src/components/settings/security/passkeys.tsx +0 -104
- package/src/core.ts +0 -1
- package/src/react-exports.ts +0 -1
- /package/dist/components/{settings/security → auth/passkey}/passkey.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/account/change-avatar.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/security/active-session.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/security/linked-account.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/settings.d.ts +0 -0
- /package/dist/components/{user → auth/user}/user-avatar.d.ts +0 -0
- /package/dist/components/{user → auth/user}/user-view.d.ts +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { AdditionalField as AdditionalFieldConfig } from "@better-auth-ui/core"
|
|
2
|
+
import type {
|
|
3
|
+
AccountCardProps,
|
|
4
|
+
AuthPlugin as AuthPluginPrimitive,
|
|
5
|
+
AuthPluginComponents as BaseAuthPluginComponents,
|
|
6
|
+
SecurityCardProps,
|
|
7
|
+
UserMenuItemProps
|
|
8
|
+
} from "@better-auth-ui/react"
|
|
9
|
+
import type { CardProps } from "@heroui/react"
|
|
10
|
+
import type { ComponentType, ReactNode } from "react"
|
|
11
|
+
|
|
12
|
+
import type { SocialLayout } from "../../components/auth/provider-buttons"
|
|
13
|
+
|
|
14
|
+
/** Props for the heroui `<AdditionalField>` component and `field.render` callbacks. */
|
|
15
|
+
export type AdditionalFieldProps = {
|
|
16
|
+
name: string
|
|
17
|
+
field: AdditionalFieldConfig
|
|
18
|
+
isPending?: boolean
|
|
19
|
+
variant?: CardProps["variant"]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Lives here (rather than next to `<AdditionalField>`) so the augmentation
|
|
23
|
+
// is picked up by consumers who only import from `/plugins`.
|
|
24
|
+
declare module "@better-auth-ui/core" {
|
|
25
|
+
interface AuthPluginRegister {
|
|
26
|
+
heroui: AuthPlugin
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface AdditionalFieldRegister {
|
|
30
|
+
label: ReactNode
|
|
31
|
+
renderProps: AdditionalFieldProps
|
|
32
|
+
renderResult: ReactNode
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Heroui slot component shapes — inherits from the framework-agnostic defaults and narrows slots that receive a heroui variant from the host. */
|
|
37
|
+
export type AuthPluginComponents = Omit<
|
|
38
|
+
BaseAuthPluginComponents,
|
|
39
|
+
"securityCards" | "accountCards"
|
|
40
|
+
> & {
|
|
41
|
+
/** Rendered as cards inside security settings */
|
|
42
|
+
securityCards?: ComponentType<
|
|
43
|
+
SecurityCardProps & { variant?: CardProps["variant"] }
|
|
44
|
+
>[]
|
|
45
|
+
/** Rendered as cards inside account settings */
|
|
46
|
+
accountCards?: ComponentType<
|
|
47
|
+
AccountCardProps & { variant?: CardProps["variant"] }
|
|
48
|
+
>[]
|
|
49
|
+
/** Rendered as items inside the `UserButton` dropdown (e.g. account switcher). */
|
|
50
|
+
userMenuItems?: ComponentType<UserMenuItemProps>[]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Props the heroui `<Auth>` router spreads onto plugin-contributed auth views. */
|
|
54
|
+
export type AuthViewProps = Omit<CardProps, "children"> & {
|
|
55
|
+
socialLayout?: SocialLayout
|
|
56
|
+
socialPosition?: "top" | "bottom"
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Props the heroui `<Settings>` router spreads onto plugin-contributed settings views. */
|
|
60
|
+
export type SettingsViewProps = Omit<CardProps, "children">
|
|
61
|
+
|
|
62
|
+
/** Heroui plugin type. Plugin authors import this from `@better-auth-ui/heroui`. */
|
|
63
|
+
export type AuthPlugin = AuthPluginPrimitive<
|
|
64
|
+
AuthPluginComponents,
|
|
65
|
+
AuthViewProps,
|
|
66
|
+
SettingsViewProps
|
|
67
|
+
>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createAuthPlugin } from "@better-auth-ui/core"
|
|
2
|
+
import {
|
|
3
|
+
deleteUserPlugin as coreDeleteUserPlugin,
|
|
4
|
+
type DeleteUserPluginOptions
|
|
5
|
+
} from "@better-auth-ui/core/plugins"
|
|
6
|
+
|
|
7
|
+
import { DangerZone } from "../../components/auth/delete-user/danger-zone"
|
|
8
|
+
|
|
9
|
+
export const deleteUserPlugin = createAuthPlugin(
|
|
10
|
+
coreDeleteUserPlugin.id,
|
|
11
|
+
(options: DeleteUserPluginOptions = {}) => ({
|
|
12
|
+
...coreDeleteUserPlugin(options),
|
|
13
|
+
securityCards: [DangerZone]
|
|
14
|
+
})
|
|
15
|
+
)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createAuthPlugin } from "@better-auth-ui/core"
|
|
2
|
+
import {
|
|
3
|
+
magicLinkPlugin as coreMagicLinkPlugin,
|
|
4
|
+
type MagicLinkPluginOptions
|
|
5
|
+
} from "@better-auth-ui/core/plugins"
|
|
6
|
+
|
|
7
|
+
import { MagicLink } from "../../components/auth/magic-link/magic-link"
|
|
8
|
+
import { MagicLinkButton } from "../../components/auth/magic-link/magic-link-button"
|
|
9
|
+
|
|
10
|
+
export const magicLinkPlugin = createAuthPlugin(
|
|
11
|
+
coreMagicLinkPlugin.id,
|
|
12
|
+
(options: MagicLinkPluginOptions = {}) => ({
|
|
13
|
+
...coreMagicLinkPlugin(options),
|
|
14
|
+
authButtons: [MagicLinkButton],
|
|
15
|
+
views: {
|
|
16
|
+
auth: { magicLink: MagicLink }
|
|
17
|
+
},
|
|
18
|
+
// Conditional, not an override: when `emailAndPassword.enabled === false`
|
|
19
|
+
// the `<Auth>` router renders this at `/auth/sign-in` instead of the
|
|
20
|
+
// disabled password form. With password auth on, the built-in `SignIn`
|
|
21
|
+
// still wins.
|
|
22
|
+
fallbackViews: {
|
|
23
|
+
auth: { signIn: MagicLink }
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createAuthPlugin } from "@better-auth-ui/core"
|
|
2
|
+
import {
|
|
3
|
+
multiSessionPlugin as coreMultiSessionPlugin,
|
|
4
|
+
type MultiSessionPluginOptions
|
|
5
|
+
} from "@better-auth-ui/core/plugins"
|
|
6
|
+
|
|
7
|
+
import { ManageAccounts } from "../../components/auth/multi-session/manage-accounts"
|
|
8
|
+
import { SwitchAccountSubmenu } from "../../components/auth/multi-session/switch-account-submenu"
|
|
9
|
+
|
|
10
|
+
export const multiSessionPlugin = createAuthPlugin(
|
|
11
|
+
coreMultiSessionPlugin.id,
|
|
12
|
+
(options: MultiSessionPluginOptions = {}) => ({
|
|
13
|
+
...coreMultiSessionPlugin(options),
|
|
14
|
+
accountCards: [ManageAccounts],
|
|
15
|
+
userMenuItems: [SwitchAccountSubmenu]
|
|
16
|
+
})
|
|
17
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createAuthPlugin } from "@better-auth-ui/core"
|
|
2
|
+
import {
|
|
3
|
+
passkeyPlugin as corePasskeyPlugin,
|
|
4
|
+
type PasskeyPluginOptions
|
|
5
|
+
} from "@better-auth-ui/core/plugins"
|
|
6
|
+
|
|
7
|
+
import { PasskeyButton } from "../../components/auth/passkey/passkey-button"
|
|
8
|
+
import { Passkeys } from "../../components/auth/passkey/passkeys"
|
|
9
|
+
|
|
10
|
+
export const passkeyPlugin = createAuthPlugin(
|
|
11
|
+
corePasskeyPlugin.id,
|
|
12
|
+
(options: PasskeyPluginOptions = {}) => ({
|
|
13
|
+
...corePasskeyPlugin(options),
|
|
14
|
+
authButtons: [PasskeyButton],
|
|
15
|
+
securityCards: [Passkeys]
|
|
16
|
+
})
|
|
17
|
+
)
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { createAuthPlugin } from "@better-auth-ui/core"
|
|
2
|
+
import {
|
|
3
|
+
themePlugin as coreThemePlugin,
|
|
4
|
+
type ThemeLocalization
|
|
5
|
+
} from "@better-auth-ui/core/plugins"
|
|
6
|
+
|
|
7
|
+
import { Appearance } from "../../components/auth/theme/appearance"
|
|
8
|
+
import { ThemeToggleItem } from "../../components/auth/theme/theme-toggle-item"
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Hook shape compatible with `next-themes`' `useTheme` and similar APIs. The
|
|
12
|
+
* hook is invoked inside the plugin factory so consumers can register the
|
|
13
|
+
* plugin in the same component as their `<ThemeProvider>` without an extra
|
|
14
|
+
* inner component.
|
|
15
|
+
*/
|
|
16
|
+
export type UseThemeHook = () => {
|
|
17
|
+
theme?: string
|
|
18
|
+
setTheme: (theme: string) => void
|
|
19
|
+
themes?: string[]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type CommonThemeOptions = {
|
|
23
|
+
/**
|
|
24
|
+
* Override the plugin's default localization strings.
|
|
25
|
+
* @remarks `ThemeLocalization`
|
|
26
|
+
*/
|
|
27
|
+
localization?: Partial<ThemeLocalization>
|
|
28
|
+
/**
|
|
29
|
+
* Available theme options.
|
|
30
|
+
* @default ["system", "light", "dark"]
|
|
31
|
+
*/
|
|
32
|
+
themes?: string[]
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type ThemePluginOptions = CommonThemeOptions &
|
|
36
|
+
(
|
|
37
|
+
| {
|
|
38
|
+
/**
|
|
39
|
+
* A theme hook (e.g. next-themes' `useTheme`) called inside the
|
|
40
|
+
* plugin's slot components on every render. The hook owns the live
|
|
41
|
+
* theme value, so `theme`/`setTheme` are not accepted in this form.
|
|
42
|
+
*/
|
|
43
|
+
useTheme: UseThemeHook
|
|
44
|
+
theme?: never
|
|
45
|
+
setTheme?: never
|
|
46
|
+
}
|
|
47
|
+
| {
|
|
48
|
+
/**
|
|
49
|
+
* Current theme value. Required when not using a hook so slot
|
|
50
|
+
* components can highlight the active option. Pass it from a
|
|
51
|
+
* stateful source (e.g. `useState`, Context) so updates flow
|
|
52
|
+
* through `<AuthProvider>` and re-render slot components.
|
|
53
|
+
*/
|
|
54
|
+
theme: string
|
|
55
|
+
/** Setter that updates the value `theme` is read from. */
|
|
56
|
+
setTheme: (theme: string) => void
|
|
57
|
+
useTheme?: never
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
export const themePlugin = createAuthPlugin(
|
|
62
|
+
coreThemePlugin.id,
|
|
63
|
+
({ useTheme, ...rest }: ThemePluginOptions) => {
|
|
64
|
+
// No-op `setTheme` baseline keeps core's required option satisfied on the
|
|
65
|
+
// hook branch (where the consumer doesn't pass a setter); on the static
|
|
66
|
+
// branch the spread overrides it with the consumer's real setter.
|
|
67
|
+
const base = coreThemePlugin({ setTheme: () => {}, ...rest })
|
|
68
|
+
return {
|
|
69
|
+
...base,
|
|
70
|
+
// Slot components always call `plugin.useTheme()` — invoking the hook
|
|
71
|
+
// inside their render keeps it in scope of any `<ThemeProvider>` the
|
|
72
|
+
// consumer mounts. On the static branch the factory re-runs on every
|
|
73
|
+
// parent render, so the synthesized closure stays in sync with the
|
|
74
|
+
// consumer's `theme` state.
|
|
75
|
+
useTheme:
|
|
76
|
+
useTheme ??
|
|
77
|
+
(() => ({
|
|
78
|
+
theme: base.theme,
|
|
79
|
+
setTheme: base.setTheme,
|
|
80
|
+
themes: base.themes
|
|
81
|
+
})),
|
|
82
|
+
userMenuItems: [ThemeToggleItem],
|
|
83
|
+
accountCards: [Appearance]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createAuthPlugin } from "@better-auth-ui/core"
|
|
2
|
+
import {
|
|
3
|
+
usernamePlugin as coreUsernamePlugin,
|
|
4
|
+
type UsernamePluginOptions
|
|
5
|
+
} from "@better-auth-ui/core/plugins"
|
|
6
|
+
|
|
7
|
+
import { SignInUsername } from "../../components/auth/username/sign-in-username"
|
|
8
|
+
import { UsernameField } from "../../components/auth/username/username-field"
|
|
9
|
+
|
|
10
|
+
export const usernamePlugin = createAuthPlugin(
|
|
11
|
+
coreUsernamePlugin.id,
|
|
12
|
+
(options: UsernamePluginOptions = {}) => {
|
|
13
|
+
const core = coreUsernamePlugin(options)
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
...core,
|
|
17
|
+
additionalFields: core.additionalFields?.map((field) =>
|
|
18
|
+
field.name === "username"
|
|
19
|
+
? {
|
|
20
|
+
...field,
|
|
21
|
+
render: UsernameField
|
|
22
|
+
}
|
|
23
|
+
: field
|
|
24
|
+
),
|
|
25
|
+
views: {
|
|
26
|
+
auth: { signIn: SignInUsername }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
)
|
package/src/plugins.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
export * from "./components/auth/delete-user/danger-zone"
|
|
4
|
+
export * from "./components/auth/delete-user/delete-user"
|
|
5
|
+
// Plugin-contributed components that may be used standalone
|
|
6
|
+
export * from "./components/auth/magic-link/magic-link"
|
|
7
|
+
export * from "./components/auth/multi-session/manage-account"
|
|
8
|
+
export * from "./components/auth/multi-session/manage-accounts"
|
|
9
|
+
export * from "./components/auth/multi-session/switch-account-submenu"
|
|
10
|
+
export * from "./components/auth/multi-session/switch-account-submenu-content"
|
|
11
|
+
export * from "./components/auth/multi-session/switch-account-submenu-item"
|
|
12
|
+
export * from "./components/auth/passkey/passkeys"
|
|
13
|
+
export * from "./components/auth/theme/appearance"
|
|
14
|
+
export * from "./components/auth/theme/theme-toggle-item"
|
|
15
|
+
export * from "./components/auth/username/sign-in-username"
|
|
16
|
+
export * from "./components/auth/username/username-field"
|
|
17
|
+
export * from "./lib/auth/auth-plugin"
|
|
18
|
+
export * from "./lib/auth/delete-user-plugin"
|
|
19
|
+
export * from "./lib/auth/magic-link-plugin"
|
|
20
|
+
export * from "./lib/auth/multi-session-plugin"
|
|
21
|
+
export * from "./lib/auth/passkey-plugin"
|
|
22
|
+
export * from "./lib/auth/theme-plugin"
|
|
23
|
+
export * from "./lib/auth/username-plugin"
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AuthView } from '@better-auth-ui/core';
|
|
2
|
-
export type MagicLinkButtonProps = {
|
|
3
|
-
isPending: boolean;
|
|
4
|
-
view?: AuthView;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Renders a full-width tertiary link-style button that navigates to either the magic-link or sign-in route.
|
|
8
|
-
*
|
|
9
|
-
* @param isPending - If true, applies disabled styling and prevents interaction
|
|
10
|
-
* @param view - Current auth view; when `"magicLink"`, the button targets the sign-in/password variant
|
|
11
|
-
* @returns The rendered Link element with the appropriate href, icon, and label
|
|
12
|
-
*/
|
|
13
|
-
export declare function MagicLinkButton({ isPending, view }: MagicLinkButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "@better-auth-ui/react";
|
|
2
|
-
import { Link as t, cn as n } from "@heroui/react";
|
|
3
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
-
import { Envelope as a, Lock as o } from "@gravity-ui/icons";
|
|
5
|
-
import { buttonVariants as s } from "@heroui/styles";
|
|
6
|
-
//#region src/components/auth/magic-link-button.tsx
|
|
7
|
-
function c({ isPending: c, view: l }) {
|
|
8
|
-
let { basePaths: u, viewPaths: d, localization: f } = e(), p = l === "magicLink";
|
|
9
|
-
return /* @__PURE__ */ i(t, {
|
|
10
|
-
href: `${u.auth}/${p ? d.auth.signIn : d.auth.magicLink}`,
|
|
11
|
-
className: n(s({ variant: "tertiary" }), "w-full gap-2", c && "status-disabled pointer-events-none"),
|
|
12
|
-
children: [r(p ? o : a, {}), f.auth.continueWith.replace("{{provider}}", p ? f.auth.password : f.auth.magicLink)]
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { c as MagicLinkButton };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CardProps } from '@heroui/react';
|
|
2
|
-
import { SocialLayout } from './provider-buttons';
|
|
3
|
-
export type MagicLinkProps = {
|
|
4
|
-
className?: string;
|
|
5
|
-
socialLayout?: SocialLayout;
|
|
6
|
-
socialPosition?: "top" | "bottom";
|
|
7
|
-
variant?: CardProps["variant"];
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Render a card-based sign-in form that sends an email magic link and optionally shows social provider buttons.
|
|
11
|
-
*
|
|
12
|
-
* @param className - Additional CSS class names applied to the card container
|
|
13
|
-
* @param socialLayout - Layout style for social provider buttons
|
|
14
|
-
* @param socialPosition - Position of social provider buttons; `"top"` or `"bottom"`. Defaults to `"bottom"`.
|
|
15
|
-
* @returns The magic-link sign-in UI as a JSX element
|
|
16
|
-
*/
|
|
17
|
-
export declare function MagicLink({ className, socialLayout, socialPosition, variant, ...props }: MagicLinkProps & CardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { FieldSeparator as e } from "./field-separator.js";
|
|
2
|
-
import { MagicLinkButton as t } from "./magic-link-button.js";
|
|
3
|
-
import { PasskeyButton as n } from "./passkey-button.js";
|
|
4
|
-
import { ProviderButtons as r } from "./provider-buttons.js";
|
|
5
|
-
import { useAuth as i, useSignInMagicLink as a, useSignInSocial as o } from "@better-auth-ui/react";
|
|
6
|
-
import { Button as s, Card as c, Description as l, FieldError as u, Form as d, Input as f, Label as p, Link as m, Spinner as h, TextField as g, cn as _, toast as v } from "@heroui/react";
|
|
7
|
-
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
8
|
-
import { useState as S } from "react";
|
|
9
|
-
//#region src/components/auth/magic-link.tsx
|
|
10
|
-
function C({ className: C, socialLayout: w, socialPosition: T = "bottom", variant: E, ...D }) {
|
|
11
|
-
let { basePaths: O, baseURL: k, localization: A, passkey: j, redirectTo: M, socialProviders: N, viewPaths: P } = i(), [F, I] = S(""), { mutate: L, isPending: R } = a({
|
|
12
|
-
onError: (e) => v.danger(e.error?.message || e.message),
|
|
13
|
-
onSuccess: () => {
|
|
14
|
-
I(""), v.success(A.auth.magicLinkSent);
|
|
15
|
-
}
|
|
16
|
-
}), [z, B] = S(!1), { mutate: V, isPending: H } = o({
|
|
17
|
-
onError: (e) => v.danger(e.error?.message || e.message),
|
|
18
|
-
onSuccess: () => {
|
|
19
|
-
B(!0), setTimeout(() => {
|
|
20
|
-
B(!1);
|
|
21
|
-
}, 5e3);
|
|
22
|
-
}
|
|
23
|
-
}), U = R || H || z, W = (e) => {
|
|
24
|
-
e.preventDefault(), L({
|
|
25
|
-
email: F,
|
|
26
|
-
callbackURL: `${k}${M}`
|
|
27
|
-
});
|
|
28
|
-
}, G = !!N?.length;
|
|
29
|
-
return /* @__PURE__ */ x(c, {
|
|
30
|
-
className: _("w-full max-w-sm p-4 md:p-6", C),
|
|
31
|
-
variant: E,
|
|
32
|
-
...D,
|
|
33
|
-
children: [
|
|
34
|
-
/* @__PURE__ */ b(c.Header, { children: /* @__PURE__ */ b(c.Title, {
|
|
35
|
-
className: "text-xl font-semibold mb-1",
|
|
36
|
-
children: A.auth.signIn
|
|
37
|
-
}) }),
|
|
38
|
-
/* @__PURE__ */ x(c.Content, {
|
|
39
|
-
className: "gap-4",
|
|
40
|
-
children: [
|
|
41
|
-
T === "top" && /* @__PURE__ */ x(y, { children: [!!N?.length && /* @__PURE__ */ b(r, {
|
|
42
|
-
socialLayout: w,
|
|
43
|
-
signInSocial: V,
|
|
44
|
-
isPending: U
|
|
45
|
-
}), G && /* @__PURE__ */ b(e, { children: A.auth.or })] }),
|
|
46
|
-
/* @__PURE__ */ x(d, {
|
|
47
|
-
onSubmit: W,
|
|
48
|
-
className: "flex flex-col gap-4",
|
|
49
|
-
children: [/* @__PURE__ */ x(g, {
|
|
50
|
-
name: "email",
|
|
51
|
-
type: "email",
|
|
52
|
-
autoComplete: "email",
|
|
53
|
-
isDisabled: U,
|
|
54
|
-
value: F,
|
|
55
|
-
onChange: I,
|
|
56
|
-
children: [
|
|
57
|
-
/* @__PURE__ */ b(p, { children: A.auth.email }),
|
|
58
|
-
/* @__PURE__ */ b(f, {
|
|
59
|
-
placeholder: A.auth.emailPlaceholder,
|
|
60
|
-
required: !0,
|
|
61
|
-
variant: E === "transparent" ? "primary" : "secondary"
|
|
62
|
-
}),
|
|
63
|
-
/* @__PURE__ */ b(u, {})
|
|
64
|
-
]
|
|
65
|
-
}), /* @__PURE__ */ x("div", {
|
|
66
|
-
className: "flex flex-col gap-3",
|
|
67
|
-
children: [
|
|
68
|
-
/* @__PURE__ */ x(s, {
|
|
69
|
-
type: "submit",
|
|
70
|
-
className: "w-full",
|
|
71
|
-
isPending: U,
|
|
72
|
-
children: [U && /* @__PURE__ */ b(h, {
|
|
73
|
-
color: "current",
|
|
74
|
-
size: "sm"
|
|
75
|
-
}), A.auth.sendMagicLink]
|
|
76
|
-
}),
|
|
77
|
-
/* @__PURE__ */ b(t, {
|
|
78
|
-
view: "magicLink",
|
|
79
|
-
isPending: U
|
|
80
|
-
}),
|
|
81
|
-
j && /* @__PURE__ */ b(n, { isPending: U })
|
|
82
|
-
]
|
|
83
|
-
})]
|
|
84
|
-
}),
|
|
85
|
-
T === "bottom" && /* @__PURE__ */ x(y, { children: [G && /* @__PURE__ */ b(e, { children: A.auth.or }), !!N?.length && /* @__PURE__ */ b(r, {
|
|
86
|
-
socialLayout: w,
|
|
87
|
-
signInSocial: V,
|
|
88
|
-
isPending: U
|
|
89
|
-
})] })
|
|
90
|
-
]
|
|
91
|
-
}),
|
|
92
|
-
/* @__PURE__ */ b(c.Footer, {
|
|
93
|
-
className: "flex-col",
|
|
94
|
-
children: /* @__PURE__ */ x(l, {
|
|
95
|
-
className: "text-sm",
|
|
96
|
-
children: [
|
|
97
|
-
A.auth.needToCreateAnAccount,
|
|
98
|
-
" ",
|
|
99
|
-
/* @__PURE__ */ b(m, {
|
|
100
|
-
href: `${O.auth}/${P.auth.signUp}`,
|
|
101
|
-
className: "text-accent decoration-accent no-underline hover:underline",
|
|
102
|
-
children: A.auth.signUp
|
|
103
|
-
})
|
|
104
|
-
]
|
|
105
|
-
})
|
|
106
|
-
})
|
|
107
|
-
]
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
//#endregion
|
|
111
|
-
export { C as MagicLink };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useAuth as e, useSignInPasskey as t } from "@better-auth-ui/react";
|
|
2
|
-
import { Button as n, Spinner as r, toast as i } from "@heroui/react";
|
|
3
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
-
import { Fingerprint as s } from "@gravity-ui/icons";
|
|
5
|
-
//#region src/components/auth/passkey-button.tsx
|
|
6
|
-
function c({ isPending: c }) {
|
|
7
|
-
let { localization: l, redirectTo: u, navigate: d } = e(), { mutate: f, isPending: p } = t({
|
|
8
|
-
onError: (e) => i.danger(e.error?.message || e.message),
|
|
9
|
-
onSuccess: () => d({ to: u })
|
|
10
|
-
});
|
|
11
|
-
return /* @__PURE__ */ o(n, {
|
|
12
|
-
className: "w-full",
|
|
13
|
-
variant: "tertiary",
|
|
14
|
-
isDisabled: c || p,
|
|
15
|
-
isPending: p,
|
|
16
|
-
onPress: () => f(),
|
|
17
|
-
children: [p ? /* @__PURE__ */ a(r, {
|
|
18
|
-
color: "current",
|
|
19
|
-
size: "sm"
|
|
20
|
-
}) : /* @__PURE__ */ a(s, {}), l.auth.continueWith.replace("{{provider}}", l.auth.passkey)]
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
export { c as PasskeyButton };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Appearance as e } from "./appearance.js";
|
|
2
|
-
import { ChangeEmail as t } from "./change-email.js";
|
|
3
|
-
import { ManageAccounts as n } from "./manage-accounts.js";
|
|
4
|
-
import { UserProfile as r } from "./user-profile.js";
|
|
5
|
-
import { useAuth as i } from "@better-auth-ui/react";
|
|
6
|
-
import { cn as a } from "@heroui/react";
|
|
7
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
-
//#region src/components/settings/account/account-settings.tsx
|
|
9
|
-
function c({ className: c, variant: l, ...u }) {
|
|
10
|
-
let { multiSession: d, emailAndPassword: f, magicLink: p, appearance: { setTheme: m } } = i();
|
|
11
|
-
return /* @__PURE__ */ s("div", {
|
|
12
|
-
className: a("flex w-full flex-col gap-4 md:gap-6", c),
|
|
13
|
-
...u,
|
|
14
|
-
children: [
|
|
15
|
-
/* @__PURE__ */ o(r, { variant: l }),
|
|
16
|
-
(f?.enabled || p) && /* @__PURE__ */ o(t, { variant: l }),
|
|
17
|
-
m && /* @__PURE__ */ o(e, { variant: l }),
|
|
18
|
-
d && /* @__PURE__ */ o(n, { variant: l })
|
|
19
|
-
]
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { c as AccountSettings };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { ThemePreviewDark as e, ThemePreviewLight as t, ThemePreviewSystem as n, useAuth as r, useSession as i } from "@better-auth-ui/react";
|
|
2
|
-
import { Card as a, Label as o, Radio as s, RadioGroup as c, cn as l } from "@heroui/react";
|
|
3
|
-
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
4
|
-
import { Display as f, Moon as p, Sun as m } from "@gravity-ui/icons";
|
|
5
|
-
//#region src/components/settings/account/appearance.tsx
|
|
6
|
-
function h({ className: h, variant: g, ..._ }) {
|
|
7
|
-
let { localization: v, appearance: { theme: y, setTheme: b, themes: x } } = r(), { data: S } = i();
|
|
8
|
-
return !b || !x?.length ? null : /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h2", {
|
|
9
|
-
className: l("text-sm font-semibold mb-3"),
|
|
10
|
-
children: v.settings.appearance
|
|
11
|
-
}), /* @__PURE__ */ u(a, {
|
|
12
|
-
className: l("p-4 gap-4", h),
|
|
13
|
-
variant: g,
|
|
14
|
-
..._,
|
|
15
|
-
children: /* @__PURE__ */ d(a.Content, { children: [/* @__PURE__ */ u(o, { children: v.settings.theme }), /* @__PURE__ */ u(c, {
|
|
16
|
-
variant: g === "transparent" ? "secondary" : "primary",
|
|
17
|
-
value: S ? y : "",
|
|
18
|
-
onChange: b,
|
|
19
|
-
isDisabled: !S || !y,
|
|
20
|
-
children: /* @__PURE__ */ d("div", {
|
|
21
|
-
className: "grid gap-3 grid-cols-2 sm:grid-cols-3",
|
|
22
|
-
children: [
|
|
23
|
-
x.includes("system") && /* @__PURE__ */ u(s, {
|
|
24
|
-
value: "system",
|
|
25
|
-
className: l("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", g === "transparent" ? "bg-surface" : "bg-surface-secondary"),
|
|
26
|
-
children: /* @__PURE__ */ d(s.Content, {
|
|
27
|
-
className: "gap-2",
|
|
28
|
-
children: [/* @__PURE__ */ d("div", {
|
|
29
|
-
className: "flex gap-2 justify-between",
|
|
30
|
-
children: [/* @__PURE__ */ d(o, {
|
|
31
|
-
className: "flex gap-2 items-center",
|
|
32
|
-
children: [/* @__PURE__ */ u(f, { className: "text-muted" }), v.settings.system]
|
|
33
|
-
}), /* @__PURE__ */ u(s.Control, { children: /* @__PURE__ */ u(s.Indicator, {}) })]
|
|
34
|
-
}), /* @__PURE__ */ u(n, { className: "w-full" })]
|
|
35
|
-
})
|
|
36
|
-
}),
|
|
37
|
-
x.includes("light") && /* @__PURE__ */ u(s, {
|
|
38
|
-
value: "light",
|
|
39
|
-
className: l("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", g === "transparent" ? "bg-surface" : "bg-surface-secondary"),
|
|
40
|
-
children: /* @__PURE__ */ d(s.Content, {
|
|
41
|
-
className: "gap-2",
|
|
42
|
-
children: [/* @__PURE__ */ d("div", {
|
|
43
|
-
className: "flex gap-2 justify-between",
|
|
44
|
-
children: [/* @__PURE__ */ d(o, {
|
|
45
|
-
className: "flex gap-2 items-center",
|
|
46
|
-
children: [/* @__PURE__ */ u(m, { className: "text-muted" }), v.settings.light]
|
|
47
|
-
}), /* @__PURE__ */ u(s.Control, { children: /* @__PURE__ */ u(s.Indicator, {}) })]
|
|
48
|
-
}), /* @__PURE__ */ u(t, { className: "w-full" })]
|
|
49
|
-
})
|
|
50
|
-
}),
|
|
51
|
-
x.includes("dark") && /* @__PURE__ */ u(s, {
|
|
52
|
-
value: "dark",
|
|
53
|
-
className: l("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", g === "transparent" ? "bg-surface" : "bg-surface-secondary"),
|
|
54
|
-
children: /* @__PURE__ */ d(s.Content, {
|
|
55
|
-
className: "gap-2",
|
|
56
|
-
children: [/* @__PURE__ */ d("div", {
|
|
57
|
-
className: "flex gap-2 justify-between",
|
|
58
|
-
children: [/* @__PURE__ */ d(o, {
|
|
59
|
-
className: "flex gap-2 items-center",
|
|
60
|
-
children: [/* @__PURE__ */ u(p, { className: "text-muted" }), v.settings.dark]
|
|
61
|
-
}), /* @__PURE__ */ u(s.Control, { children: /* @__PURE__ */ u(s.Indicator, {}) })]
|
|
62
|
-
}), /* @__PURE__ */ u(e, { className: "w-full" })]
|
|
63
|
-
})
|
|
64
|
-
})
|
|
65
|
-
]
|
|
66
|
-
})
|
|
67
|
-
})] })
|
|
68
|
-
})] });
|
|
69
|
-
}
|
|
70
|
-
//#endregion
|
|
71
|
-
export { h as Appearance };
|