@aleph-alpha/ui-library 2.3.0 → 2.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/dist/system/components/UiAlert/UiAlert.vue.d.ts +1 -0
- package/dist/system/components/UiAlert/constants.d.ts +16 -2
- package/dist/system/components/UiResizable/UiResizableHandle.vue.d.ts +22 -0
- package/dist/system/components/UiResizable/UiResizablePanel.vue.d.ts +31 -0
- package/dist/system/components/UiResizable/UiResizablePanelGroup.vue.d.ts +23 -0
- package/dist/system/components/UiResizable/index.d.ts +4 -0
- package/dist/system/components/UiResizable/types.d.ts +37 -0
- package/dist/system/components/core/resizable/ResizableHandle.vue.d.ts +27 -0
- package/dist/system/components/core/resizable/ResizablePanel.vue.d.ts +32 -0
- package/dist/system/components/core/resizable/ResizablePanelGroup.vue.d.ts +28 -0
- package/dist/system/components/core/resizable/index.d.ts +3 -0
- package/dist/system/components/core/sidebar/Sidebar.vue.d.ts +7 -0
- package/dist/system/components/core/sidebar/SidebarResizeHandle.vue.d.ts +16 -0
- package/dist/system/components/core/sidebar/index.d.ts +16 -0
- package/dist/system/components/core/sidebar/utils.d.ts +4 -0
- package/dist/system/components/index.d.ts +1 -0
- package/dist/system/lib.js +21860 -20130
- package/dist/system/patterns/UiSidebar/UiSidebar.vue.d.ts +1 -0
- package/dist/system/patterns/UiSidebar/__tests__/sidebar-test-helpers.d.ts +6 -0
- package/package.json +2 -2
- package/src/components/UiAlert/UiAlert.stories.ts +3 -15
- package/src/components/UiAlert/UiAlert.vue +16 -10
- package/src/components/UiAlert/constants.ts +21 -2
- package/src/components/UiResizable/UiResizable.stories.ts +424 -0
- package/src/components/UiResizable/UiResizableHandle.vue +17 -0
- package/src/components/UiResizable/UiResizablePanel.vue +30 -0
- package/src/components/UiResizable/UiResizablePanelGroup.vue +27 -0
- package/src/components/UiResizable/__tests__/UiResizableHandle.test.ts +64 -0
- package/src/components/UiResizable/__tests__/UiResizablePanel.test.ts +82 -0
- package/src/components/UiResizable/__tests__/UiResizablePanelGroup.test.ts +79 -0
- package/src/components/UiResizable/index.ts +4 -0
- package/src/components/UiResizable/types.ts +50 -0
- package/src/components/core/resizable/ResizableHandle.vue +45 -0
- package/src/components/core/resizable/ResizablePanel.vue +21 -0
- package/src/components/core/resizable/ResizablePanelGroup.vue +31 -0
- package/src/components/core/resizable/index.ts +3 -0
- package/src/components/core/sidebar/Sidebar.vue +208 -2
- package/src/components/core/sidebar/SidebarRail.vue +1 -2
- package/src/components/core/sidebar/SidebarResizeHandle.vue +46 -0
- package/src/components/core/sidebar/index.ts +17 -0
- package/src/components/core/sidebar/utils.ts +4 -0
- package/src/components/index.ts +1 -0
- package/src/patterns/UiSidebar/UiSidebar.stories.ts +42 -1
- package/src/patterns/UiSidebar/UiSidebar.vue +20 -0
- package/src/patterns/UiSidebar/__tests__/UiSidebar.test.ts +204 -2
- package/src/patterns/UiSidebar/__tests__/UiSidebarRail.test.ts +14 -0
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Supported visual variants for `UiAlert`.
|
|
3
|
+
*
|
|
4
|
+
* Keep this list aligned with `UiAlertVariants` so Storybook controls and
|
|
5
|
+
* variant iteration stay type-safe when variants are added or removed.
|
|
6
|
+
*/
|
|
7
|
+
export declare const AlertVariants: readonly ["default", "destructive"];
|
|
8
|
+
/**
|
|
9
|
+
* Default icon names for each alert variant.
|
|
10
|
+
*
|
|
11
|
+
* Consumers can override the rendered icon through the `icon` slot.
|
|
12
|
+
*/
|
|
13
|
+
export declare const AlertVariantIconNames: {
|
|
14
|
+
readonly default: "circle-check";
|
|
15
|
+
readonly destructive: "circle-alert";
|
|
16
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UiResizableHandleProps } from './types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {};
|
|
8
|
+
rootEl: any;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<UiResizableHandleProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
+
dragging: (isDragging: boolean) => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<UiResizableHandleProps> & Readonly<{
|
|
14
|
+
onDragging?: ((isDragging: boolean) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {
|
|
5
|
+
isCollapsed: boolean;
|
|
6
|
+
isExpanded: boolean;
|
|
7
|
+
collapse: () => void;
|
|
8
|
+
expand: () => void;
|
|
9
|
+
resize: (size: number) => void;
|
|
10
|
+
}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {};
|
|
13
|
+
rootEl: any;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
+
declare const __VLS_component: import('vue').DefineComponent<import('reka-ui').SplitterPanelProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
|
+
collapse: () => any;
|
|
18
|
+
expand: () => any;
|
|
19
|
+
resize: (size: number, prevSize: number | undefined) => any;
|
|
20
|
+
}, string, import('vue').PublicProps, Readonly<import('reka-ui').SplitterPanelProps> & Readonly<{
|
|
21
|
+
onCollapse?: (() => any) | undefined;
|
|
22
|
+
onExpand?: (() => any) | undefined;
|
|
23
|
+
onResize?: ((size: number, prevSize: number | undefined) => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {
|
|
5
|
+
layout: number[];
|
|
6
|
+
}): any;
|
|
7
|
+
};
|
|
8
|
+
refs: {};
|
|
9
|
+
rootEl: any;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: import('vue').DefineComponent<import('reka-ui').SplitterGroupProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
layout: (val: number[]) => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<import('reka-ui').SplitterGroupProps> & Readonly<{
|
|
15
|
+
onLayout?: ((val: number[]) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, 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,37 @@
|
|
|
1
|
+
import { SplitterGroupEmits, SplitterGroupProps, SplitterPanelEmits, SplitterPanelProps, SplitterResizeHandleEmits, SplitterResizeHandleProps } from 'reka-ui';
|
|
2
|
+
/**
|
|
3
|
+
* A resizable panel layout for splitting available space into user-adjustable regions.
|
|
4
|
+
* Use for sidebars, inspectors, editors, and other dense layouts where users need
|
|
5
|
+
* control over panel sizes.
|
|
6
|
+
* @category Layout
|
|
7
|
+
* @useCases split pane, resizable sidebar, editor layout, inspector panel
|
|
8
|
+
* @keywords resizable, splitter, panel, pane, layout, sidebar
|
|
9
|
+
* @related UiSheet, UiSeparator
|
|
10
|
+
*/
|
|
11
|
+
export type UiResizablePanelGroupProps = SplitterGroupProps;
|
|
12
|
+
/**
|
|
13
|
+
* Emits for the UiResizablePanelGroup component.
|
|
14
|
+
*/
|
|
15
|
+
export type UiResizablePanelGroupEmits = SplitterGroupEmits;
|
|
16
|
+
/**
|
|
17
|
+
* Props for an individual resizable panel.
|
|
18
|
+
*/
|
|
19
|
+
export type UiResizablePanelProps = SplitterPanelProps;
|
|
20
|
+
/**
|
|
21
|
+
* Emits for the UiResizablePanel component.
|
|
22
|
+
*/
|
|
23
|
+
export type UiResizablePanelEmits = SplitterPanelEmits;
|
|
24
|
+
/**
|
|
25
|
+
* Props for the drag handle between two resizable panels.
|
|
26
|
+
*/
|
|
27
|
+
export type UiResizableHandleProps = SplitterResizeHandleProps & {
|
|
28
|
+
/**
|
|
29
|
+
* Show the small grip affordance inside the resize handle.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
withHandle?: boolean;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Emits for the UiResizableHandle component.
|
|
36
|
+
*/
|
|
37
|
+
export type UiResizableHandleEmits = SplitterResizeHandleEmits;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SplitterResizeHandleProps } from 'reka-ui';
|
|
2
|
+
import { HTMLAttributes } from 'vue';
|
|
3
|
+
type __VLS_Props = SplitterResizeHandleProps & {
|
|
4
|
+
class?: HTMLAttributes['class'];
|
|
5
|
+
withHandle?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
default?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {};
|
|
13
|
+
rootEl: any;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
|
+
dragging: (isDragging: boolean) => any;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
|
+
onDragging?: ((isDragging: boolean) => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SplitterPanelProps } from 'reka-ui';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {
|
|
6
|
+
isCollapsed: boolean;
|
|
7
|
+
isExpanded: boolean;
|
|
8
|
+
collapse: () => void;
|
|
9
|
+
expand: () => void;
|
|
10
|
+
resize: (size: number) => void;
|
|
11
|
+
}): any;
|
|
12
|
+
};
|
|
13
|
+
refs: {};
|
|
14
|
+
rootEl: any;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
|
+
declare const __VLS_component: import('vue').DefineComponent<SplitterPanelProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
|
+
collapse: () => any;
|
|
19
|
+
expand: () => any;
|
|
20
|
+
resize: (size: number, prevSize: number | undefined) => any;
|
|
21
|
+
}, string, import('vue').PublicProps, Readonly<SplitterPanelProps> & Readonly<{
|
|
22
|
+
onCollapse?: (() => any) | undefined;
|
|
23
|
+
onExpand?: (() => any) | undefined;
|
|
24
|
+
onResize?: ((size: number, prevSize: number | undefined) => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SplitterGroupProps } from 'reka-ui';
|
|
2
|
+
import { HTMLAttributes } from 'vue';
|
|
3
|
+
type __VLS_Props = SplitterGroupProps & {
|
|
4
|
+
class?: HTMLAttributes['class'];
|
|
5
|
+
};
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
default?(_: {
|
|
10
|
+
layout: number[];
|
|
11
|
+
}): any;
|
|
12
|
+
};
|
|
13
|
+
refs: {};
|
|
14
|
+
rootEl: any;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
|
+
layout: (val: number[]) => any;
|
|
19
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
|
+
onLayout?: ((val: number[]) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -13,7 +13,14 @@ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
|
13
13
|
declare const __VLS_component: import('vue').DefineComponent<SidebarProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SidebarProps> & Readonly<{}>, {
|
|
14
14
|
collapsible: "offcanvas" | "icon" | "none";
|
|
15
15
|
variant: "sidebar" | "floating" | "inset";
|
|
16
|
+
maxWidth: number;
|
|
16
17
|
side: "left" | "right";
|
|
18
|
+
keyboardResizeBy: number;
|
|
19
|
+
minWidth: number;
|
|
20
|
+
resizable: boolean;
|
|
21
|
+
defaultWidth: number;
|
|
22
|
+
widthStorageKey: string;
|
|
23
|
+
resizeAriaLabel: string;
|
|
17
24
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
25
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
19
26
|
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
accessibleLabel: string;
|
|
3
|
+
isResizing: boolean;
|
|
4
|
+
side: 'left' | 'right';
|
|
5
|
+
valueMin: number;
|
|
6
|
+
valueMax: number;
|
|
7
|
+
valueNow: number;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
keydown: (event: KeyboardEvent) => any;
|
|
11
|
+
pointerdown: (event: PointerEvent) => any;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onKeydown?: ((event: KeyboardEvent) => any) | undefined;
|
|
14
|
+
onPointerdown?: ((event: PointerEvent) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
|
|
16
|
+
export default _default;
|
|
@@ -3,6 +3,22 @@ export interface SidebarProps {
|
|
|
3
3
|
side?: 'left' | 'right';
|
|
4
4
|
variant?: 'sidebar' | 'floating' | 'inset';
|
|
5
5
|
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
6
|
+
resizeOptions?: SidebarResizeOptions;
|
|
7
|
+
resizable?: boolean;
|
|
8
|
+
defaultWidth?: number;
|
|
9
|
+
minWidth?: number;
|
|
10
|
+
maxWidth?: number;
|
|
11
|
+
widthStorageKey?: string;
|
|
12
|
+
resizeAriaLabel?: string;
|
|
13
|
+
keyboardResizeBy?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface SidebarResizeOptions {
|
|
16
|
+
defaultWidth?: number;
|
|
17
|
+
minWidth?: number;
|
|
18
|
+
maxWidth?: number;
|
|
19
|
+
widthStorageKey?: string;
|
|
20
|
+
resizeAriaLabel?: string;
|
|
21
|
+
keyboardResizeBy?: number;
|
|
6
22
|
}
|
|
7
23
|
export { default as Sidebar } from './Sidebar.vue';
|
|
8
24
|
export { default as SidebarContent } from './SidebarContent.vue';
|
|
@@ -2,9 +2,13 @@ import { ComputedRef, Ref } from 'vue';
|
|
|
2
2
|
export declare const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
3
3
|
export declare const SIDEBAR_COOKIE_MAX_AGE: number;
|
|
4
4
|
export declare const SIDEBAR_WIDTH = "16rem";
|
|
5
|
+
export declare const SIDEBAR_WIDTH_DEFAULT = 256;
|
|
6
|
+
export declare const SIDEBAR_WIDTH_MIN = 240;
|
|
7
|
+
export declare const SIDEBAR_WIDTH_MAX = 480;
|
|
5
8
|
export declare const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
6
9
|
export declare const SIDEBAR_WIDTH_ICON = "3rem";
|
|
7
10
|
export declare const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
11
|
+
export declare const SIDEBAR_WIDTH_STORAGE_KEY = "sidebar_width";
|
|
8
12
|
export type SidebarContextValue = {
|
|
9
13
|
state: ComputedRef<'expanded' | 'collapsed'>;
|
|
10
14
|
open: Ref<boolean>;
|
|
@@ -31,6 +31,7 @@ export * from './UiPopover';
|
|
|
31
31
|
export * from './UiProgress';
|
|
32
32
|
export * from './UiRadioGroup';
|
|
33
33
|
export * from './UiRangeCalendar';
|
|
34
|
+
export * from './UiResizable';
|
|
34
35
|
export * from './UiSelect';
|
|
35
36
|
export * from './UiSeparator';
|
|
36
37
|
export * from './UiSheet';
|