@tempots/beatui 0.9.0 → 0.10.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.
- package/dist/beatui.css +1 -1
- package/dist/index.es.js +3681 -3179
- package/dist/index.umd.js +18 -18
- package/dist/types/components/form/control/combobox-control.d.ts +11 -0
- package/dist/types/components/form/control/control-input-wrapper.d.ts +1 -1
- package/dist/types/components/form/control/control-options.d.ts +1 -0
- package/dist/types/components/form/control/index.d.ts +1 -0
- package/dist/types/components/form/input/combobox.d.ts +39 -0
- package/dist/types/components/form/input/index.d.ts +1 -0
- package/dist/types/components/form/input/input-wrapper.d.ts +2 -1
- package/dist/types/components/navigation/flyout.d.ts +1 -1
- package/dist/types/components/navigation/index.d.ts +1 -0
- package/dist/types/components/navigation/menu.d.ts +106 -0
- package/dist/types/components/navigation/sidebar/index.d.ts +1 -0
- package/dist/types/components/navigation/sidebar/sidebar-separator.d.ts +1 -0
- package/dist/types/tokens/colors.d.ts +1 -1
- package/package.json +3 -3
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SidebarSeparator(): import("@tempots/dom").Renderable;
|
|
@@ -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" | "
|
|
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: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tempots/beatui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.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.
|
|
57
|
+
"@tempots/dom": "28.3.0",
|
|
58
58
|
"@tempots/std": "0.22.1",
|
|
59
|
-
"@tempots/ui": "6.
|
|
59
|
+
"@tempots/ui": "6.2.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependenciesMeta": {
|
|
62
62
|
"@tempots/dom": {
|