@tempots/beatui 0.0.6 → 0.1.1
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/README.md +30 -2
- package/dist/beatui.css +1 -1
- package/dist/index.es.js +3942 -2851
- package/dist/index.umd.js +100 -5
- package/dist/types/components/data/icon.d.ts +5 -1
- package/dist/types/components/data/tag.d.ts +4 -2
- package/dist/types/components/form/control/control-input-wrapper.d.ts +1 -1
- package/dist/types/components/form/control/control-options.d.ts +2 -2
- package/dist/types/components/form/control/date-control.d.ts +2 -1
- package/dist/types/components/form/control/date-time-control.d.ts +2 -1
- package/dist/types/components/form/control/email-control.d.ts +2 -1
- package/dist/types/components/form/control/ensure-control.d.ts +3 -0
- package/dist/types/components/form/control/lazy-native-select-control.d.ts +2 -2
- package/dist/types/components/form/control/list-control.d.ts +14 -0
- package/dist/types/components/form/control/native-select-control.d.ts +2 -2
- package/dist/types/components/form/control/nullable-date-control.d.ts +2 -1
- package/dist/types/components/form/control/nullable-date-time-control.d.ts +2 -1
- package/dist/types/components/form/control/nullable-string-date-control.d.ts +2 -1
- package/dist/types/components/form/control/nullable-string-date-time-control.d.ts +2 -1
- package/dist/types/components/form/control/nullable-text-area-control.d.ts +2 -2
- package/dist/types/components/form/control/nullable-text-control.d.ts +2 -1
- package/dist/types/components/form/control/number-control.d.ts +2 -2
- package/dist/types/components/form/control/password-control.d.ts +2 -1
- package/dist/types/components/form/control/segmented-control.d.ts +6 -8
- package/dist/types/components/form/control/string-date-control.d.ts +2 -1
- package/dist/types/components/form/control/tags-control.d.ts +2 -1
- package/dist/types/components/form/control/text-area-control.d.ts +2 -2
- package/dist/types/components/form/control/text-control.d.ts +7 -6
- package/dist/types/components/form/controller/controller.d.ts +50 -0
- package/dist/types/components/form/controller/index.d.ts +3 -4
- package/dist/types/components/form/controller/validation-result.d.ts +3 -2
- package/dist/types/components/form/input/appearance-selector.d.ts +8 -0
- package/dist/types/components/form/input/index.d.ts +2 -1
- package/dist/types/components/form/input/input-options.d.ts +3 -3
- package/dist/types/components/form/input/{toggle.d.ts → switch.d.ts} +3 -2
- package/dist/types/components/form/use-form.d.ts +16 -5
- package/dist/types/components/layout/app-shell.d.ts +3 -3
- package/dist/types/components/layout/collapse.d.ts +5 -0
- package/dist/types/components/layout/index.d.ts +2 -0
- package/dist/types/components/layout/scrollable-panel.d.ts +8 -0
- package/dist/types/components/layout/with-breakpoint.d.ts +4 -4
- package/dist/types/components/navigation/flyout.d.ts +44 -0
- package/dist/types/components/navigation/index.d.ts +3 -0
- package/dist/types/components/navigation/menu/menu.d.ts +6 -0
- package/dist/types/components/navigation/sidebar/collapsible-sidebar-group.d.ts +8 -0
- package/dist/types/components/navigation/sidebar/index.d.ts +3 -0
- package/dist/types/components/navigation/sidebar/sidebar-group.d.ts +5 -0
- package/dist/types/components/navigation/sidebar/sidebar-link.d.ts +19 -0
- package/dist/types/components/overlay/drawer.d.ts +29 -0
- package/dist/types/components/overlay/index.d.ts +3 -0
- package/dist/types/components/overlay/modal.d.ts +40 -0
- package/dist/types/components/overlay/overlay.d.ts +6 -9
- package/dist/types/components/overlay/tooltip.d.ts +37 -0
- package/dist/types/components/theme/theme.d.ts +1 -1
- package/dist/types/components/theme/types.d.ts +4 -90
- package/dist/types/index.d.ts +1 -1
- package/dist/types/tokens/colors.d.ts +91 -0
- package/dist/types/tokens/index.d.ts +1 -0
- package/dist/types/tokens/shadows.d.ts +21 -0
- package/dist/types/tokens/spacing.d.ts +2 -1
- package/dist/types/tokens/text-shadows.d.ts +12 -0
- package/dist/types/tokens/typography.d.ts +8 -1
- package/dist/types/tokens/z-index.d.ts +16 -0
- package/dist/types/utils/types.d.ts +1 -0
- package/dist/types/utils/use-animated-toggle.d.ts +25 -8
- package/package.json +7 -18
- package/dist/types/components/form/controller/form-controller.d.ts +0 -4
- package/dist/types/components/form/controller/group-controller.d.ts +0 -15
- package/dist/types/components/form/controller/list-controller.d.ts +0 -22
- package/dist/types/components/form/controller/value-controller.d.ts +0 -27
- package/dist/types/theme/beatui-theme.d.ts +0 -20
- package/dist/types/theme/index.d.ts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ControlOptions } from './control-options';
|
|
2
|
-
import { Value } from '@tempots/dom';
|
|
2
|
+
import { TNode, Value } from '@tempots/dom';
|
|
3
3
|
import { Merge } from '@tempots/std';
|
|
4
4
|
export type NullableTextAreaControlOptions = Merge<ControlOptions<string | null>, {
|
|
5
5
|
rows?: Value<number>;
|
|
6
6
|
}>;
|
|
7
|
-
export declare const NullableTextAreaControl: (options: NullableTextAreaControlOptions) => import("@tempots/dom").Renderable;
|
|
7
|
+
export declare const NullableTextAreaControl: (options: NullableTextAreaControlOptions, ...children: TNode[]) => import("@tempots/dom").Renderable;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ControlOptions } from './control-options';
|
|
2
|
-
|
|
2
|
+
import { TNode } from '@tempots/dom';
|
|
3
|
+
export declare const NullableTextControl: (options: ControlOptions<string | null>, ...children: TNode[]) => import("@tempots/dom").Renderable;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ControlOptions } from './control-options';
|
|
2
2
|
import { Merge } from '@tempots/std';
|
|
3
|
-
import { Value } from '@tempots/dom';
|
|
3
|
+
import { TNode, Value } from '@tempots/dom';
|
|
4
4
|
export type NumberControlOptions = Merge<ControlOptions<number>, {
|
|
5
5
|
step?: Value<number>;
|
|
6
6
|
min?: Value<number>;
|
|
7
7
|
max?: Value<number>;
|
|
8
8
|
}>;
|
|
9
|
-
export declare const NumberControl: (options: NumberControlOptions) => import("@tempots/dom").Renderable;
|
|
9
|
+
export declare const NumberControl: (options: NumberControlOptions, ...children: TNode[]) => import("@tempots/dom").Renderable;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ControlOptions } from './control-options';
|
|
2
|
-
|
|
2
|
+
import { TNode } from '@tempots/dom';
|
|
3
|
+
export declare const PasswordControl: (options: ControlOptions<string>, ...children: TNode[]) => import("@tempots/dom").Renderable;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { TNode, Value } from '@tempots/dom';
|
|
2
2
|
import { ControlSize } from '../../theme';
|
|
3
|
-
export interface
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}[];
|
|
8
|
-
activeSegment: Value<number> | Value<number | null>;
|
|
9
|
-
onSegmentChange?: (index?: number) => void;
|
|
3
|
+
export interface SegmentedControlOptions<T extends Record<string, TNode>, K extends keyof T = keyof T> {
|
|
4
|
+
options: T;
|
|
5
|
+
value: Value<K>;
|
|
6
|
+
onChange?: (value: K) => void;
|
|
10
7
|
size?: Value<ControlSize>;
|
|
8
|
+
disabled?: Value<boolean>;
|
|
11
9
|
}
|
|
12
|
-
export declare function SegmentedControl({
|
|
10
|
+
export declare function SegmentedControl<T extends Record<string, TNode>>({ options, value, onChange, size, disabled, }: SegmentedControlOptions<T, keyof T>, ...children: TNode[]): import("@tempots/dom").Renderable;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ControlOptions } from './control-options';
|
|
2
|
-
|
|
2
|
+
import { TNode } from '@tempots/dom';
|
|
3
|
+
export declare const StringDateControl: (options: ControlOptions<string>, ...children: TNode[]) => import("@tempots/dom").Renderable;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ControlOptions } from './control-options';
|
|
2
|
-
|
|
2
|
+
import { TNode } from '@tempots/dom';
|
|
3
|
+
export declare const TagsControl: (options: ControlOptions<string[]>, ...children: TNode[]) => import("@tempots/dom").Renderable;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ControlOptions } from './control-options';
|
|
2
|
-
import { Value } from '@tempots/dom';
|
|
2
|
+
import { TNode, Value } from '@tempots/dom';
|
|
3
3
|
import { Merge } from '@tempots/std';
|
|
4
4
|
export type TextAreaControlOptions = Merge<ControlOptions<string>, {
|
|
5
5
|
rows?: Value<number>;
|
|
6
6
|
}>;
|
|
7
|
-
export declare const TextAreaControl: (options: TextAreaControlOptions) => import("@tempots/dom").Renderable;
|
|
7
|
+
export declare const TextAreaControl: (options: TextAreaControlOptions, ...children: TNode[]) => import("@tempots/dom").Renderable;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ControlOptions } from './control-options';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
2
|
+
import { Controller } from '../controller/controller';
|
|
3
|
+
import { TNode } from '@tempots/dom';
|
|
4
|
+
export declare const makeOnBlurHandler: (_controller: Controller<any>, onBlur?: () => void) => () => void;
|
|
5
|
+
export declare const makeOnChangeHandler: <T>(controller: Controller<T>, onChange?: (value: T) => void) => (value: T) => void;
|
|
6
|
+
export declare const makeMappedOnChangeHandler: <T, U>(controller: Controller<T>, map: (value: U) => T, onChange?: (value: T) => void) => (value: U) => void;
|
|
7
|
+
export declare const makeNullableOnChangeHandler: <T>(controller: Controller<T | null>, isEmpty: (value: T) => boolean, onChange?: (value: T | null) => void) => (value: T) => void;
|
|
8
|
+
export declare const TextControl: (options: ControlOptions<string>, ...children: TNode[]) => import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Signal } from '@tempots/dom';
|
|
2
|
+
import { Path, PathSegment } from './path';
|
|
3
|
+
import { InvalidDependencies, ValidationResult } from './validation-result';
|
|
4
|
+
export declare class Controller<In> {
|
|
5
|
+
#private;
|
|
6
|
+
readonly path: Path;
|
|
7
|
+
readonly change: (value: In) => void;
|
|
8
|
+
readonly value: Signal<In>;
|
|
9
|
+
readonly status: Signal<ValidationResult>;
|
|
10
|
+
readonly error: Signal<undefined | string>;
|
|
11
|
+
readonly hasError: Signal<boolean>;
|
|
12
|
+
readonly dependencyErrors: Signal<undefined | Record<string | number, InvalidDependencies>>;
|
|
13
|
+
protected readonly parent: {
|
|
14
|
+
disabled: Signal<boolean>;
|
|
15
|
+
};
|
|
16
|
+
readonly disabled: Signal<boolean>;
|
|
17
|
+
constructor(path: Path, change: (value: In) => void, value: Signal<In>, status: Signal<ValidationResult>, parent: {
|
|
18
|
+
disabled: Signal<boolean>;
|
|
19
|
+
});
|
|
20
|
+
get name(): string;
|
|
21
|
+
readonly onDispose: (callback: () => void) => void;
|
|
22
|
+
readonly dispose: () => void;
|
|
23
|
+
readonly disable: () => void;
|
|
24
|
+
readonly enable: () => void;
|
|
25
|
+
readonly array: (equals?: (a: In, b: In) => boolean) => ArrayController<In extends any[] ? In : never>;
|
|
26
|
+
readonly object: (equals?: (a: In, b: In) => boolean) => ObjectController<In extends Record<string, any> ? In : never>;
|
|
27
|
+
readonly transform: <Out>(transform: (value: In) => Out, untransform: (value: Out) => In, subpath?: PathSegment[], equals?: (a: Out, b: Out) => boolean) => Controller<Out>;
|
|
28
|
+
}
|
|
29
|
+
export declare class ObjectController<In extends Record<string, In[keyof In]>> extends Controller<In> {
|
|
30
|
+
#private;
|
|
31
|
+
constructor(path: Path, change: (value: In) => void, value: Signal<In>, status: Signal<ValidationResult>, parent: {
|
|
32
|
+
disabled: Signal<boolean>;
|
|
33
|
+
}, equals: (a: In, b: In) => boolean);
|
|
34
|
+
readonly field: <K extends keyof In & string>(field: K) => Controller<In[K]>;
|
|
35
|
+
}
|
|
36
|
+
export declare class ArrayController<In extends unknown[]> extends Controller<In> {
|
|
37
|
+
#private;
|
|
38
|
+
readonly length: Signal<number>;
|
|
39
|
+
constructor(path: Path, change: (value: In) => void, value: Signal<In>, status: Signal<ValidationResult>, parent: {
|
|
40
|
+
disabled: Signal<boolean>;
|
|
41
|
+
}, equals: (a: In, b: In) => boolean);
|
|
42
|
+
readonly item: (index: number) => Controller<In[number]>;
|
|
43
|
+
readonly push: (...value: In[number][]) => void;
|
|
44
|
+
readonly pop: () => void;
|
|
45
|
+
readonly shift: () => void;
|
|
46
|
+
readonly unshift: (...value: In) => void;
|
|
47
|
+
readonly removeAt: (index: number) => void;
|
|
48
|
+
readonly splice: (start: number, deleteCount?: number) => void;
|
|
49
|
+
readonly move: (from: number, to: number, length?: number) => void;
|
|
50
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from './list-controller';
|
|
1
|
+
export * from '../control/ensure-control';
|
|
2
|
+
export * from '../control/list-control';
|
|
4
3
|
export * from './path';
|
|
5
4
|
export * from './validation-result';
|
|
6
|
-
export * from './
|
|
5
|
+
export * from './controller';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { PathSegment } from './path';
|
|
1
2
|
export type Valid = {
|
|
2
3
|
type: 'Valid';
|
|
3
4
|
};
|
|
4
5
|
export type InvalidDependencies = {
|
|
5
6
|
error?: string;
|
|
6
|
-
dependencies?: Record<
|
|
7
|
+
dependencies?: Record<PathSegment, InvalidDependencies>;
|
|
7
8
|
};
|
|
8
9
|
export type Invalid = {
|
|
9
10
|
type: 'Invalid';
|
|
10
11
|
} & InvalidDependencies;
|
|
11
12
|
export type ValidationResult = Valid | Invalid;
|
|
12
|
-
export declare function makeMapValidationResult(
|
|
13
|
+
export declare function makeMapValidationResult(fields: PathSegment[]): (status: ValidationResult) => ValidationResult;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AppearancePreference } from '@/components/theme';
|
|
2
|
+
import { Value } from '@tempots/dom';
|
|
3
|
+
export type AppearanceSelectorOptions = {
|
|
4
|
+
value: Value<AppearancePreference>;
|
|
5
|
+
onChange?: (value: AppearancePreference) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function AppearanceSelector({ value, onChange, }: AppearanceSelectorOptions): import("@tempots/dom").Renderable;
|
|
8
|
+
export declare function StandaloneAppearanceSelector(): import("@tempots/dom").Renderable;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './appearance-selector';
|
|
1
2
|
export * from './checkbox-input';
|
|
2
3
|
export * from './date-input';
|
|
3
4
|
export * from './date-time-input';
|
|
@@ -16,4 +17,4 @@ export * from './password-input';
|
|
|
16
17
|
export * from './tags-input';
|
|
17
18
|
export * from './text-area';
|
|
18
19
|
export * from './text-input';
|
|
19
|
-
export * from './
|
|
20
|
+
export * from './switch';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TNode, Value } from '@tempots/dom';
|
|
2
2
|
import { Merge } from '@tempots/std';
|
|
3
|
-
import {
|
|
3
|
+
import { Controller } from '../controller/controller';
|
|
4
4
|
export type CommonInputOptions = {
|
|
5
5
|
autocomplete?: Value<string>;
|
|
6
6
|
autofocus?: Value<boolean>;
|
|
@@ -20,13 +20,13 @@ export type InputOptions<V> = Merge<CommonInputOptions, {
|
|
|
20
20
|
onBlur?: () => void;
|
|
21
21
|
}>;
|
|
22
22
|
export declare const CommonInputAttributes: ({ autocomplete, autofocus, class: cls, disabled, name, placeholder, id, }: CommonInputOptions) => import("@tempots/dom").Renderable<import("@tempots/dom").DOMContext>;
|
|
23
|
-
export declare const inputOptionsFromController: <T>(controller:
|
|
23
|
+
export declare const inputOptionsFromController: <T>(controller: Controller<T>) => {
|
|
24
24
|
id: string;
|
|
25
25
|
disabled: import("@tempots/dom").Signal<boolean>;
|
|
26
26
|
value: import("@tempots/dom").Signal<T>;
|
|
27
27
|
hasError: import("@tempots/dom").Signal<boolean>;
|
|
28
28
|
};
|
|
29
|
-
export declare const inputOptionsFromMappedController: <T, U>(controller:
|
|
29
|
+
export declare const inputOptionsFromMappedController: <T, U>(controller: Controller<U>, map: (value: U) => T) => {
|
|
30
30
|
value: import("@tempots/dom").Computed<T>;
|
|
31
31
|
id: string;
|
|
32
32
|
disabled: import("@tempots/dom").Signal<boolean>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Value, TNode } from '@tempots/dom';
|
|
2
2
|
import { ControlSize } from '../../theme/types';
|
|
3
|
-
export type
|
|
3
|
+
export type SwitchOptions = {
|
|
4
4
|
value: Value<boolean>;
|
|
5
5
|
onChange: (value: boolean) => void;
|
|
6
6
|
offLabel?: TNode;
|
|
@@ -8,5 +8,6 @@ export type ToggleOptions = {
|
|
|
8
8
|
label?: TNode;
|
|
9
9
|
disabled?: Value<boolean>;
|
|
10
10
|
size?: ControlSize;
|
|
11
|
+
id?: string;
|
|
11
12
|
};
|
|
12
|
-
export declare const
|
|
13
|
+
export declare const Switch: ({ value, onChange, offLabel, onLabel, label, disabled, size, id, }: SwitchOptions) => import("@tempots/dom").Renderable;
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import { StandardSchemaV1 } from './schema/standard-schema-v1';
|
|
2
|
-
import {
|
|
2
|
+
import { ValidationResult, Controller } from './controller';
|
|
3
3
|
export interface UseFormOptions<In, Out = In> {
|
|
4
4
|
schema: StandardSchemaV1<In, Out>;
|
|
5
5
|
defaultValue?: In;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
8
|
-
|
|
7
|
+
export interface UseControllerOptions<In> {
|
|
8
|
+
defaultValue: In;
|
|
9
|
+
onChange?: (value: In) => void;
|
|
10
|
+
validate?: (value: In) => Promise<ValidationResult> | ValidationResult;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Creates a Controller instance with automatic resource cleanup.
|
|
14
|
+
* The controller will be automatically disposed when the component unmounts.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useController<In>({ defaultValue, onChange, validate, }: UseControllerOptions<In>): Controller<In>;
|
|
17
|
+
export declare function connectCommonAttributes<T>(value: Controller<T>): import("@tempots/dom").Renderable<import("@tempots/dom").DOMContext>;
|
|
18
|
+
export declare function connectStringInput(value: Controller<string>, { triggerOn, }?: {
|
|
9
19
|
triggerOn?: 'change' | 'input';
|
|
10
20
|
}): import("@tempots/dom").Renderable<import("@tempots/dom").DOMContext>;
|
|
11
|
-
export declare function connectNumberInput(value:
|
|
21
|
+
export declare function connectNumberInput(value: Controller<number>, { triggerOn, }?: {
|
|
12
22
|
triggerOn?: 'change' | 'input';
|
|
13
23
|
}): import("@tempots/dom").Renderable<import("@tempots/dom").DOMContext>;
|
|
14
|
-
export declare function
|
|
24
|
+
export declare function standardSchemaResultToValidationResult<Out>(result: StandardSchemaV1.Result<Out>): ValidationResult;
|
|
25
|
+
export declare function useForm<In extends Record<string, any>, Out = In>({ defaultValue, schema, }: UseFormOptions<In, Out>): import("./controller").ObjectController<In extends Record<string, any> ? In : never>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TNode } from '@tempots/dom';
|
|
2
|
-
import {
|
|
2
|
+
import { BeatUIBreakpoint } from './with-breakpoint';
|
|
3
3
|
import { PanelColor, PanelShadow } from '../theme';
|
|
4
4
|
export interface AppShellBreakpointOptions {
|
|
5
5
|
zero: number;
|
|
@@ -36,7 +36,7 @@ export interface AppShellOptions {
|
|
|
36
36
|
main: AppShellMainOptions;
|
|
37
37
|
mainHeader?: AppShellHorizontalOptions;
|
|
38
38
|
mainFooter?: AppShellHorizontalOptions;
|
|
39
|
-
mediumBreakpoint?:
|
|
40
|
-
smallBreakpoint?:
|
|
39
|
+
mediumBreakpoint?: BeatUIBreakpoint;
|
|
40
|
+
smallBreakpoint?: BeatUIBreakpoint;
|
|
41
41
|
}
|
|
42
42
|
export declare function AppShell({ smallBreakpoint, mediumBreakpoint, ...options }: AppShellOptions): import("@tempots/dom").Renderable;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './app-shell';
|
|
2
2
|
export * from './card';
|
|
3
3
|
export * from './center';
|
|
4
|
+
export * from './collapse';
|
|
4
5
|
export * from './group';
|
|
6
|
+
export * from './scrollable-panel';
|
|
5
7
|
export * from './sink';
|
|
6
8
|
export * from './stack';
|
|
7
9
|
export * from './with-breakpoint';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
export type ScrollablePanelOptions = {
|
|
3
|
+
header?: TNode;
|
|
4
|
+
footer?: TNode;
|
|
5
|
+
body: TNode;
|
|
6
|
+
shadowOnScroll?: Value<boolean>;
|
|
7
|
+
};
|
|
8
|
+
export declare function ScrollablePanel({ header, footer, body, shadowOnScroll, }: ScrollablePanelOptions): import("@tempots/dom").Renderable;
|
|
@@ -20,7 +20,7 @@ export interface WithBreakpointOptions<T extends Breakpoints> {
|
|
|
20
20
|
mode?: 'element' | 'viewport';
|
|
21
21
|
}
|
|
22
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
|
|
23
|
+
export type BeatUIBreakpoints = {
|
|
24
24
|
zero: number;
|
|
25
25
|
xs: number;
|
|
26
26
|
sm: number;
|
|
@@ -28,8 +28,8 @@ export type TWBreakpoints = {
|
|
|
28
28
|
lg: number;
|
|
29
29
|
xl: number;
|
|
30
30
|
};
|
|
31
|
-
export type
|
|
32
|
-
export declare function
|
|
31
|
+
export type BeatUIBreakpoint = keyof BeatUIBreakpoints;
|
|
32
|
+
export declare function WithBeatUIBreakpoint(fn: (info: BreakpointInfo<BeatUIBreakpoints>) => TNode): import("@tempots/dom").Renderable;
|
|
33
33
|
export type TWElementBreakpoints = {
|
|
34
34
|
zero: number;
|
|
35
35
|
'3xs': number;
|
|
@@ -45,4 +45,4 @@ export type TWElementBreakpoints = {
|
|
|
45
45
|
'5xl': number;
|
|
46
46
|
'6xl': number;
|
|
47
47
|
};
|
|
48
|
-
export declare function
|
|
48
|
+
export declare function WithBeatUIElementBreakpoint(fn: (info: BreakpointInfo<TWElementBreakpoints>) => TNode): import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
import { Placement } from '@tempots/ui';
|
|
3
|
+
export type FlyoutTrigger = 'hover' | 'focus' | 'hover-focus' | 'click' | 'never';
|
|
4
|
+
export type FlyoutTriggerFunction = (show: () => void, hide: () => void) => TNode;
|
|
5
|
+
export interface PopOverArrowOptions {
|
|
6
|
+
placement: string;
|
|
7
|
+
x?: number;
|
|
8
|
+
y?: number;
|
|
9
|
+
centerOffset: number;
|
|
10
|
+
containerWidth: number;
|
|
11
|
+
containerHeight: number;
|
|
12
|
+
}
|
|
13
|
+
export interface FlyoutOptions {
|
|
14
|
+
/** The flyout content to display */
|
|
15
|
+
content: () => TNode;
|
|
16
|
+
/** Placement of the flyout relative to the trigger element */
|
|
17
|
+
placement?: Value<Placement>;
|
|
18
|
+
/** Delay in milliseconds before showing the flyout on hover */
|
|
19
|
+
showDelay?: Value<number>;
|
|
20
|
+
/** Delay in milliseconds before hiding the flyout after mouse leave */
|
|
21
|
+
hideDelay?: Value<number>;
|
|
22
|
+
/** Offset in pixels from the main axis (vertical for top/bottom, horizontal for left/right) */
|
|
23
|
+
mainAxisOffset?: Value<number>;
|
|
24
|
+
/** Offset in pixels from the cross axis (horizontal for top/bottom, vertical for left/right) */
|
|
25
|
+
crossAxisOffset?: Value<number>;
|
|
26
|
+
/** How to show the flyout */
|
|
27
|
+
showOn?: Value<FlyoutTrigger> | FlyoutTriggerFunction;
|
|
28
|
+
/** Whether the flyout can be closed with Escape key */
|
|
29
|
+
closable?: Value<boolean>;
|
|
30
|
+
/** Optional arrow configuration - receives a signal with PopOver positioning data */
|
|
31
|
+
arrow?: (signal: any) => TNode;
|
|
32
|
+
/** Additional role attribute for accessibility */
|
|
33
|
+
role?: Value<string>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Flyout component that provides a flexible popover with various trigger options.
|
|
37
|
+
* This is the base component that powers Tooltip and other overlay components.
|
|
38
|
+
*
|
|
39
|
+
* Unlike other flyout libraries, this component is designed to be a child of the element
|
|
40
|
+
* it provides a flyout for, rather than wrapping it.
|
|
41
|
+
*
|
|
42
|
+
* Uses @tempo-ts/ui PopOver for positioning.
|
|
43
|
+
*/
|
|
44
|
+
export declare function Flyout(options: FlyoutOptions): TNode;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
export type CollapsibleSidebarGroupOptions = {
|
|
3
|
+
icon?: Value<string>;
|
|
4
|
+
header: TNode;
|
|
5
|
+
rail?: Value<boolean>;
|
|
6
|
+
startOpen?: Value<boolean>;
|
|
7
|
+
};
|
|
8
|
+
export declare function CollapsibleSidebarGroup({ rail, icon, header, startOpen, }: CollapsibleSidebarGroupOptions, ...children: TNode[]): import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DOMContext, TNode, Value } from '@tempots/dom';
|
|
2
|
+
export type UrlAction = {
|
|
3
|
+
href: Value<string>;
|
|
4
|
+
};
|
|
5
|
+
export type ClickAction = {
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
};
|
|
8
|
+
export type LinkAction = UrlAction | ClickAction;
|
|
9
|
+
export type SidebarLinkOptions = {
|
|
10
|
+
content: TNode;
|
|
11
|
+
icon?: Value<string>;
|
|
12
|
+
right?: TNode;
|
|
13
|
+
action?: {
|
|
14
|
+
icon: Value<string>;
|
|
15
|
+
label?: Value<string>;
|
|
16
|
+
onClick?: (ctx: DOMContext) => void;
|
|
17
|
+
};
|
|
18
|
+
} & LinkAction;
|
|
19
|
+
export declare function SidebarLink(options: SidebarLinkOptions): import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
import { OverlayEffect } from '../theme/types';
|
|
3
|
+
export interface DrawerOptions {
|
|
4
|
+
/** Size of the drawer */
|
|
5
|
+
size?: Value<'sm' | 'md' | 'lg' | 'xl'>;
|
|
6
|
+
/** Side of the viewport/element to anchor the drawer to */
|
|
7
|
+
side?: Value<'top' | 'right' | 'bottom' | 'left'>;
|
|
8
|
+
/** Whether the drawer can be closed by clicking outside or pressing escape */
|
|
9
|
+
dismissable?: Value<boolean>;
|
|
10
|
+
/** Whether to show the close button in header (only applies if header is provided) */
|
|
11
|
+
showCloseButton?: Value<boolean>;
|
|
12
|
+
/** Callback when drawer is closed */
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
/** Overlay effect */
|
|
15
|
+
overlayEffect?: Value<OverlayEffect>;
|
|
16
|
+
/** Container for the overlay: 'body' (default) or 'element' (current element) */
|
|
17
|
+
container?: 'body' | 'element';
|
|
18
|
+
/** Header content for the drawer */
|
|
19
|
+
header?: TNode;
|
|
20
|
+
/** Body content for the drawer */
|
|
21
|
+
body: TNode;
|
|
22
|
+
/** Footer content for the drawer */
|
|
23
|
+
footer?: TNode;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Drawer component that provides a slide-out panel anchored to any side
|
|
27
|
+
* Built on top of the overlay component
|
|
28
|
+
*/
|
|
29
|
+
export declare function Drawer(fn: (open: (options: DrawerOptions) => void, close: () => void) => TNode): TNode;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
import { OverlayEffect } from '../theme';
|
|
3
|
+
export interface ModalOptions {
|
|
4
|
+
/** Size of the modal */
|
|
5
|
+
size?: Value<'sm' | 'md' | 'lg' | 'xl'>;
|
|
6
|
+
/** Whether the modal can be closed by clicking outside or pressing escape */
|
|
7
|
+
dismissable?: Value<boolean>;
|
|
8
|
+
/** Whether to show the close button in header (only applies if header is provided) */
|
|
9
|
+
showCloseButton?: Value<boolean>;
|
|
10
|
+
/** Callback when modal is closed */
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
/** Overlay effect */
|
|
13
|
+
overlayEffect?: Value<OverlayEffect>;
|
|
14
|
+
/** Container for the overlay: 'body' (default) or 'element' (current element) */
|
|
15
|
+
container?: 'body' | 'element';
|
|
16
|
+
/** Position of the modal: 'center' (default), 'top', 'bottom', 'left', 'right', 'top-left', 'top-right', 'bottom-left', 'bottom-right' */
|
|
17
|
+
position?: Value<'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'>;
|
|
18
|
+
}
|
|
19
|
+
export interface ModalContentOptions {
|
|
20
|
+
/** Optional header content - if provided, overrides title */
|
|
21
|
+
header?: TNode;
|
|
22
|
+
/** Main body content */
|
|
23
|
+
body: TNode;
|
|
24
|
+
/** Optional footer content with action items */
|
|
25
|
+
footer?: TNode;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Modal component that provides a structured dialog with optional header, body, and footer
|
|
29
|
+
* Built on top of the overlay component
|
|
30
|
+
*/
|
|
31
|
+
export declare function Modal(options: ModalOptions, fn: (open: (content: ModalContentOptions) => void, close: () => void) => TNode): TNode;
|
|
32
|
+
/**
|
|
33
|
+
* Convenience function to create a confirmation modal
|
|
34
|
+
*/
|
|
35
|
+
export declare function ConfirmModal(options: ModalOptions & {
|
|
36
|
+
confirmText?: Value<string>;
|
|
37
|
+
cancelText?: Value<string>;
|
|
38
|
+
onConfirm?: () => void;
|
|
39
|
+
onCancel?: () => void;
|
|
40
|
+
}, fn: (open: (message: TNode) => void, close: () => void) => TNode): TNode;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
2
|
import { OverlayEffect } from '../theme/types';
|
|
3
3
|
export type OverlayOptions = {
|
|
4
|
-
effect?: OverlayEffect
|
|
5
|
-
mode
|
|
4
|
+
effect?: Value<OverlayEffect>;
|
|
5
|
+
mode?: Value<'capturing' | 'non-capturing'>;
|
|
6
6
|
onClickOutside?: () => void;
|
|
7
7
|
onEscape?: () => void;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
mode: 'non-capturing';
|
|
8
|
+
content?: TNode;
|
|
9
|
+
container?: 'body' | 'element';
|
|
11
10
|
};
|
|
12
|
-
export declare function
|
|
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;
|
|
11
|
+
export declare function Overlay(fn: (open: (options: OverlayOptions) => void, close: () => void) => TNode): import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
import { Placement } from '@tempots/ui';
|
|
3
|
+
import { FlyoutTrigger } from '../navigation/flyout';
|
|
4
|
+
export type TooltipTrigger = FlyoutTrigger;
|
|
5
|
+
export interface TooltipOptions {
|
|
6
|
+
/** The tooltip content to display */
|
|
7
|
+
content: TNode;
|
|
8
|
+
/** Placement of the tooltip relative to the trigger element */
|
|
9
|
+
placement?: Value<Placement>;
|
|
10
|
+
/** Delay in milliseconds before showing the tooltip on hover */
|
|
11
|
+
showDelay?: Value<number>;
|
|
12
|
+
/** Delay in milliseconds before hiding the tooltip after mouse leave */
|
|
13
|
+
hideDelay?: Value<number>;
|
|
14
|
+
/** Offset in pixels from the main axis (vertical for top/bottom, horizontal for left/right) */
|
|
15
|
+
mainAxisOffset?: Value<number>;
|
|
16
|
+
/** Offset in pixels from the cross axis (horizontal for top/bottom, vertical for left/right) */
|
|
17
|
+
crossAxisOffset?: Value<number>;
|
|
18
|
+
/** How to show the tooltip */
|
|
19
|
+
showOn?: Value<TooltipTrigger>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Tooltip component that provides contextual information when hovering or focusing on elements.
|
|
23
|
+
* Unlike other tooltip libraries, this component is designed to be a child of the element
|
|
24
|
+
* it provides a tooltip for, rather than wrapping it.
|
|
25
|
+
*
|
|
26
|
+
* Built on top of the Flyout component for positioning and interaction logic.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* Button(
|
|
31
|
+
* { onClick: () => console.log('clicked') },
|
|
32
|
+
* 'Click me',
|
|
33
|
+
* Tooltip({ content: 'This button does something important' })
|
|
34
|
+
* )
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function Tooltip(options: TooltipOptions): TNode;
|
|
@@ -2,4 +2,4 @@ import { Provider } from '@tempots/dom';
|
|
|
2
2
|
import '../../styles/index.css';
|
|
3
3
|
import { ThemeValue } from './types';
|
|
4
4
|
export declare const Theme: Provider<ThemeValue, object>;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const ThemeAppearance: () => import("@tempots/dom").Renderable;
|