@tempots/beatui 0.0.2
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/LICENSE +21 -0
- package/README.md +172 -0
- package/dist/beatui.css +1 -0
- package/dist/index.es.js +2227 -0
- package/dist/index.umd.js +5 -0
- package/dist/types/components/button/button.d.ts +14 -0
- package/dist/types/components/button/index.d.ts +1 -0
- package/dist/types/components/data/icon.d.ts +9 -0
- package/dist/types/components/data/index.d.ts +2 -0
- package/dist/types/components/data/tag.d.ts +8 -0
- package/dist/types/components/form/control/control-input-wrapper.d.ts +8 -0
- package/dist/types/components/form/control/control-options.d.ts +19 -0
- package/dist/types/components/form/control/date-control.d.ts +2 -0
- package/dist/types/components/form/control/date-time-control.d.ts +2 -0
- package/dist/types/components/form/control/email-control.d.ts +2 -0
- package/dist/types/components/form/control/form-status.d.ts +20 -0
- package/dist/types/components/form/control/index.d.ts +21 -0
- package/dist/types/components/form/control/lazy-native-select-control.d.ts +16 -0
- package/dist/types/components/form/control/native-select-control.d.ts +9 -0
- package/dist/types/components/form/control/nullable-date-control.d.ts +2 -0
- package/dist/types/components/form/control/nullable-date-time-control.d.ts +2 -0
- package/dist/types/components/form/control/nullable-string-date-control.d.ts +2 -0
- package/dist/types/components/form/control/nullable-string-date-time-control.d.ts +2 -0
- package/dist/types/components/form/control/nullable-text-area-control.d.ts +7 -0
- package/dist/types/components/form/control/nullable-text-control.d.ts +2 -0
- package/dist/types/components/form/control/number-control.d.ts +9 -0
- package/dist/types/components/form/control/password-control.d.ts +2 -0
- package/dist/types/components/form/control/segmented-control.d.ts +12 -0
- package/dist/types/components/form/control/string-date-control.d.ts +2 -0
- package/dist/types/components/form/control/tags-control.d.ts +2 -0
- package/dist/types/components/form/control/text-area-control.d.ts +7 -0
- package/dist/types/components/form/control/text-control.d.ts +7 -0
- package/dist/types/components/form/controller/form-controller.d.ts +4 -0
- package/dist/types/components/form/controller/group-controller.d.ts +15 -0
- package/dist/types/components/form/controller/index.d.ts +6 -0
- package/dist/types/components/form/controller/list-controller.d.ts +22 -0
- package/dist/types/components/form/controller/path.d.ts +5 -0
- package/dist/types/components/form/controller/validation-result.d.ts +12 -0
- package/dist/types/components/form/controller/value-controller.d.ts +27 -0
- package/dist/types/components/form/index.d.ts +5 -0
- package/dist/types/components/form/input/checkbox-input.d.ts +2 -0
- package/dist/types/components/form/input/date-input.d.ts +2 -0
- package/dist/types/components/form/input/date-time-input.d.ts +2 -0
- package/dist/types/components/form/input/editable-text.d.ts +8 -0
- package/dist/types/components/form/input/email-input.d.ts +2 -0
- package/dist/types/components/form/input/index.d.ts +18 -0
- package/dist/types/components/form/input/input-container.d.ts +11 -0
- package/dist/types/components/form/input/input-options.d.ts +34 -0
- package/dist/types/components/form/input/lazy-native-select.d.ts +16 -0
- package/dist/types/components/form/input/native-select.d.ts +31 -0
- package/dist/types/components/form/input/nullable-date-input.d.ts +2 -0
- package/dist/types/components/form/input/nullable-date-time-input.d.ts +2 -0
- package/dist/types/components/form/input/nullable-text-area.d.ts +7 -0
- package/dist/types/components/form/input/nullable-text-input.d.ts +4 -0
- package/dist/types/components/form/input/number-input.d.ts +9 -0
- package/dist/types/components/form/input/password-input.d.ts +2 -0
- package/dist/types/components/form/input/tags-input.d.ts +2 -0
- package/dist/types/components/form/input/text-area.d.ts +7 -0
- package/dist/types/components/form/input/text-input.d.ts +2 -0
- package/dist/types/components/form/schema/index.d.ts +2 -0
- package/dist/types/components/form/schema/schema-utils.d.ts +4 -0
- package/dist/types/components/form/schema/standard-schema-v1.d.ts +55 -0
- package/dist/types/components/form/use-form.d.ts +14 -0
- package/dist/types/components/layout/app-shell.d.ts +42 -0
- package/dist/types/components/layout/card.d.ts +9 -0
- package/dist/types/components/layout/center.d.ts +7 -0
- package/dist/types/components/layout/group.d.ts +2 -0
- package/dist/types/components/layout/index.d.ts +7 -0
- package/dist/types/components/layout/sink.d.ts +9 -0
- package/dist/types/components/layout/stack.d.ts +2 -0
- package/dist/types/components/layout/with-breakpoint.d.ts +48 -0
- package/dist/types/components/misc/expando.d.ts +4 -0
- package/dist/types/components/misc/index.d.ts +1 -0
- package/dist/types/components/overlay/index.d.ts +1 -0
- package/dist/types/components/overlay/overlay.d.ts +14 -0
- package/dist/types/components/theme/index.d.ts +2 -0
- package/dist/types/components/theme/theme.d.ts +5 -0
- package/dist/types/components/theme/types.d.ts +110 -0
- package/dist/types/components/typography/index.d.ts +1 -0
- package/dist/types/components/typography/label.d.ts +5 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/theme/beatui-theme.d.ts +19 -0
- package/dist/types/tokens/base-colors.d.ts +288 -0
- package/dist/types/tokens/breakpoints.d.ts +12 -0
- package/dist/types/tokens/colors.d.ts +28 -0
- package/dist/types/tokens/index.d.ts +6 -0
- package/dist/types/tokens/radius.d.ts +14 -0
- package/dist/types/tokens/spacing.d.ts +18 -0
- package/dist/types/tokens/typography.d.ts +89 -0
- package/dist/types/utils/delay-signal.d.ts +2 -0
- package/dist/types/utils/use-animated-toggle.d.ts +51 -0
- package/package.json +123 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Value } from '@tempots/dom';
|
|
2
|
+
import { InputOptions } from './input-options';
|
|
3
|
+
import { Merge } from '@tempots/std';
|
|
4
|
+
export type NullableTextAreaOptions = Merge<InputOptions<null | string>, {
|
|
5
|
+
rows?: Value<number>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const NullableTextArea: (options: NullableTextAreaOptions) => import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InputOptions } from './input-options';
|
|
2
|
+
export declare const emptyToNull: (value: string | null) => string | null;
|
|
3
|
+
export declare const nullToEmpty: (value: null | string) => string;
|
|
4
|
+
export declare const NullableTextInput: (options: InputOptions<null | string>) => import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Value } from '@tempots/dom';
|
|
2
|
+
import { InputOptions } from './input-options';
|
|
3
|
+
import { Merge } from '@tempots/std';
|
|
4
|
+
export type NumberInputOptions = Merge<InputOptions<number>, {
|
|
5
|
+
step?: Value<number>;
|
|
6
|
+
min?: Value<number>;
|
|
7
|
+
max?: Value<number>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const NumberInput: (options: NumberInputOptions) => import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Value } from '@tempots/dom';
|
|
2
|
+
import { InputOptions } from './input-options';
|
|
3
|
+
import { Merge } from '@tempots/std';
|
|
4
|
+
export type TextAreaOptions = Merge<InputOptions<string>, {
|
|
5
|
+
rows?: Value<number>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const TextArea: (options: TextAreaOptions) => import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InvalidDependencies } from '../controller/validation-result';
|
|
2
|
+
import { StandardSchemaV1 } from './standard-schema-v1';
|
|
3
|
+
export declare function convertStandardSchemaPathToPath(path: ReadonlyArray<PropertyKey | StandardSchemaV1.PathSegment>): (string | number)[];
|
|
4
|
+
export declare function convertStandardSchemaIssues(issues: readonly StandardSchemaV1.Issue[]): InvalidDependencies;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** The Standard Schema interface. */
|
|
2
|
+
export interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
3
|
+
/** The Standard Schema properties. */
|
|
4
|
+
readonly '~standard': StandardSchemaV1.Props<Input, Output>;
|
|
5
|
+
}
|
|
6
|
+
export declare namespace StandardSchemaV1 {
|
|
7
|
+
/** The Standard Schema properties interface. */
|
|
8
|
+
interface Props<Input = unknown, Output = Input> {
|
|
9
|
+
/** The version number of the standard. */
|
|
10
|
+
readonly version: 1;
|
|
11
|
+
/** The vendor name of the schema library. */
|
|
12
|
+
readonly vendor: string;
|
|
13
|
+
/** Validates unknown input values. */
|
|
14
|
+
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
|
|
15
|
+
/** Inferred types associated with the schema. */
|
|
16
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
17
|
+
}
|
|
18
|
+
/** The result interface of the validate function. */
|
|
19
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
20
|
+
/** The result interface if validation succeeds. */
|
|
21
|
+
interface SuccessResult<Output> {
|
|
22
|
+
/** The typed output value. */
|
|
23
|
+
readonly value: Output;
|
|
24
|
+
/** The non-existent issues. */
|
|
25
|
+
readonly issues?: undefined;
|
|
26
|
+
}
|
|
27
|
+
/** The result interface if validation fails. */
|
|
28
|
+
interface FailureResult {
|
|
29
|
+
/** The issues of failed validation. */
|
|
30
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
31
|
+
}
|
|
32
|
+
/** The issue interface of the failure output. */
|
|
33
|
+
interface Issue {
|
|
34
|
+
/** The error message of the issue. */
|
|
35
|
+
readonly message: string;
|
|
36
|
+
/** The path of the issue, if any. */
|
|
37
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
38
|
+
}
|
|
39
|
+
/** The path segment interface of the issue. */
|
|
40
|
+
interface PathSegment {
|
|
41
|
+
/** The key representing a path segment. */
|
|
42
|
+
readonly key: PropertyKey;
|
|
43
|
+
}
|
|
44
|
+
/** The Standard Schema types interface. */
|
|
45
|
+
interface Types<Input = unknown, Output = Input> {
|
|
46
|
+
/** The input type of the schema. */
|
|
47
|
+
readonly input: Input;
|
|
48
|
+
/** The output type of the schema. */
|
|
49
|
+
readonly output: Output;
|
|
50
|
+
}
|
|
51
|
+
/** Infers the input type of a Standard Schema. */
|
|
52
|
+
type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['input'];
|
|
53
|
+
/** Infers the output type of a Standard Schema. */
|
|
54
|
+
type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['output'];
|
|
55
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StandardSchemaV1 } from './schema/standard-schema-v1';
|
|
2
|
+
import { FormController, ValueController } from './controller';
|
|
3
|
+
export interface UseFormOptions<In, Out = In> {
|
|
4
|
+
schema: StandardSchemaV1<In, Out>;
|
|
5
|
+
defaultValue?: In;
|
|
6
|
+
}
|
|
7
|
+
export declare function connectCommonAttributes<T>(value: ValueController<T>): import("@tempots/dom").Renderable<import("@tempots/dom").DOMContext>;
|
|
8
|
+
export declare function connectStringInput(value: ValueController<string>, { triggerOn, }?: {
|
|
9
|
+
triggerOn?: 'change' | 'input';
|
|
10
|
+
}): import("@tempots/dom").Renderable<import("@tempots/dom").DOMContext>;
|
|
11
|
+
export declare function connectNumberInput(value: ValueController<number>, { triggerOn, }?: {
|
|
12
|
+
triggerOn?: 'change' | 'input';
|
|
13
|
+
}): import("@tempots/dom").Renderable<import("@tempots/dom").DOMContext>;
|
|
14
|
+
export declare function useForm<In extends Record<string, any>, Out = In>({ defaultValue, schema, }: UseFormOptions<In, Out>): FormController<In>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { TNode } from '@tempots/dom';
|
|
2
|
+
import { TWBreakpoint } from './with-breakpoint';
|
|
3
|
+
import { PanelColor, PanelShadow } from '../theme';
|
|
4
|
+
export interface AppShellBreakpointOptions {
|
|
5
|
+
zero: number;
|
|
6
|
+
xs: number;
|
|
7
|
+
sm: number;
|
|
8
|
+
md: number;
|
|
9
|
+
lg: number;
|
|
10
|
+
xl: number;
|
|
11
|
+
}
|
|
12
|
+
export type AppShellBreakpointOptionalOptions = Partial<AppShellBreakpointOptions>;
|
|
13
|
+
export interface AppShellHorizontalOptions {
|
|
14
|
+
content: TNode;
|
|
15
|
+
height?: number | AppShellBreakpointOptionalOptions;
|
|
16
|
+
color?: PanelColor;
|
|
17
|
+
shadow?: PanelShadow;
|
|
18
|
+
}
|
|
19
|
+
export interface AppShellVerticalOptions {
|
|
20
|
+
content: TNode;
|
|
21
|
+
width?: number | AppShellBreakpointOptionalOptions;
|
|
22
|
+
color?: PanelColor;
|
|
23
|
+
shadow?: PanelShadow;
|
|
24
|
+
}
|
|
25
|
+
export interface AppShellMainOptions {
|
|
26
|
+
content: TNode;
|
|
27
|
+
color?: PanelColor;
|
|
28
|
+
shadow?: PanelShadow;
|
|
29
|
+
}
|
|
30
|
+
export interface AppShellOptions {
|
|
31
|
+
banner?: AppShellHorizontalOptions;
|
|
32
|
+
header?: AppShellHorizontalOptions;
|
|
33
|
+
footer?: AppShellHorizontalOptions;
|
|
34
|
+
menu?: AppShellVerticalOptions;
|
|
35
|
+
aside?: AppShellVerticalOptions;
|
|
36
|
+
main: AppShellMainOptions;
|
|
37
|
+
mainHeader?: AppShellHorizontalOptions;
|
|
38
|
+
mainFooter?: AppShellHorizontalOptions;
|
|
39
|
+
mediumBreakpoint?: TWBreakpoint;
|
|
40
|
+
smallBreakpoint?: TWBreakpoint;
|
|
41
|
+
}
|
|
42
|
+
export declare function AppShell({ smallBreakpoint, mediumBreakpoint, ...options }: AppShellOptions): import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
import { CardVariant, ControlSize } from '../theme';
|
|
3
|
+
import { RadiusName } from '@/tokens/radius';
|
|
4
|
+
export interface CardOptions {
|
|
5
|
+
variant?: Value<CardVariant>;
|
|
6
|
+
size?: Value<ControlSize>;
|
|
7
|
+
roundedness?: Value<RadiusName>;
|
|
8
|
+
}
|
|
9
|
+
export declare function Card({ variant, size, roundedness }?: CardOptions, ...children: TNode[]): import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
import { CenterGap } from '../theme';
|
|
3
|
+
export interface CenterOptions {
|
|
4
|
+
gap?: Value<CenterGap>;
|
|
5
|
+
}
|
|
6
|
+
export declare function CenterH(...children: TNode[]): import("@tempots/dom").Renderable;
|
|
7
|
+
export declare function Center({ gap }?: CenterOptions, ...children: TNode[]): import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
import { SinkVariant, ControlSize } from '../theme';
|
|
3
|
+
import { RadiusName } from '@/tokens/radius';
|
|
4
|
+
export interface SinkOptions {
|
|
5
|
+
variant?: Value<SinkVariant>;
|
|
6
|
+
size?: Value<ControlSize>;
|
|
7
|
+
roundedness?: Value<RadiusName>;
|
|
8
|
+
}
|
|
9
|
+
export declare function Sink({ variant, size, roundedness }?: SinkOptions, ...children: TNode[]): import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Signal, TNode } from '@tempots/dom';
|
|
2
|
+
export type Breakpoints = {
|
|
3
|
+
[_ in string]: number;
|
|
4
|
+
};
|
|
5
|
+
export interface BreakpointInfo<T extends Breakpoints, K extends keyof T = keyof T & string> {
|
|
6
|
+
value: Signal<{
|
|
7
|
+
width: number;
|
|
8
|
+
breakpoint: K;
|
|
9
|
+
}>;
|
|
10
|
+
breakpoints: T;
|
|
11
|
+
asList: [number, K][];
|
|
12
|
+
is: <K extends string & keyof T>(value: BreakPointComparison<K>, width: number) => boolean;
|
|
13
|
+
}
|
|
14
|
+
export type Operator = '!=' | '<=' | '>=' | '<' | '>' | '=';
|
|
15
|
+
export type BreakPointComparison<K extends string> = K | `${Operator}${K}`;
|
|
16
|
+
export declare function compareBreakpoint<T extends Breakpoints, K extends string & keyof T = keyof T & string>(sortedList: [number, keyof T][], value: BreakPointComparison<K>, width: number): boolean;
|
|
17
|
+
export declare function findBreakpoint<T extends Breakpoints>(sortedList: [number, keyof T][], width: number): keyof T;
|
|
18
|
+
export interface WithBreakpointOptions<T extends Breakpoints> {
|
|
19
|
+
breakpoints: T;
|
|
20
|
+
mode?: 'element' | 'viewport';
|
|
21
|
+
}
|
|
22
|
+
export declare function WithBreakpoint<T extends Breakpoints>(fn: (info: BreakpointInfo<T>) => TNode, { breakpoints, mode }: WithBreakpointOptions<T>): import("@tempots/dom").Renderable<import("@tempots/dom").DOMContext>;
|
|
23
|
+
export type TWBreakpoints = {
|
|
24
|
+
zero: number;
|
|
25
|
+
xs: number;
|
|
26
|
+
sm: number;
|
|
27
|
+
md: number;
|
|
28
|
+
lg: number;
|
|
29
|
+
xl: number;
|
|
30
|
+
};
|
|
31
|
+
export type TWBreakpoint = keyof TWBreakpoints;
|
|
32
|
+
export declare function WithTWBreakpoint(fn: (info: BreakpointInfo<TWBreakpoints>) => TNode): import("@tempots/dom").Renderable;
|
|
33
|
+
export type TWElementBreakpoints = {
|
|
34
|
+
zero: number;
|
|
35
|
+
'3xs': number;
|
|
36
|
+
'2xs': number;
|
|
37
|
+
xs: number;
|
|
38
|
+
sm: number;
|
|
39
|
+
md: number;
|
|
40
|
+
lg: number;
|
|
41
|
+
xl: number;
|
|
42
|
+
'2xl': number;
|
|
43
|
+
'3xl': number;
|
|
44
|
+
'4xl': number;
|
|
45
|
+
'5xl': number;
|
|
46
|
+
'6xl': number;
|
|
47
|
+
};
|
|
48
|
+
export declare function WithTWElementBreakpoint(fn: (info: BreakpointInfo<TWElementBreakpoints>) => TNode): import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Renderable, Value } from '@tempots/dom';
|
|
2
|
+
export declare const Expando: <T>(name: string, value: Value<T>) => Renderable;
|
|
3
|
+
export declare const emitExpando: <T>(name: string, fn: (text: T) => void) => (event: Event) => void;
|
|
4
|
+
export declare const emitOptionExpando: <T>(name: string, fn: (text: T) => void) => (event: Event) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './expando';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './overlay';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BrowserContext, TNode } from '@tempots/dom';
|
|
2
|
+
import { OverlayEffect } from '../theme/types';
|
|
3
|
+
export type OverlayOptions = {
|
|
4
|
+
effect?: OverlayEffect;
|
|
5
|
+
mode: 'capturing';
|
|
6
|
+
onClickOutside?: () => void;
|
|
7
|
+
onEscape?: () => void;
|
|
8
|
+
} | {
|
|
9
|
+
effect?: OverlayEffect;
|
|
10
|
+
mode: 'non-capturing';
|
|
11
|
+
};
|
|
12
|
+
export declare function makeOverlay(ctx: BrowserContext): ({ effect, ...rest }: OverlayOptions, fnNode: (close: () => void) => TNode) => () => void;
|
|
13
|
+
export declare function OverlayElement(options: OverlayOptions, fn: (open: (renderFn: (close: () => void) => TNode) => void) => TNode): TNode;
|
|
14
|
+
export declare function OverlayBody(options: OverlayOptions, fn: (open: (renderFn: (close: () => void) => TNode) => void) => TNode): TNode;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { BackgroundColorName, ThemeColorName } from '@/tokens';
|
|
2
|
+
import { RadiusName } from '@/tokens/radius';
|
|
3
|
+
import { Signal } from '@tempots/dom';
|
|
4
|
+
export type ButtonVariant = 'filled' | 'light' | 'outline' | 'default' | 'text';
|
|
5
|
+
export type ControlSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
export type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
+
export type OverlayEffect = 'transparent' | 'visible';
|
|
8
|
+
export type OverlayMode = 'capturing' | 'non-capturing';
|
|
9
|
+
export type FadeTranstionState = 'initial' | 'entering' | 'entered' | 'exiting' | 'exited';
|
|
10
|
+
export type Side = 'left' | 'right' | 'top' | 'bottom' | 'none' | 'all' | ('left' | 'right' | 'top' | 'bottom')[];
|
|
11
|
+
export type PanelColor = BackgroundColorName | ThemeColorName | 'white' | 'black' | 'transparent';
|
|
12
|
+
export type PanelShadow = 'none' | 'sm' | 'md' | 'lg';
|
|
13
|
+
export type LabelType = 'emphasis' | 'default' | 'muted' | 'error';
|
|
14
|
+
export type JustifyContent = 'flex-start' | 'flex-end' | 'safe flex-end' | 'center' | 'safe center' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'baseline' | 'normal';
|
|
15
|
+
export type JustifyItems = 'start' | 'end' | 'safe end' | 'center' | 'safe center' | 'stretch' | 'normal';
|
|
16
|
+
export type JustifySelf = 'auto' | 'start' | 'center' | 'safe center' | 'end' | 'safe end' | 'stretch';
|
|
17
|
+
export type AlignContent = 'normal' | 'center' | 'flex-start' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly' | 'baseline' | 'stretch';
|
|
18
|
+
export type AlignItems = 'flex-start' | 'flex-end' | 'safe flex-end' | 'center' | 'safe-center' | 'baseline' | 'last-baseline' | 'stretch';
|
|
19
|
+
export type AlignSelf = 'auto' | 'flex-start' | 'flex-end' | 'safe flex-end' | 'center' | 'safe center' | 'stretch' | 'baseline' | 'last baseline';
|
|
20
|
+
export type ButtonStyleOptions = {
|
|
21
|
+
variant: ButtonVariant;
|
|
22
|
+
size: ControlSize;
|
|
23
|
+
color: string;
|
|
24
|
+
roundedness: RadiusName;
|
|
25
|
+
};
|
|
26
|
+
export type OverlayStyleOptions = {
|
|
27
|
+
effect: OverlayEffect;
|
|
28
|
+
mode: OverlayMode;
|
|
29
|
+
};
|
|
30
|
+
export type PanelStyleOptions = {
|
|
31
|
+
side: Side;
|
|
32
|
+
color: PanelColor;
|
|
33
|
+
shadow: PanelShadow;
|
|
34
|
+
};
|
|
35
|
+
export type LabelStyleOptions = {
|
|
36
|
+
type: LabelType;
|
|
37
|
+
};
|
|
38
|
+
export type IconStyleOptions = {
|
|
39
|
+
size: IconSize;
|
|
40
|
+
color?: string;
|
|
41
|
+
};
|
|
42
|
+
export type InputContainerStyleOptions = {
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
hasError?: boolean;
|
|
45
|
+
};
|
|
46
|
+
export type ControlInputWrapperStyleOptions = {
|
|
47
|
+
hasError?: boolean;
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
};
|
|
50
|
+
export type TagStyleOptions = {
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
color?: string;
|
|
53
|
+
};
|
|
54
|
+
export type CheckboxInputStyleOptions = {
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
};
|
|
57
|
+
export type EditableTextStyleOptions = {
|
|
58
|
+
isEditing?: boolean;
|
|
59
|
+
};
|
|
60
|
+
export type NumberInputStyleOptions = {
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
};
|
|
63
|
+
export type FadeInOutStyleOptions = {
|
|
64
|
+
state: FadeTranstionState;
|
|
65
|
+
};
|
|
66
|
+
export type CardVariant = 'default' | 'elevated' | 'flat' | 'outlined';
|
|
67
|
+
export type CardStyleOptions = {
|
|
68
|
+
variant?: CardVariant;
|
|
69
|
+
size?: ControlSize;
|
|
70
|
+
roundedness?: RadiusName;
|
|
71
|
+
};
|
|
72
|
+
export type CenterGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
73
|
+
export type CenterStyleOptions = {
|
|
74
|
+
gap?: CenterGap;
|
|
75
|
+
};
|
|
76
|
+
export type SinkVariant = 'default' | 'deep' | 'shallow' | 'flat';
|
|
77
|
+
export type SinkStyleOptions = {
|
|
78
|
+
variant?: SinkVariant;
|
|
79
|
+
size?: ControlSize;
|
|
80
|
+
roundedness?: RadiusName;
|
|
81
|
+
};
|
|
82
|
+
export type SegmentedControlStyleOptions = {
|
|
83
|
+
size?: ControlSize;
|
|
84
|
+
};
|
|
85
|
+
export interface ThemeDefinition {
|
|
86
|
+
button: (options: ButtonStyleOptions) => string;
|
|
87
|
+
overlay: (options: OverlayStyleOptions) => string;
|
|
88
|
+
icon: (options: IconStyleOptions) => string;
|
|
89
|
+
panel: (options: PanelStyleOptions) => string;
|
|
90
|
+
label: (options: LabelStyleOptions) => string;
|
|
91
|
+
inputContainer: (options: InputContainerStyleOptions) => string;
|
|
92
|
+
controlInputWrapper: (options: ControlInputWrapperStyleOptions) => string;
|
|
93
|
+
controlInputWrapperLabelText: (options: ControlInputWrapperStyleOptions) => string;
|
|
94
|
+
tag: (options: TagStyleOptions) => string;
|
|
95
|
+
checkboxInput: (options: CheckboxInputStyleOptions) => string;
|
|
96
|
+
editableText: (options: EditableTextStyleOptions) => string;
|
|
97
|
+
numberInput: (options: NumberInputStyleOptions) => string;
|
|
98
|
+
card: (options: CardStyleOptions) => string;
|
|
99
|
+
center: (options: CenterStyleOptions) => string;
|
|
100
|
+
sink: (options: SinkStyleOptions) => string;
|
|
101
|
+
segmentedControl: (options: SegmentedControlStyleOptions) => string;
|
|
102
|
+
}
|
|
103
|
+
export type AppearancePreference = 'light' | 'dark' | 'system';
|
|
104
|
+
export type Appearance = 'light' | 'dark';
|
|
105
|
+
export interface ThemeValue {
|
|
106
|
+
setAppearancePreference: (appearance: AppearancePreference) => void;
|
|
107
|
+
appearancePreference: Signal<AppearancePreference>;
|
|
108
|
+
appearance: Signal<Appearance>;
|
|
109
|
+
theme: ThemeDefinition;
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './label';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TNode } from '@tempots/dom';
|
|
2
|
+
export declare const EmphasisLabel: (...children: TNode[]) => import("@tempots/dom").Renderable;
|
|
3
|
+
export declare const Label: (...children: TNode[]) => import("@tempots/dom").Renderable;
|
|
4
|
+
export declare const MutedLabel: (...children: TNode[]) => import("@tempots/dom").Renderable;
|
|
5
|
+
export declare const ErrorLabel: (...children: TNode[]) => import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { Use } from '@tempots/dom';
|
|
2
|
+
export * from './components/button';
|
|
3
|
+
export * from './components/data';
|
|
4
|
+
export * from './components/form';
|
|
5
|
+
export * from './components/layout';
|
|
6
|
+
export * from './components/misc';
|
|
7
|
+
export * from './components/overlay';
|
|
8
|
+
export * from './components/theme';
|
|
9
|
+
export * from './components/typography';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ButtonStyleOptions, CardStyleOptions, CenterStyleOptions, CheckboxInputStyleOptions, ControlInputWrapperStyleOptions, EditableTextStyleOptions, IconStyleOptions, InputContainerStyleOptions, LabelStyleOptions, NumberInputStyleOptions, OverlayStyleOptions, PanelStyleOptions, SegmentedControlStyleOptions, SinkStyleOptions, TagStyleOptions, ThemeDefinition } from '@/components/theme';
|
|
2
|
+
export declare class BeatUITheme implements ThemeDefinition {
|
|
3
|
+
button({ variant, size, color, roundedness }: ButtonStyleOptions): string;
|
|
4
|
+
overlay({ effect, mode }: OverlayStyleOptions): string;
|
|
5
|
+
icon({ size, color }: IconStyleOptions): string;
|
|
6
|
+
panel({ side, color, shadow }: PanelStyleOptions): string;
|
|
7
|
+
label(options: LabelStyleOptions): string;
|
|
8
|
+
inputContainer({ disabled, hasError }: InputContainerStyleOptions): string;
|
|
9
|
+
controlInputWrapper(_options?: ControlInputWrapperStyleOptions): string;
|
|
10
|
+
controlInputWrapperLabelText({ hasError, disabled, }: ControlInputWrapperStyleOptions): string;
|
|
11
|
+
tag({ disabled, color }: TagStyleOptions): string;
|
|
12
|
+
checkboxInput(_options: CheckboxInputStyleOptions): string;
|
|
13
|
+
editableText(_options: EditableTextStyleOptions): string;
|
|
14
|
+
numberInput(_options: NumberInputStyleOptions): string;
|
|
15
|
+
card({ variant, size, roundedness, }: CardStyleOptions): string;
|
|
16
|
+
center({ gap }: CenterStyleOptions): string;
|
|
17
|
+
sink({ variant, size, roundedness, }: SinkStyleOptions): string;
|
|
18
|
+
segmentedControl({ size }: SegmentedControlStyleOptions): string;
|
|
19
|
+
}
|