@tempots/beatui 0.9.0 → 0.11.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.
Files changed (57) hide show
  1. package/dist/beatui.css +1 -1
  2. package/dist/de-O2DMrfiH.js +37 -0
  3. package/dist/es-CsNVN5AY.js +37 -0
  4. package/dist/fr-CJjx2YoL.js +37 -0
  5. package/dist/index.es.js +5697 -3308
  6. package/dist/index.umd.js +52 -52
  7. package/dist/it-BKzoVost.js +37 -0
  8. package/dist/ja-ZBFmK5Uj.js +37 -0
  9. package/dist/pt-DumIX3mi.js +37 -0
  10. package/dist/ru-_EKfu_bO.js +37 -0
  11. package/dist/types/auth-i18n/default.d.ts +30 -0
  12. package/dist/types/auth-i18n/index.d.ts +2 -0
  13. package/dist/types/auth-i18n/locales/de.d.ts +29 -0
  14. package/dist/types/auth-i18n/locales/en.d.ts +29 -0
  15. package/dist/types/auth-i18n/locales/es.d.ts +29 -0
  16. package/dist/types/auth-i18n/locales/fr.d.ts +29 -0
  17. package/dist/types/auth-i18n/locales/it.d.ts +29 -0
  18. package/dist/types/auth-i18n/locales/ja.d.ts +29 -0
  19. package/dist/types/auth-i18n/locales/pt.d.ts +29 -0
  20. package/dist/types/auth-i18n/locales/ru.d.ts +29 -0
  21. package/dist/types/auth-i18n/locales/zh.d.ts +29 -0
  22. package/dist/types/auth-i18n/translations.d.ts +28 -0
  23. package/dist/types/components/auth/auth-container.d.ts +10 -0
  24. package/dist/types/components/auth/auth-divider.d.ts +8 -0
  25. package/dist/types/components/auth/index.d.ts +10 -0
  26. package/dist/types/components/auth/password-strength-indicator.d.ts +5 -0
  27. package/dist/types/components/auth/reset-password-form.d.ts +3 -0
  28. package/dist/types/components/auth/schemas.d.ts +32 -0
  29. package/dist/types/components/auth/signin-form.d.ts +3 -0
  30. package/dist/types/components/auth/signup-form.d.ts +3 -0
  31. package/dist/types/components/auth/social-login-button.d.ts +47 -0
  32. package/dist/types/components/auth/types.d.ts +166 -0
  33. package/dist/types/components/auth/utils.d.ts +23 -0
  34. package/dist/types/components/beatui.d.ts +4 -1
  35. package/dist/types/components/button/button.d.ts +1 -1
  36. package/dist/types/components/form/control/combobox-control.d.ts +11 -0
  37. package/dist/types/components/form/control/control-input-wrapper.d.ts +1 -1
  38. package/dist/types/components/form/control/control-options.d.ts +1 -0
  39. package/dist/types/components/form/control/index.d.ts +1 -0
  40. package/dist/types/components/form/input/combobox.d.ts +39 -0
  41. package/dist/types/components/form/input/index.d.ts +1 -0
  42. package/dist/types/components/form/input/input-container.d.ts +2 -1
  43. package/dist/types/components/form/input/input-wrapper.d.ts +2 -1
  44. package/dist/types/components/form/schema/custom-validation.d.ts +75 -0
  45. package/dist/types/components/form/schema/index.d.ts +1 -0
  46. package/dist/types/components/navigation/flyout.d.ts +1 -1
  47. package/dist/types/components/navigation/index.d.ts +1 -0
  48. package/dist/types/components/navigation/menu.d.ts +106 -0
  49. package/dist/types/components/navigation/sidebar/index.d.ts +1 -0
  50. package/dist/types/components/navigation/sidebar/sidebar-group.d.ts +2 -1
  51. package/dist/types/components/navigation/sidebar/sidebar-link.d.ts +3 -0
  52. package/dist/types/components/navigation/sidebar/sidebar-separator.d.ts +1 -0
  53. package/dist/types/components/theme/types.d.ts +1 -0
  54. package/dist/types/index.d.ts +1 -0
  55. package/dist/types/tokens/colors.d.ts +1 -1
  56. package/dist/zh-DEZH0fdq.js +37 -0
  57. package/package.json +4 -5
@@ -0,0 +1,166 @@
1
+ import { Value } from '@tempots/dom';
2
+ import { ControlSize } from '../theme';
3
+ import { ThemeColorName } from '@/tokens';
4
+ import { AuthProviderInfo } from './social-login-button';
5
+ export type AuthProviderName = 'google' | 'github' | 'apple' | 'facebook' | 'twitter' | 'x' | 'microsoft' | 'discord' | 'linkedin' | 'instagram' | 'tiktok' | 'snapchat' | 'reddit' | 'pinterest' | 'twitch' | 'steam' | 'epic' | 'playstation' | 'xbox' | 'whatsapp' | 'wechat' | 'amazon' | 'yahoo' | 'paypal';
6
+ export type AuthMode = 'signin' | 'signup' | 'reset-password';
7
+ export type SocialLoginFlow = 'redirect' | 'popup';
8
+ export type PasswordStrength = 'weak' | 'fair' | 'good' | 'strong';
9
+ export interface SignInData {
10
+ email: string;
11
+ password: string;
12
+ rememberMe?: boolean;
13
+ }
14
+ export interface SignUpData {
15
+ name?: string;
16
+ email: string;
17
+ password: string;
18
+ confirmPassword: string;
19
+ acceptTerms: boolean;
20
+ }
21
+ export interface ResetPasswordData {
22
+ email: string;
23
+ }
24
+ export interface SocialProviderConfig<T> {
25
+ provider: AuthProviderName;
26
+ clientId?: string;
27
+ flow?: SocialLoginFlow;
28
+ scopes?: string[];
29
+ customParams?: Record<string, string>;
30
+ onSuccess?: (result: T) => Promise<void> | void;
31
+ onError?: (error: Error) => Promise<void> | void;
32
+ }
33
+ export interface PasswordRules {
34
+ minLength?: number;
35
+ requireUppercase?: boolean;
36
+ requireLowercase?: boolean;
37
+ requireNumbers?: boolean;
38
+ requireSymbols?: boolean;
39
+ customValidation?: (password: string) => string | null;
40
+ }
41
+ export interface AuthContainerOptions {
42
+ mode?: Value<AuthMode>;
43
+ className?: Value<string>;
44
+ socialProviders?: Value<AuthProviderInfo[]>;
45
+ passwordRules?: PasswordRules;
46
+ showRememberMe?: Value<boolean>;
47
+ showSocialDivider?: Value<boolean>;
48
+ allowSignUp?: Value<boolean>;
49
+ allowPasswordReset?: Value<boolean>;
50
+ showPasswordStrength?: Value<boolean>;
51
+ labels?: {
52
+ signInTitle?: () => string;
53
+ emailLabel?: () => string;
54
+ passwordLabel?: () => string;
55
+ rememberMeLabel?: () => string;
56
+ loading?: () => string;
57
+ signInButton?: () => string;
58
+ forgotPasswordLink?: () => string;
59
+ noAccountLink?: () => string;
60
+ acceptTermsLabel?: () => string;
61
+ confirmPasswordLabel?: () => string;
62
+ signUpTitle?: () => string;
63
+ signUpButton?: () => string;
64
+ nameLabel?: () => string;
65
+ hasAccountLink?: () => string;
66
+ resetPasswordTitle?: () => string;
67
+ resetPasswordButton?: () => string;
68
+ resetPasswordDescription?: () => string;
69
+ backToSignInLink?: () => string;
70
+ };
71
+ onSignIn?: (data: SignInData) => Promise<void>;
72
+ onSignUp?: (data: SignUpData) => Promise<void>;
73
+ onResetPassword?: (data: ResetPasswordData) => Promise<void>;
74
+ onModeChange?: (mode: AuthMode) => void;
75
+ onSocialLogin?: (provider: AuthProviderName) => Promise<void>;
76
+ onSubmitSignIn?: (data: SignInData) => Promise<void>;
77
+ onSubmitSignUp?: (data: SignUpData) => Promise<void>;
78
+ onSubmitResetPassword?: (data: ResetPasswordData) => Promise<void>;
79
+ }
80
+ export interface SignInFormOptions {
81
+ onSubmit?: (data: SignInData) => Promise<void>;
82
+ onModeChange?: (mode: AuthMode) => void;
83
+ onSignIn?: (data: SignInData) => Promise<void>;
84
+ onSocialLogin?: (provider: AuthProviderName) => Promise<void>;
85
+ loading?: Value<boolean>;
86
+ error?: Value<string | null>;
87
+ passwordRules?: PasswordRules;
88
+ labels?: {
89
+ signInTitle?: () => string;
90
+ emailLabel?: () => string;
91
+ passwordLabel?: () => string;
92
+ rememberMeLabel?: () => string;
93
+ loading?: () => string;
94
+ signInButton?: () => string;
95
+ forgotPasswordLink?: () => string;
96
+ noAccountLink?: () => string;
97
+ };
98
+ socialProviders?: Value<SocialProviderConfig<unknown>[]>;
99
+ showSocialDivider?: Value<boolean>;
100
+ showRememberMe?: Value<boolean>;
101
+ allowPasswordReset?: Value<boolean>;
102
+ allowSignUp?: Value<boolean>;
103
+ }
104
+ export interface SignUpFormOptions {
105
+ onSubmit?: (data: SignUpData) => Promise<void>;
106
+ onModeChange?: (mode: AuthMode) => void;
107
+ loading?: Value<boolean>;
108
+ error?: Value<string | null>;
109
+ passwordRules?: PasswordRules;
110
+ labels?: {
111
+ signUpTitle?: () => string;
112
+ nameLabel?: () => string;
113
+ emailLabel?: () => string;
114
+ passwordLabel?: () => string;
115
+ confirmPasswordLabel?: () => string;
116
+ acceptTermsLabel?: () => string;
117
+ loading?: () => string;
118
+ signUpButton?: () => string;
119
+ hasAccountLink?: () => string;
120
+ };
121
+ socialProviders?: Value<AuthProviderInfo[]>;
122
+ showSocialDivider?: Value<boolean>;
123
+ showPasswordStrength?: Value<boolean>;
124
+ onSignUp?: (data: SignUpData) => Promise<void>;
125
+ onSocialLogin?: (provider: AuthProviderName) => Promise<void>;
126
+ }
127
+ export interface ResetPasswordFormOptions {
128
+ onSubmit?: (data: ResetPasswordData) => Promise<void>;
129
+ onModeChange?: (mode: AuthMode) => void;
130
+ onResetPassword?: (data: ResetPasswordData) => Promise<void>;
131
+ loading?: Value<boolean>;
132
+ error?: Value<string | null>;
133
+ labels?: {
134
+ resetPasswordTitle?: () => string;
135
+ resetPasswordButton?: () => string;
136
+ resetPasswordDescription?: () => string;
137
+ emailLabel?: () => string;
138
+ loading?: () => string;
139
+ backToSignInLink?: () => string;
140
+ };
141
+ }
142
+ export interface SocialLoginButtonOptions {
143
+ provider: Value<AuthProviderName>;
144
+ onClick?: () => Promise<void>;
145
+ loading?: Value<boolean>;
146
+ disabled?: Value<boolean>;
147
+ size?: Value<ControlSize>;
148
+ flow?: Value<'redirect' | 'popup' | undefined>;
149
+ name: Value<string>;
150
+ icon: Value<string>;
151
+ color: Value<ThemeColorName | 'black'>;
152
+ labels?: {
153
+ continueWithProvider?: (provider: string) => string;
154
+ };
155
+ }
156
+ export interface PasswordStrengthIndicatorOptions {
157
+ password: Value<string>;
158
+ rules?: PasswordRules;
159
+ showLabel?: boolean;
160
+ className?: Value<string>;
161
+ }
162
+ export interface ProviderInfo {
163
+ name: string;
164
+ icon: string;
165
+ color: ThemeColorName;
166
+ }
@@ -0,0 +1,23 @@
1
+ import { GetValueTypes, Signal, Value } from '@tempots/dom';
2
+ import { AuthProviderName, PasswordRules } from './types';
3
+ export declare const providerInfo: Record<AuthProviderName, {
4
+ name: string;
5
+ icon: string;
6
+ color: string;
7
+ }>;
8
+ export declare function formatProviderName(provider: AuthProviderName): string;
9
+ export declare function getProviderIcon(provider: AuthProviderName): string;
10
+ export declare function getProviderColor(provider: AuthProviderName): string;
11
+ export declare function formatSocialLoginText(provider: AuthProviderName, template?: string): string;
12
+ export declare const defaultPasswordRules: PasswordRules;
13
+ export declare function isValidEmail(email: string): boolean;
14
+ export declare function generateRandomString(length?: number): string;
15
+ export declare function createSocialLoginUrl(provider: AuthProviderName, clientId: string, redirectUri: string, scopes?: string[], customParams?: Record<string, string>): string;
16
+ export declare function openSocialLoginPopup<T>(url: string, provider: AuthProviderName, onSuccess?: (result: T) => void, onError?: (error: Error) => void): void;
17
+ export declare function formatAuthError(error: unknown): string;
18
+ export declare function isBrowser(): boolean;
19
+ export declare const REMEMBER_EMAIL_KEY = "bui_auth_remember_email";
20
+ export declare function saveRememberMe(email: string): void;
21
+ export declare function getRememberedEmail(): string | null;
22
+ export declare function clearRememberedEmail(): void;
23
+ export declare function functionOrReactiveMessage<T extends Value<unknown>[]>(fn: undefined | ((...args: GetValueTypes<T>) => string), reactiveFn: (...args: T) => Signal<string>, ...args: T): Signal<string>;
@@ -1,2 +1,5 @@
1
1
  import { TNode } from '@tempots/dom';
2
- export declare function BeatUI(...children: TNode[]): import("@tempots/dom").Renderable;
2
+ export type BeatUIOptions = {
3
+ includeAuthI18n?: boolean;
4
+ };
5
+ export declare function BeatUI({ includeAuthI18n }: BeatUIOptions, ...children: TNode[]): import("@tempots/dom").Renderable;
@@ -8,7 +8,7 @@ export interface ButtonOptions {
8
8
  loading?: Value<boolean>;
9
9
  variant?: Value<ButtonVariant>;
10
10
  size?: Value<ControlSize>;
11
- color?: Value<ThemeColorName>;
11
+ color?: Value<ThemeColorName | 'black'>;
12
12
  roundedness?: Value<RadiusName>;
13
13
  onClick?: () => void;
14
14
  }
@@ -0,0 +1,11 @@
1
+ import { ControlOptions } from './control-options';
2
+ import { ComboboxOption } from '../input/combobox';
3
+ import { TNode, Value } from '@tempots/dom';
4
+ export type ComboboxControlOptions<T> = ControlOptions<T> & {
5
+ options: Value<ComboboxOption<T>[]>;
6
+ unselectedLabel?: Value<string>;
7
+ equality?: (a: T, b: T) => boolean;
8
+ placeholder?: Value<string>;
9
+ searchable?: Value<boolean>;
10
+ };
11
+ export declare const ComboboxControl: <T>(options: ComboboxControlOptions<T>, ...children: TNode[]) => import("@tempots/dom").Renderable;
@@ -4,4 +4,4 @@ import { ControlWrapperOptions } from './control-options';
4
4
  export type ControlInputWrapperOptions<S> = Merge<ControlWrapperOptions<S>, {
5
5
  content: TNode;
6
6
  }>;
7
- export declare const ControlInputWrapper: <S>({ required, label, context, description, content, controller, }: ControlInputWrapperOptions<S>, ...children: TNode[]) => import("@tempots/dom").Renderable;
7
+ export declare const ControlInputWrapper: <S>({ required, label, context, description, content, controller, horizontal, }: ControlInputWrapperOptions<S>, ...children: TNode[]) => import("@tempots/dom").Renderable;
@@ -7,6 +7,7 @@ export type ControlWrapperOptions<S> = {
7
7
  label?: TNode;
8
8
  context?: TNode;
9
9
  description?: TNode;
10
+ horizontal?: Value<boolean>;
10
11
  };
11
12
  export type ControlOptions<S> = Merge<ControlWrapperOptions<S>, {
12
13
  onBlur?: () => void;
@@ -1,3 +1,4 @@
1
+ export * from './combobox-control';
1
2
  export * from './control-input-wrapper';
2
3
  export * from './control-options';
3
4
  export * from './date-control';
@@ -0,0 +1,39 @@
1
+ import { Renderable, Value, TNode } from '@tempots/dom';
2
+ import { InputOptions } from './input-options';
3
+ export type ComboboxValueOption<T> = {
4
+ type: 'value';
5
+ value: T;
6
+ label: string;
7
+ disabled?: boolean;
8
+ before?: TNode;
9
+ after?: TNode;
10
+ };
11
+ export type ComboboxGroupOption<T> = {
12
+ type: 'group';
13
+ group: string;
14
+ options: ComboboxValueOption<T>[];
15
+ disabled?: boolean;
16
+ };
17
+ export type ComboboxBreakOption = {
18
+ type: 'break';
19
+ };
20
+ export type ComboboxOption<T> = ComboboxValueOption<T> | ComboboxGroupOption<T> | ComboboxBreakOption;
21
+ export declare const ComboboxOption: {
22
+ value: <T>(value: T, label: string, options?: {
23
+ disabled?: boolean;
24
+ before?: TNode;
25
+ after?: TNode;
26
+ }) => ComboboxValueOption<T>;
27
+ group: <T>(group: string, options: (ComboboxValueOption<T> | ComboboxBreakOption)[], disabled?: boolean) => ComboboxGroupOption<T>;
28
+ break: ComboboxBreakOption;
29
+ getOptionValues: <T>(options: ComboboxOption<T>[]) => T[];
30
+ contains: <T>(options: ComboboxOption<T>[], value: T, equality?: (a: T, b: T) => boolean) => boolean;
31
+ };
32
+ export type ComboboxOptions<T> = InputOptions<T> & {
33
+ options: Value<ComboboxOption<T>[]>;
34
+ unselectedLabel?: Value<string>;
35
+ equality?: (a: T, b: T) => boolean;
36
+ placeholder?: Value<string>;
37
+ searchable?: Value<boolean>;
38
+ };
39
+ export declare const Combobox: <T>(options: ComboboxOptions<T>) => Renderable;
@@ -1,5 +1,6 @@
1
1
  export * from './appearance-selector';
2
2
  export * from './checkbox-input';
3
+ export * from './combobox';
3
4
  export * from './date-input';
4
5
  export * from './date-time-input';
5
6
  export * from './editable-text';
@@ -1,5 +1,5 @@
1
1
  import { TNode, Value } from '@tempots/dom';
2
- export declare const InputContainer: ({ child, disabled, input, before, after, hasError, focusableSelector, growInput, }: {
2
+ export declare const InputContainer: ({ baseContainer, child, disabled, input, before, after, hasError, focusableSelector, growInput, }: {
3
3
  child?: TNode;
4
4
  disabled?: Value<boolean>;
5
5
  input: TNode;
@@ -8,4 +8,5 @@ export declare const InputContainer: ({ child, disabled, input, before, after, h
8
8
  hasError?: Value<boolean>;
9
9
  focusableSelector?: string;
10
10
  growInput?: Value<boolean>;
11
+ baseContainer?: Value<boolean>;
11
12
  }) => import("@tempots/dom").Renderable;
@@ -10,5 +10,6 @@ export type InputWrapperOptions = {
10
10
  labelFor?: Value<string>;
11
11
  hasError?: Value<boolean>;
12
12
  disabled?: Value<boolean>;
13
+ horizontal?: Value<boolean>;
13
14
  };
14
- export declare const InputWrapper: ({ required, label, context, description, content, error, labelFor, hasError, disabled, }: InputWrapperOptions, ...children: TNode[]) => import("@tempots/dom").Renderable;
15
+ export declare const InputWrapper: ({ required, label, context, description, content, error, labelFor, hasError, disabled, horizontal, }: InputWrapperOptions, ...children: TNode[]) => import("@tempots/dom").Renderable;
@@ -0,0 +1,75 @@
1
+ import { StandardSchemaV1 } from './standard-schema-v1';
2
+ export type ValidationError = {
3
+ message: string;
4
+ path?: (PropertyKey | StandardSchemaV1.PathSegment)[];
5
+ };
6
+ export type ValidatorResult<T> = {
7
+ success: true;
8
+ data: T;
9
+ } | {
10
+ success: false;
11
+ errors: ValidationError[];
12
+ };
13
+ export interface Validator<Input, Output = Input> {
14
+ validate(value: unknown): ValidatorResult<Output>;
15
+ optional(): Validator<Input | undefined, Output | undefined>;
16
+ default(defaultValue: Output): Validator<Input | undefined, Output>;
17
+ }
18
+ export type SafeParseSuccess<T> = {
19
+ success: true;
20
+ data: T;
21
+ };
22
+ export type SafeParseError = {
23
+ success: false;
24
+ error: {
25
+ errors: Array<{
26
+ message: string;
27
+ path: (string | number)[];
28
+ }>;
29
+ };
30
+ };
31
+ export type SafeParseResult<T> = SafeParseSuccess<T> | SafeParseError;
32
+ declare function createStandardSchema<Input, Output = Input>(validator: Validator<Input, Output>): StandardSchemaV1<Input, Output> & {
33
+ safeParse: (value: unknown) => SafeParseResult<Output>;
34
+ };
35
+ declare abstract class BaseValidator<Input, Output = Input> implements Validator<Input, Output> {
36
+ abstract validate(value: unknown): ValidatorResult<Output>;
37
+ optional(): Validator<Input | undefined, Output | undefined>;
38
+ default(defaultValue: Output): Validator<Input | undefined, Output>;
39
+ schema(): StandardSchemaV1<Input, Output> & {
40
+ safeParse: (value: unknown) => SafeParseResult<Output>;
41
+ };
42
+ }
43
+ export declare class StringValidator extends BaseValidator<string> {
44
+ private minLength?;
45
+ private maxLength?;
46
+ private pattern?;
47
+ private customValidations;
48
+ validate(value: unknown): ValidatorResult<string>;
49
+ min(length: number, message?: string): StringValidator;
50
+ max(length: number, message?: string): StringValidator;
51
+ regex(pattern: RegExp, message?: string): StringValidator;
52
+ email(message?: string): StringValidator;
53
+ refine(validation: (value: string) => string | null): StringValidator;
54
+ }
55
+ export declare class BooleanValidator extends BaseValidator<boolean> {
56
+ private mustBeTrue;
57
+ private trueMessage?;
58
+ validate(value: unknown): ValidatorResult<boolean>;
59
+ refine(condition: (value: boolean) => boolean, message: string): BooleanValidator;
60
+ literal(value: true, message?: string): BooleanValidator;
61
+ }
62
+ export declare class ObjectValidator<T extends Record<string, any>> extends BaseValidator<T> {
63
+ private shape;
64
+ constructor(shape: {
65
+ [K in keyof T]: Validator<any, T[K]>;
66
+ });
67
+ validate(value: unknown): ValidatorResult<T>;
68
+ refine<R extends T>(validation: (value: T) => string | null, options?: {
69
+ path?: (keyof T)[];
70
+ }): ObjectValidator<R>;
71
+ }
72
+ export declare const string: () => StringValidator;
73
+ export declare const boolean: () => BooleanValidator;
74
+ export declare const object: <T extends Record<string, any>>(shape: { [K in keyof T]: Validator<any, T[K]>; }) => ObjectValidator<T>;
75
+ export { createStandardSchema };
@@ -1,2 +1,3 @@
1
1
  export * from './schema-utils';
2
2
  export * from './standard-schema-v1';
3
+ export * from './custom-validation';
@@ -25,7 +25,7 @@ export interface FlyoutOptions {
25
25
  crossAxisOffset?: Value<number>;
26
26
  /** How to show the flyout */
27
27
  showOn?: Value<FlyoutTrigger> | FlyoutTriggerFunction;
28
- /** Whether the flyout can be closed with Escape key */
28
+ /** Whether the flyout can be closed with Escape key or clicking outside */
29
29
  closable?: Value<boolean>;
30
30
  /** Optional arrow configuration - receives a signal with PopOver positioning data */
31
31
  arrow?: (signal: any) => TNode;
@@ -1,3 +1,4 @@
1
1
  export * from './flyout';
2
2
  export * from './link';
3
+ export * from './menu';
3
4
  export * from './sidebar/index';
@@ -0,0 +1,106 @@
1
+ import { TNode, Value } from '@tempots/dom';
2
+ import { Placement } from '@tempots/ui';
3
+ import { FlyoutTrigger } from './flyout';
4
+ export type MenuTrigger = FlyoutTrigger;
5
+ export interface MenuOptions {
6
+ /** The menu items to display */
7
+ items: () => TNode[];
8
+ /** Placement of the menu relative to the trigger element */
9
+ placement?: Value<Placement>;
10
+ /** Delay in milliseconds before showing the menu on hover */
11
+ showDelay?: Value<number>;
12
+ /** Delay in milliseconds before hiding the menu after mouse leave */
13
+ hideDelay?: Value<number>;
14
+ /** Offset in pixels from the main axis */
15
+ mainAxisOffset?: Value<number>;
16
+ /** Offset in pixels from the cross axis */
17
+ crossAxisOffset?: Value<number>;
18
+ /** How to show the menu */
19
+ showOn?: Value<MenuTrigger>;
20
+ /** Whether the menu can be closed with Escape key */
21
+ closable?: Value<boolean>;
22
+ /** Callback when menu is closed */
23
+ onClose?: () => void;
24
+ /** Callback when a menu item is selected */
25
+ onAction?: (key: string) => void;
26
+ /** Accessible label for the menu */
27
+ ariaLabel?: Value<string>;
28
+ /** ID of element that labels the menu */
29
+ ariaLabelledBy?: Value<string>;
30
+ }
31
+ export interface MenuItemOptions {
32
+ /** Unique identifier for the menu item */
33
+ key?: Value<string>;
34
+ /** The text content of the menu item */
35
+ content: TNode;
36
+ /** Content to display at the start of the menu item (icons, indicators) */
37
+ startContent?: TNode;
38
+ /** Content to display at the end of the menu item (shortcuts, badges) */
39
+ endContent?: TNode;
40
+ /** Whether the menu item is disabled */
41
+ disabled?: Value<boolean>;
42
+ /** Callback when the menu item is clicked */
43
+ onClick?: () => void;
44
+ /** ARIA label for accessibility */
45
+ ariaLabel?: Value<string>;
46
+ /** Submenu items for nested menus */
47
+ submenu?: () => TNode[];
48
+ /** Placement of submenu relative to parent item */
49
+ submenuPlacement?: Value<Placement>;
50
+ }
51
+ export interface MenuSeparatorOptions {
52
+ /** Optional label for the separator */
53
+ label?: TNode;
54
+ }
55
+ /**
56
+ * Menu component that provides a list of actions or options.
57
+ * Built on top of the Flyout component for positioning and overlay behavior.
58
+ *
59
+ * Follows WAI-ARIA menu pattern with proper keyboard navigation and accessibility.
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * Button(
64
+ * { onClick: () => {} },
65
+ * 'Actions',
66
+ * Menu({
67
+ * items: () => [
68
+ * MenuItem({ content: 'Edit', onClick: () => console.log('edit') }),
69
+ * MenuItem({ content: 'Delete', onClick: () => console.log('delete') }),
70
+ * ]
71
+ * })
72
+ * )
73
+ * ```
74
+ */
75
+ export declare function Menu(options: MenuOptions): TNode;
76
+ /**
77
+ * MenuItem component for individual menu items.
78
+ *
79
+ * @example
80
+ * ```typescript
81
+ * MenuItem({
82
+ * content: 'Edit',
83
+ * startContent: Icon({ icon: 'edit' }),
84
+ * endContent: html.span('⌘E'),
85
+ * onClick: () => console.log('edit clicked')
86
+ * })
87
+ * ```
88
+ */
89
+ export declare function MenuItem(options: MenuItemOptions): TNode;
90
+ /**
91
+ * MenuSeparator component for visual grouping of menu items.
92
+ * Creates a visual divider between groups of menu items.
93
+ *
94
+ * @example
95
+ * ```typescript
96
+ * Menu({
97
+ * items: () => [
98
+ * MenuItem({ content: 'Cut' }),
99
+ * MenuItem({ content: 'Copy' }),
100
+ * MenuSeparator(),
101
+ * MenuItem({ content: 'Paste' }),
102
+ * ]
103
+ * })
104
+ * ```
105
+ */
106
+ export declare function MenuSeparator(options?: MenuSeparatorOptions): TNode;
@@ -2,3 +2,4 @@ export * from './sidebar';
2
2
  export * from './collapsible-sidebar-group';
3
3
  export * from './sidebar-link';
4
4
  export * from './sidebar-group';
5
+ export * from './sidebar-separator';
@@ -1,5 +1,6 @@
1
1
  import { TNode, Value } from '@tempots/dom';
2
2
  export type SidebarGroupOptions = {
3
3
  rail?: Value<boolean>;
4
+ header?: TNode;
4
5
  };
5
- export declare function SidebarGroup({ rail }: SidebarGroupOptions, ...children: TNode[]): import("@tempots/dom").Renderable;
6
+ export declare function SidebarGroup({ rail, header }: SidebarGroupOptions, ...children: TNode[]): import("@tempots/dom").Renderable;
@@ -19,4 +19,7 @@ export type SidebarLinkOptions = {
19
19
  ariaControls?: Value<string>;
20
20
  ariaLabel?: Value<string>;
21
21
  } & LinkAction;
22
+ export declare function SidebarUrlLink(options: UrlAction, ...children: TNode[]): import("@tempots/dom").Renderable;
23
+ export declare function SidebarActiveLink(...children: TNode[]): import("@tempots/dom").Renderable;
24
+ export declare function SidebarClickLink(options: ClickAction & Partial<Pick<SidebarLinkOptions, 'ariaExpanded' | 'ariaControls' | 'ariaLabel'>>, ...children: TNode[]): import("@tempots/dom").Renderable;
22
25
  export declare function SidebarLink(options: SidebarLinkOptions): import("@tempots/dom").Renderable;
@@ -0,0 +1 @@
1
+ export declare function SidebarSeparator(): import("@tempots/dom").Renderable;
@@ -4,6 +4,7 @@ import { AppearanceType } from '@tempots/ui';
4
4
  export type ButtonVariant = 'filled' | 'light' | 'outline' | 'default' | 'text';
5
5
  export type ControlSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
6
  export type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
7
+ export declare function increaseSize(size: IconSize | ControlSize, steps?: number): "sm" | "md" | "lg" | "xl" | "xs";
7
8
  export type OverlayEffect = 'transparent' | 'opaque' | 'none';
8
9
  export type OverlayMode = 'capturing' | 'non-capturing';
9
10
  export type FadeTransitionState = 'initial' | 'entering' | 'entered' | 'exiting' | 'exited';
@@ -1,5 +1,6 @@
1
1
  export { Use } from '@tempots/dom';
2
2
  export * from './beatui-i18n';
3
+ export * from './components/auth';
3
4
  export * from './components/beatui';
4
5
  export * from './components/button';
5
6
  export * from './components/content';
@@ -5,7 +5,7 @@ export declare const colorShades: ColorShade[];
5
5
  export type SemanticColorName = 'primary' | 'secondary' | 'base' | 'success' | 'warning' | 'error' | 'info';
6
6
  export type ThemeColorName = ColorName | SemanticColorName;
7
7
  export declare const semanticColorNames: readonly ["primary", "secondary", "base", "success", "warning", "error", "info"];
8
- export declare const themeColorNames: ("error" | "base" | "success" | "primary" | "secondary" | "warning" | "info" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | "slate" | "gray" | "zinc" | "neutral" | "stone")[];
8
+ export declare const themeColorNames: ("error" | "base" | "primary" | "secondary" | "success" | "warning" | "info" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | "slate" | "gray" | "zinc" | "neutral" | "stone")[];
9
9
  export declare const semanticColors: Record<SemanticColorName, ColorName>;
10
10
  export type BackgroundColorName = 'background' | 'surface' | 'subtle' | 'elevated' | 'raised' | 'overlay';
11
11
  export declare const bgColors: {
@@ -0,0 +1,37 @@
1
+ const r = {
2
+ // Sign In
3
+ signInTitle: () => "登录",
4
+ signInButton: () => "登录",
5
+ emailLabel: () => "邮箱",
6
+ passwordLabel: () => "密码",
7
+ rememberMeLabel: () => "记住我",
8
+ forgotPasswordLink: () => "忘记密码?",
9
+ noAccountLink: () => "没有账户?注册",
10
+ // Sign Up
11
+ signUpTitle: () => "注册",
12
+ signUpButton: () => "注册",
13
+ nameLabel: () => "姓名",
14
+ confirmPasswordLabel: () => "确认密码",
15
+ acceptTermsLabel: () => "我接受条款和条件",
16
+ hasAccountLink: () => "已有账户?登录",
17
+ // Reset Password
18
+ resetPasswordTitle: () => "重置密码",
19
+ resetPasswordButton: () => "重置密码",
20
+ resetPasswordDescription: () => "输入您的邮箱地址以重置密码。",
21
+ backToSignInLink: () => "返回登录",
22
+ // Social Login
23
+ continueWithProvider: (e) => `使用${e}继续`,
24
+ // Password Strength
25
+ passwordStrengthWeak: () => "弱",
26
+ passwordStrengthFair: () => "一般",
27
+ passwordStrengthGood: () => "良好",
28
+ passwordStrengthStrong: () => "强",
29
+ // Common
30
+ orDivider: () => "或",
31
+ loading: () => "加载中...",
32
+ error: () => "发生错误",
33
+ required: () => "必填"
34
+ };
35
+ export {
36
+ r as default
37
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempots/beatui",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.es.js",
@@ -54,9 +54,9 @@
54
54
  "registry": "https://registry.npmjs.org/"
55
55
  },
56
56
  "peerDependencies": {
57
- "@tempots/dom": "28.2.2",
57
+ "@tempots/dom": "28.3.0",
58
58
  "@tempots/std": "0.22.1",
59
- "@tempots/ui": "6.1.0"
59
+ "@tempots/ui": "6.2.0"
60
60
  },
61
61
  "peerDependenciesMeta": {
62
62
  "@tempots/dom": {
@@ -83,8 +83,7 @@
83
83
  "typescript": "5.8.3",
84
84
  "typescript-eslint": "8.32.1",
85
85
  "vite": "6.3.5",
86
- "vitest": "3.1.3",
87
- "zod": "^3.25.32"
86
+ "vitest": "3.1.3"
88
87
  },
89
88
  "scripts": {
90
89
  "build": "vite build && tsc -p tsconfig.build.json",