@aleph-alpha/ui-library 6.3.4 → 6.4.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/config.js +2 -1
- package/dist/system/components/UiDropdownMenu/UiDropdownMenuSubContent.vue.d.ts +102 -2
- package/dist/system/components/UiDropdownMenu/UiDropdownMenuViewport.vue.d.ts +23 -0
- package/dist/system/components/UiDropdownMenu/menu-metrics.d.ts +4 -0
- package/dist/system/components/UiDropdownMenu/placeMobileSubmenu.d.ts +55 -0
- package/dist/system/components/UiDropdownMenu/types.d.ts +3 -0
- package/dist/system/components/UiDropdownMenu/useMobileSubmenuPlacement.d.ts +18 -0
- package/dist/system/components/UiFileUploadBox/UiFileUploadBox.vue.d.ts +2 -2
- package/dist/system/components/UiResizable/UiResizablePanel.vue.d.ts +2 -2
- package/dist/system/components/UiToggle/UiToggle.vue.d.ts +2 -1
- package/dist/system/components/UiToggle/types.d.ts +10 -2
- package/dist/system/components/UiToggleGroup/UiToggleGroupItem.vue.d.ts +5 -1
- package/dist/system/components/UiToggleGroup/types.d.ts +12 -2
- package/dist/system/components/core/dropdown-menu/DropdownMenuSubContent.vue.d.ts +2 -6
- package/dist/system/components/core/resizable/ResizablePanel.vue.d.ts +2 -2
- package/dist/system/components/core/toggle/Toggle.vue.d.ts +3 -1
- package/dist/system/components/core/toggle/index.d.ts +47 -2
- package/dist/system/components/core/toggle-group/ToggleGroup.vue.d.ts +3 -1
- package/dist/system/components/core/toggle-group/ToggleGroupItem.vue.d.ts +11 -1
- package/dist/system/components/core/toggle-group/context.d.ts +1 -0
- package/dist/system/components/core/toggle-group/index.d.ts +10 -2
- package/dist/system/lib.js +12660 -12479
- package/dist/system/patterns/UiFileUpload/UiFileUpload.vue.d.ts +2 -2
- package/dist/system/patterns/UiLayout/layout-shell.d.ts +171 -12
- package/dist/system/patterns/UiProfileCard/profile-card.d.ts +51 -1
- package/dist/system/patterns/UiTopBar/accessory-dropdown.d.ts +9 -4
- package/package.json +2 -2
- package/src/components/UiDropdownMenu/UiDropdownMenu.stories.ts +819 -31
- package/src/components/UiDropdownMenu/UiDropdownMenuContent.vue +4 -1
- package/src/components/UiDropdownMenu/UiDropdownMenuSubContent.vue +142 -1
- package/src/components/UiDropdownMenu/UiDropdownMenuSubTrigger.vue +28 -0
- package/src/components/UiDropdownMenu/UiDropdownMenuViewport.vue +171 -0
- package/src/components/UiDropdownMenu/__tests__/UiDropdownMenu.test.ts +326 -0
- package/src/components/UiDropdownMenu/__tests__/placeMobileSubmenu.test.ts +128 -0
- package/src/components/UiDropdownMenu/menu-metrics.ts +5 -0
- package/src/components/UiDropdownMenu/placeMobileSubmenu.ts +96 -0
- package/src/components/UiDropdownMenu/types.ts +3 -0
- package/src/components/UiDropdownMenu/useMobileSubmenuPlacement.ts +163 -0
- package/src/components/UiSnackbar/UiSnackbar.stories.ts +104 -32
- package/src/components/UiToggle/UiToggle.stories.ts +386 -261
- package/src/components/UiToggle/UiToggle.vue +2 -0
- package/src/components/UiToggle/__tests__/UiToggle.test.ts +63 -10
- package/src/components/UiToggle/types.ts +10 -2
- package/src/components/UiToggleGroup/UiToggleGroup.stories.ts +765 -30
- package/src/components/UiToggleGroup/UiToggleGroup.vue +2 -0
- package/src/components/UiToggleGroup/UiToggleGroupItem.vue +10 -1
- package/src/components/UiToggleGroup/__tests__/UiToggleGroup.test.ts +83 -4
- package/src/components/UiToggleGroup/types.ts +12 -2
- package/src/components/core/dropdown-menu/DropdownMenuContent.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuSubContent.vue +31 -20
- package/src/components/core/toggle/Toggle.vue +12 -5
- package/src/components/core/toggle/index.ts +47 -19
- package/src/components/core/toggle-group/ToggleGroup.vue +20 -4
- package/src/components/core/toggle-group/ToggleGroupItem.vue +36 -8
- package/src/components/core/toggle-group/context.ts +1 -0
- package/src/components/core/toggle-group/index.ts +10 -24
- package/src/patterns/UiDataTable/UiDataTableColumnFilter.vue +1 -1
- package/src/patterns/UiDataTable/UiDataTableFilterMenu.vue +1 -1
- package/src/patterns/UiProfileCard/UiProfileCard.stories.ts +13 -6
- package/src/patterns/UiTopBar/accessory-dropdown.ts +5 -3
package/config.js
CHANGED
|
@@ -1095,7 +1095,8 @@ const vHoverOverlayCSS = `
|
|
|
1095
1095
|
opacity: 1;
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
1098
|
-
|
|
1098
|
+
/* Keyboard focus only: a mouse click leaves :focus on the element, which would
|
|
1099
|
+
latch the overlay after every click. */
|
|
1099
1100
|
.hover-layer:focus-visible::after,
|
|
1100
1101
|
.hover-layer:has(:focus-visible)::after,
|
|
1101
1102
|
.hover-layer:active::after,
|
|
@@ -4,7 +4,57 @@ declare function __VLS_template(): {
|
|
|
4
4
|
slots: {
|
|
5
5
|
default?(_: {}): any;
|
|
6
6
|
};
|
|
7
|
-
refs: {
|
|
7
|
+
refs: {
|
|
8
|
+
viewportRef: ({
|
|
9
|
+
$: import('vue').ComponentInternalInstance;
|
|
10
|
+
$data: {};
|
|
11
|
+
$props: Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>;
|
|
12
|
+
$attrs: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
$refs: {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
} & {
|
|
18
|
+
scrollEl: HTMLDivElement;
|
|
19
|
+
};
|
|
20
|
+
$slots: Readonly<{
|
|
21
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
24
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
25
|
+
$host: Element | null;
|
|
26
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
27
|
+
$el: any;
|
|
28
|
+
$options: import('vue').ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {
|
|
29
|
+
scrollEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
30
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
31
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
32
|
+
created?: (() => void) | (() => void)[];
|
|
33
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
34
|
+
mounted?: (() => void) | (() => void)[];
|
|
35
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
36
|
+
updated?: (() => void) | (() => void)[];
|
|
37
|
+
activated?: (() => void) | (() => void)[];
|
|
38
|
+
deactivated?: (() => void) | (() => void)[];
|
|
39
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
40
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
41
|
+
destroyed?: (() => void) | (() => void)[];
|
|
42
|
+
unmounted?: (() => void) | (() => void)[];
|
|
43
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
44
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
45
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
46
|
+
};
|
|
47
|
+
$forceUpdate: () => void;
|
|
48
|
+
$nextTick: typeof import('vue').nextTick;
|
|
49
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
50
|
+
} & Readonly<{}> & Omit<Readonly<{}> & Readonly<{}>, "scrollEl"> & import('vue').ShallowUnwrapRef<{
|
|
51
|
+
scrollEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
52
|
+
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
53
|
+
$slots: {
|
|
54
|
+
default?(_: {}): any;
|
|
55
|
+
};
|
|
56
|
+
}) | null;
|
|
57
|
+
};
|
|
8
58
|
rootEl: any;
|
|
9
59
|
};
|
|
10
60
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
@@ -14,7 +64,57 @@ declare const __VLS_component: import('vue').DefineComponent<UiDropdownMenuSubCo
|
|
|
14
64
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
15
65
|
}>, {
|
|
16
66
|
sideOffset: number;
|
|
17
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
67
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
68
|
+
viewportRef: ({
|
|
69
|
+
$: import('vue').ComponentInternalInstance;
|
|
70
|
+
$data: {};
|
|
71
|
+
$props: Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>;
|
|
72
|
+
$attrs: {
|
|
73
|
+
[x: string]: unknown;
|
|
74
|
+
};
|
|
75
|
+
$refs: {
|
|
76
|
+
[x: string]: unknown;
|
|
77
|
+
} & {
|
|
78
|
+
scrollEl: HTMLDivElement;
|
|
79
|
+
};
|
|
80
|
+
$slots: Readonly<{
|
|
81
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
84
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
85
|
+
$host: Element | null;
|
|
86
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
87
|
+
$el: any;
|
|
88
|
+
$options: import('vue').ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {
|
|
89
|
+
scrollEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
90
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
91
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
92
|
+
created?: (() => void) | (() => void)[];
|
|
93
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
94
|
+
mounted?: (() => void) | (() => void)[];
|
|
95
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
96
|
+
updated?: (() => void) | (() => void)[];
|
|
97
|
+
activated?: (() => void) | (() => void)[];
|
|
98
|
+
deactivated?: (() => void) | (() => void)[];
|
|
99
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
100
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
101
|
+
destroyed?: (() => void) | (() => void)[];
|
|
102
|
+
unmounted?: (() => void) | (() => void)[];
|
|
103
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
104
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
105
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
106
|
+
};
|
|
107
|
+
$forceUpdate: () => void;
|
|
108
|
+
$nextTick: typeof import('vue').nextTick;
|
|
109
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
110
|
+
} & Readonly<{}> & Omit<Readonly<{}> & Readonly<{}>, "scrollEl"> & import('vue').ShallowUnwrapRef<{
|
|
111
|
+
scrollEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
112
|
+
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
113
|
+
$slots: {
|
|
114
|
+
default?(_: {}): any;
|
|
115
|
+
};
|
|
116
|
+
}) | null;
|
|
117
|
+
}, any>;
|
|
18
118
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
19
119
|
export default _default;
|
|
20
120
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {
|
|
7
|
+
scrollEl: HTMLDivElement;
|
|
8
|
+
};
|
|
9
|
+
rootEl: any;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
13
|
+
scrollEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
14
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
15
|
+
scrollEl: HTMLDivElement;
|
|
16
|
+
}, any>;
|
|
17
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Matches the `sm` breakpoint: below it, the menu uses the mobile layout. */
|
|
2
|
+
export declare const DROPDOWN_MENU_MOBILE_MEDIA = "(max-width: 639px)";
|
|
3
|
+
/** Gap between the trigger row and the submenu stacked above or below it. */
|
|
4
|
+
export declare const DROPDOWN_MENU_SUBMENU_GAP_PX = 8;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The trigger row, the parent menu, and the submenu size used to place the
|
|
3
|
+
* submenu.
|
|
4
|
+
*/
|
|
5
|
+
export interface MobileSubmenuPlacementInput {
|
|
6
|
+
/** The row that opened the submenu, in viewport coordinates. */
|
|
7
|
+
trigger: Pick<DOMRect, 'top' | 'bottom'>;
|
|
8
|
+
/** The parent menu panel, in viewport coordinates. */
|
|
9
|
+
parent: Pick<DOMRect, 'left' | 'width'>;
|
|
10
|
+
/** The submenu panel height when nothing constrains it, in pixels. */
|
|
11
|
+
submenuHeight: number;
|
|
12
|
+
/**
|
|
13
|
+
* Height of the panel around its scroll area (vertical padding and borders),
|
|
14
|
+
* in pixels. Kept when the scroll area has to shrink. Defaults to 0.
|
|
15
|
+
*/
|
|
16
|
+
chrome?: number;
|
|
17
|
+
/** The viewport height, in pixels. */
|
|
18
|
+
viewportHeight: number;
|
|
19
|
+
/** The gap between the trigger row and the submenu, in pixels. */
|
|
20
|
+
gap?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Where a submenu sits against its trigger row on a narrow screen.
|
|
24
|
+
*/
|
|
25
|
+
export interface MobileSubmenuPlacement {
|
|
26
|
+
/** Edge of the trigger row the submenu opens from. */
|
|
27
|
+
side: 'top' | 'bottom';
|
|
28
|
+
/** Viewport `top` of the submenu, in pixels. */
|
|
29
|
+
top: number;
|
|
30
|
+
/** Viewport `left` of the submenu, in pixels. */
|
|
31
|
+
left: number;
|
|
32
|
+
/** Width of the submenu, matching the parent, in pixels. */
|
|
33
|
+
width: number;
|
|
34
|
+
/** Height of the submenu once it is fitted to the chosen side, in pixels. */
|
|
35
|
+
height: number;
|
|
36
|
+
/**
|
|
37
|
+
* Cap for the scroll area so the panel fits the chosen side, in pixels, or
|
|
38
|
+
* `null` when the whole panel fits without one.
|
|
39
|
+
*/
|
|
40
|
+
scrollMaxHeight: number | null;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Places a submenu above or below the row that opened it, at the parent's
|
|
44
|
+
* width.
|
|
45
|
+
*
|
|
46
|
+
* The gap is measured from the trigger row, not from the parent panel, so the
|
|
47
|
+
* submenu may cover the rest of the parent. It opens upward whenever the space
|
|
48
|
+
* above can hold it, downward when only the space below can, and otherwise
|
|
49
|
+
* toward the larger side. When even that side is too short, the scroll area
|
|
50
|
+
* is capped so the panel ends at the viewport edge instead of past it, and
|
|
51
|
+
* every row stays reachable by scrolling.
|
|
52
|
+
* @param input Trigger row, parent panel, submenu height, and viewport height.
|
|
53
|
+
* @returns The side, viewport box, and scroll cap of the submenu.
|
|
54
|
+
*/
|
|
55
|
+
export declare function placeMobileSubmenu(input: MobileSubmenuPlacementInput): MobileSubmenuPlacement;
|
|
@@ -228,6 +228,9 @@ export interface UiDropdownMenuSubTriggerProps {
|
|
|
228
228
|
/**
|
|
229
229
|
* Props for the UiDropdownMenuSubContent component.
|
|
230
230
|
* The floating container for submenu items.
|
|
231
|
+
*
|
|
232
|
+
* On a narrow screen the submenu opens above or below the parent menu, at the
|
|
233
|
+
* parent's width, instead of to the side.
|
|
231
234
|
*/
|
|
232
235
|
export interface UiDropdownMenuSubContentProps {
|
|
233
236
|
/**
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Measures where an open submenu goes on a narrow screen and hands the result
|
|
3
|
+
* to the stylesheet.
|
|
4
|
+
*
|
|
5
|
+
* The panel gets `--ui-dropdown-submenu-top|left|width` and `data-mobile-side`
|
|
6
|
+
* (plus `--ui-dropdown-submenu-scroll-max-height` and `data-mobile-clamped`
|
|
7
|
+
* when the chosen side is too short for the whole panel), and the trigger row
|
|
8
|
+
* gets `data-mobile-submenu-side`; the CSS in
|
|
9
|
+
* `UiDropdownMenuSubContent` turns those into a fixed position and neutralises
|
|
10
|
+
* the side placement reka-ui writes to its wrapper. Keeping the override in
|
|
11
|
+
* the stylesheet means nothing here has to be reapplied when reka-ui
|
|
12
|
+
* repositions.
|
|
13
|
+
* @param getContent The open submenu panel, once it is in the document.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useMobileSubmenuPlacement(getContent: () => HTMLElement | null): {
|
|
16
|
+
apply: () => void;
|
|
17
|
+
clear: () => void;
|
|
18
|
+
};
|
|
@@ -20,11 +20,11 @@ declare const __VLS_component: import('vue').DefineComponent<UiFileUploadBoxProp
|
|
|
20
20
|
keydown: (event: KeyboardEvent) => any;
|
|
21
21
|
error: (payload: import('./types').UiFileUploadBoxErrorPayload) => any;
|
|
22
22
|
change: (event: Event) => any;
|
|
23
|
-
"update:files": (files: File[]) => any;
|
|
24
23
|
dragenter: (event: DragEvent) => any;
|
|
25
24
|
dragleave: (event: DragEvent) => any;
|
|
26
25
|
dragover: (event: DragEvent) => any;
|
|
27
26
|
drop: (event: DragEvent) => any;
|
|
27
|
+
"update:files": (files: File[]) => any;
|
|
28
28
|
pickerOpen: () => any;
|
|
29
29
|
}, string, import('vue').PublicProps, Readonly<UiFileUploadBoxProps> & Readonly<{
|
|
30
30
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
@@ -33,11 +33,11 @@ declare const __VLS_component: import('vue').DefineComponent<UiFileUploadBoxProp
|
|
|
33
33
|
onKeydown?: ((event: KeyboardEvent) => any) | undefined;
|
|
34
34
|
onError?: ((payload: import('./types').UiFileUploadBoxErrorPayload) => any) | undefined;
|
|
35
35
|
onChange?: ((event: Event) => any) | undefined;
|
|
36
|
-
"onUpdate:files"?: ((files: File[]) => any) | undefined;
|
|
37
36
|
onDragenter?: ((event: DragEvent) => any) | undefined;
|
|
38
37
|
onDragleave?: ((event: DragEvent) => any) | undefined;
|
|
39
38
|
onDragover?: ((event: DragEvent) => any) | undefined;
|
|
40
39
|
onDrop?: ((event: DragEvent) => any) | undefined;
|
|
40
|
+
"onUpdate:files"?: ((files: File[]) => any) | undefined;
|
|
41
41
|
onPickerOpen?: (() => any) | undefined;
|
|
42
42
|
}>, {
|
|
43
43
|
disabled: boolean;
|
|
@@ -14,13 +14,13 @@ declare function __VLS_template(): {
|
|
|
14
14
|
};
|
|
15
15
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
16
|
declare const __VLS_component: import('vue').DefineComponent<import('reka-ui').SplitterPanelProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
|
+
resize: (size: number, prevSize: number | undefined) => any;
|
|
17
18
|
collapse: () => any;
|
|
18
19
|
expand: () => any;
|
|
19
|
-
resize: (size: number, prevSize: number | undefined) => any;
|
|
20
20
|
}, string, import('vue').PublicProps, Readonly<import('reka-ui').SplitterPanelProps> & Readonly<{
|
|
21
|
+
onResize?: ((size: number, prevSize: number | undefined) => any) | undefined;
|
|
21
22
|
onCollapse?: (() => any) | undefined;
|
|
22
23
|
onExpand?: (() => any) | undefined;
|
|
23
|
-
onResize?: ((size: number, prevSize: number | undefined) => any) | undefined;
|
|
24
24
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
25
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
26
26
|
export default _default;
|
|
@@ -21,8 +21,9 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
21
21
|
}>, {
|
|
22
22
|
disabled: boolean;
|
|
23
23
|
size: "default" | "sm" | "lg";
|
|
24
|
-
variant: "default" | "
|
|
24
|
+
variant: "default" | "ghost" | "outline";
|
|
25
25
|
active: boolean;
|
|
26
|
+
soft: boolean;
|
|
26
27
|
leftIcon: string;
|
|
27
28
|
rightIcon: string;
|
|
28
29
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A two-state button that can be toggled on or off.
|
|
3
3
|
* Use for enabling/disabling features or switching between states.
|
|
4
4
|
* @category Form Inputs
|
|
5
|
-
* @useCases
|
|
5
|
+
* @useCases dropdown trigger, filter menu trigger, toolbar button, view toggle
|
|
6
6
|
* @keywords toggle, button, pressed, on, off, state
|
|
7
7
|
* @related UiSwitch, UiButton, UiCheckbox
|
|
8
8
|
*/
|
|
@@ -30,7 +30,15 @@ export interface UiToggleProps {
|
|
|
30
30
|
* The visual style variant.
|
|
31
31
|
* @default 'default'
|
|
32
32
|
*/
|
|
33
|
-
variant?: 'default' | '
|
|
33
|
+
variant?: 'default' | 'ghost' | 'outline';
|
|
34
|
+
/**
|
|
35
|
+
* Fills the pressed state with the subtle hover overlay instead of a muted
|
|
36
|
+
* surface. Affects the pressed state only; every other state is unchanged.
|
|
37
|
+
* Intended for dropdown and popover triggers, where the open menu is already
|
|
38
|
+
* a signal and the trigger should not read as a second filled button.
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
soft?: boolean;
|
|
34
42
|
/**
|
|
35
43
|
* The size of the toggle.
|
|
36
44
|
* @default 'default'
|
|
@@ -8,7 +8,11 @@ declare function __VLS_template(): {
|
|
|
8
8
|
rootEl: any;
|
|
9
9
|
};
|
|
10
10
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
-
declare const __VLS_component: import('vue').DefineComponent<UiToggleGroupItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UiToggleGroupItemProps> & Readonly<{}>, {
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<UiToggleGroupItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UiToggleGroupItemProps> & Readonly<{}>, {
|
|
12
|
+
size: "default" | "sm" | "lg";
|
|
13
|
+
variant: "default" | "ghost" | "outline";
|
|
14
|
+
soft: boolean;
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
16
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
13
17
|
export default _default;
|
|
14
18
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -11,7 +11,13 @@ export interface UiToggleGroupBaseProps {
|
|
|
11
11
|
* The visual style variant applied to all items.
|
|
12
12
|
* @default 'default'
|
|
13
13
|
*/
|
|
14
|
-
variant?: 'default' | '
|
|
14
|
+
variant?: 'default' | 'ghost' | 'outline';
|
|
15
|
+
/**
|
|
16
|
+
* Fills the selected items with the subtle hover overlay instead of a muted
|
|
17
|
+
* surface. Affects the selected state only; every other state is unchanged.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
soft?: boolean;
|
|
15
21
|
/**
|
|
16
22
|
* The size applied to all items.
|
|
17
23
|
* @default 'default'
|
|
@@ -110,7 +116,11 @@ export interface UiToggleGroupItemProps {
|
|
|
110
116
|
/**
|
|
111
117
|
* Override the variant for this specific item.
|
|
112
118
|
*/
|
|
113
|
-
variant?: 'default' | '
|
|
119
|
+
variant?: 'default' | 'ghost' | 'outline';
|
|
120
|
+
/**
|
|
121
|
+
* Override the selected fill for this specific item.
|
|
122
|
+
*/
|
|
123
|
+
soft?: boolean;
|
|
114
124
|
/**
|
|
115
125
|
* Override the size for this specific item.
|
|
116
126
|
*/
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { DropdownMenuSubContentProps } from 'reka-ui';
|
|
2
|
-
import { HTMLAttributes } from 'vue';
|
|
3
|
-
type __VLS_Props = DropdownMenuSubContentProps & {
|
|
4
|
-
class?: HTMLAttributes['class'];
|
|
5
|
-
};
|
|
6
2
|
declare function __VLS_template(): {
|
|
7
3
|
attrs: Partial<{}>;
|
|
8
4
|
slots: {
|
|
@@ -12,7 +8,7 @@ declare function __VLS_template(): {
|
|
|
12
8
|
rootEl: any;
|
|
13
9
|
};
|
|
14
10
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
-
declare const __VLS_component: import('vue').DefineComponent<
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<DropdownMenuSubContentProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
12
|
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
17
13
|
pointerDownOutside: (event: import('reka-ui').PointerDownOutsideEvent) => any;
|
|
18
14
|
focusOutside: (event: import('reka-ui').FocusOutsideEvent) => any;
|
|
@@ -20,7 +16,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
20
16
|
openAutoFocus: (event: Event) => any;
|
|
21
17
|
closeAutoFocus: (event: Event) => any;
|
|
22
18
|
entryFocus: (event: Event) => any;
|
|
23
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
19
|
+
}, string, import('vue').PublicProps, Readonly<DropdownMenuSubContentProps> & Readonly<{
|
|
24
20
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
25
21
|
onPointerDownOutside?: ((event: import('reka-ui').PointerDownOutsideEvent) => any) | undefined;
|
|
26
22
|
onFocusOutside?: ((event: import('reka-ui').FocusOutsideEvent) => any) | undefined;
|
|
@@ -15,13 +15,13 @@ declare function __VLS_template(): {
|
|
|
15
15
|
};
|
|
16
16
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
17
|
declare const __VLS_component: import('vue').DefineComponent<SplitterPanelProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
|
+
resize: (size: number, prevSize: number | undefined) => any;
|
|
18
19
|
collapse: () => any;
|
|
19
20
|
expand: () => any;
|
|
20
|
-
resize: (size: number, prevSize: number | undefined) => any;
|
|
21
21
|
}, string, import('vue').PublicProps, Readonly<SplitterPanelProps> & Readonly<{
|
|
22
|
+
onResize?: ((size: number, prevSize: number | undefined) => any) | undefined;
|
|
22
23
|
onCollapse?: (() => any) | undefined;
|
|
23
24
|
onExpand?: (() => any) | undefined;
|
|
24
|
-
onResize?: ((size: number, prevSize: number | undefined) => any) | undefined;
|
|
25
25
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
26
26
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
27
27
|
export default _default;
|
|
@@ -3,6 +3,7 @@ import { ToggleVariants } from '.';
|
|
|
3
3
|
type __VLS_Props = ToggleProps & {
|
|
4
4
|
variant?: ToggleVariants['variant'];
|
|
5
5
|
size?: ToggleVariants['size'];
|
|
6
|
+
soft?: ToggleVariants['soft'];
|
|
6
7
|
};
|
|
7
8
|
declare function __VLS_template(): {
|
|
8
9
|
attrs: Partial<{}>;
|
|
@@ -20,7 +21,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
20
21
|
}>, {
|
|
21
22
|
disabled: boolean;
|
|
22
23
|
size: "default" | "sm" | "lg" | null;
|
|
23
|
-
variant: "default" | "outline" | "
|
|
24
|
+
variant: "default" | "outline" | "ghost" | null;
|
|
25
|
+
soft: boolean | null;
|
|
24
26
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
27
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
26
28
|
export default _default;
|
|
@@ -1,7 +1,52 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
export { default as Toggle } from './Toggle.vue';
|
|
3
|
+
/**
|
|
4
|
+
* Everything a toggle looks like apart from its corner radius. The toggle group
|
|
5
|
+
* builds on this so a grouped item is the same control, only with its corners
|
|
6
|
+
* squared off where it meets its neighbours.
|
|
7
|
+
*
|
|
8
|
+
* `hover-layer` carries hover, keyboard focus, press and `data-state=open` as
|
|
9
|
+
* an overlay; it deliberately ignores the pressed state, so that stays a real
|
|
10
|
+
* fill rather than the same wash.
|
|
11
|
+
*/
|
|
12
|
+
export declare const toggleBaseClasses = "inline-flex items-center justify-center gap-2 label-14-medium transition-colors ui-focus-ring hover-layer hover-layer-subtle disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border bg-transparent text-content-on-surface-primary";
|
|
13
|
+
/**
|
|
14
|
+
* The variants themselves, shared with the toggle group so the two cannot drift
|
|
15
|
+
* apart. Only the base differs between them.
|
|
16
|
+
*/
|
|
17
|
+
export declare const toggleVariantsConfig: {
|
|
18
|
+
readonly variants: {
|
|
19
|
+
readonly variant: {
|
|
20
|
+
readonly default: "border-transparent";
|
|
21
|
+
readonly ghost: "border-transparent";
|
|
22
|
+
readonly outline: "border-input";
|
|
23
|
+
};
|
|
24
|
+
readonly size: {
|
|
25
|
+
readonly default: "label-m-medium py-2.5 px-2";
|
|
26
|
+
readonly sm: "label-s-medium py-1 px-1.5";
|
|
27
|
+
readonly lg: "label-m-medium py-3 px-2.5";
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Pressed fill only: the hover overlay instead of a muted surface.
|
|
31
|
+
*
|
|
32
|
+
* Keyed off `aria-pressed` rather than `data-state`, because a trigger
|
|
33
|
+
* rendered with `as-child` overwrites `data-state` with its own
|
|
34
|
+
* `open`/`closed`, which would drop the fill on every menu trigger.
|
|
35
|
+
*/
|
|
36
|
+
readonly soft: {
|
|
37
|
+
readonly true: "aria-pressed:bg-overlay-hover-subtle";
|
|
38
|
+
readonly false: "aria-pressed:bg-background-surface-muted-subtle";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
readonly defaultVariants: {
|
|
42
|
+
readonly variant: "default";
|
|
43
|
+
readonly size: "default";
|
|
44
|
+
readonly soft: false;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
3
47
|
export declare const toggleVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "outline" | "
|
|
5
|
-
size?: "default" | "sm" | "lg" | null | undefined;
|
|
48
|
+
readonly variant?: "default" | "outline" | "ghost" | null | undefined;
|
|
49
|
+
readonly size?: "default" | "sm" | "lg" | null | undefined;
|
|
50
|
+
readonly soft?: boolean | null | undefined;
|
|
6
51
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
52
|
export type ToggleVariants = VariantProps<typeof toggleVariants>;
|
|
@@ -3,6 +3,7 @@ import { ToggleGroupVariants } from '.';
|
|
|
3
3
|
type __VLS_Props = ToggleGroupRootProps & {
|
|
4
4
|
variant?: ToggleGroupVariants['variant'];
|
|
5
5
|
size?: ToggleGroupVariants['size'];
|
|
6
|
+
soft?: ToggleGroupVariants['soft'];
|
|
6
7
|
};
|
|
7
8
|
declare function __VLS_template(): {
|
|
8
9
|
attrs: Partial<{}>;
|
|
@@ -19,7 +20,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
19
20
|
"onUpdate:modelValue"?: ((payload: import('reka-ui').AcceptableValue | import('reka-ui').AcceptableValue[]) => any) | undefined;
|
|
20
21
|
}>, {
|
|
21
22
|
size: "default" | "sm" | "lg" | null;
|
|
22
|
-
variant: "default" | "outline" | "
|
|
23
|
+
variant: "default" | "outline" | "ghost" | null;
|
|
24
|
+
soft: boolean | null;
|
|
23
25
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
24
26
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
25
27
|
export default _default;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { ToggleGroupItemProps } from 'reka-ui';
|
|
2
2
|
import { ToggleGroupVariants } from '.';
|
|
3
|
+
/**
|
|
4
|
+
* `soft` has to stay `undefined` when it is not set, otherwise Vue casts the
|
|
5
|
+
* absent boolean prop to `false` and the item overrides the group instead of
|
|
6
|
+
* inheriting from it.
|
|
7
|
+
*/
|
|
3
8
|
type __VLS_Props = ToggleGroupItemProps & {
|
|
4
9
|
variant?: ToggleGroupVariants['variant'];
|
|
5
10
|
size?: ToggleGroupVariants['size'];
|
|
11
|
+
soft?: ToggleGroupVariants['soft'];
|
|
6
12
|
};
|
|
7
13
|
declare function __VLS_template(): {
|
|
8
14
|
attrs: Partial<{}>;
|
|
@@ -13,7 +19,11 @@ declare function __VLS_template(): {
|
|
|
13
19
|
rootEl: any;
|
|
14
20
|
};
|
|
15
21
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
22
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
23
|
+
size: "default" | "sm" | "lg" | null;
|
|
24
|
+
variant: "default" | "outline" | "ghost" | null;
|
|
25
|
+
soft: boolean | null;
|
|
26
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
27
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
18
28
|
export default _default;
|
|
19
29
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -3,5 +3,6 @@ import { ToggleGroupVariants } from '.';
|
|
|
3
3
|
export interface ToggleGroupContext {
|
|
4
4
|
variant: Ref<ToggleGroupVariants['variant']>;
|
|
5
5
|
size: Ref<ToggleGroupVariants['size']>;
|
|
6
|
+
soft: Ref<ToggleGroupVariants['soft']>;
|
|
6
7
|
}
|
|
7
8
|
export declare const toggleGroupContextKey: InjectionKey<ToggleGroupContext>;
|
|
@@ -2,8 +2,16 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
export { default as ToggleGroup } from './ToggleGroup.vue';
|
|
3
3
|
export { default as ToggleGroupItem } from './ToggleGroupItem.vue';
|
|
4
4
|
export { toggleGroupContextKey, type ToggleGroupContext } from './context';
|
|
5
|
+
/**
|
|
6
|
+
* A grouped item is a `Toggle` in group format: the same base, variants and
|
|
7
|
+
* sizes, with only the corner radius changed. Items sit flush against each
|
|
8
|
+
* other, so just the outer edges of the group are rounded — and because the
|
|
9
|
+
* radius lives on the item, the pressed fill, the hover overlay and the focus
|
|
10
|
+
* ring are all clipped to the same shape.
|
|
11
|
+
*/
|
|
5
12
|
export declare const toggleGroupVariants: (props?: ({
|
|
6
|
-
variant?: "default" | "outline" | "
|
|
7
|
-
size?: "default" | "sm" | "lg" | null | undefined;
|
|
13
|
+
readonly variant?: "default" | "outline" | "ghost" | null | undefined;
|
|
14
|
+
readonly size?: "default" | "sm" | "lg" | null | undefined;
|
|
15
|
+
readonly soft?: boolean | null | undefined;
|
|
8
16
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
17
|
export type ToggleGroupVariants = VariantProps<typeof toggleGroupVariants>;
|