@webx-ui/core 0.4.0 → 0.6.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.
@@ -0,0 +1,105 @@
1
+ import { DialogLayout, DialogProps } from './types';
2
+ type __VLS_Props = DialogProps;
3
+ declare function close(): void;
4
+ /** Back to the declared size, in the middle of the screen, and forgotten. */
5
+ declare function reset(): void;
6
+ type __VLS_PublicProps = {
7
+ 'open'?: boolean;
8
+ } & __VLS_Props;
9
+ declare function __VLS_template(): {
10
+ attrs: Partial<{}>;
11
+ slots: Readonly<{
12
+ /** The control that opens the panel. Exactly one element. */
13
+ trigger?: (props: {
14
+ open: boolean;
15
+ }) => unknown;
16
+ /** The body. */
17
+ default?: (props: {
18
+ close: () => void;
19
+ }) => unknown;
20
+ /** Replaces `title`. */
21
+ title?: () => unknown;
22
+ /** Next to the heading — badges, or actions that belong to the whole panel. */
23
+ extra?: (props: {
24
+ close: () => void;
25
+ }) => unknown;
26
+ /** A column beside the body. Its presence is what splits the body in two. */
27
+ sidebar?: (props: {
28
+ close: () => void;
29
+ }) => unknown;
30
+ /** A row under the body — where the Save and Cancel go. */
31
+ footer?: (props: {
32
+ close: () => void;
33
+ }) => unknown;
34
+ }> & {
35
+ /** The control that opens the panel. Exactly one element. */
36
+ trigger?: (props: {
37
+ open: boolean;
38
+ }) => unknown;
39
+ /** The body. */
40
+ default?: (props: {
41
+ close: () => void;
42
+ }) => unknown;
43
+ /** Replaces `title`. */
44
+ title?: () => unknown;
45
+ /** Next to the heading — badges, or actions that belong to the whole panel. */
46
+ extra?: (props: {
47
+ close: () => void;
48
+ }) => unknown;
49
+ /** A column beside the body. Its presence is what splits the body in two. */
50
+ sidebar?: (props: {
51
+ close: () => void;
52
+ }) => unknown;
53
+ /** A row under the body — where the Save and Cancel go. */
54
+ footer?: (props: {
55
+ close: () => void;
56
+ }) => unknown;
57
+ };
58
+ refs: {
59
+ panel: HTMLDivElement;
60
+ };
61
+ rootEl: any;
62
+ };
63
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
64
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {
65
+ close: typeof close;
66
+ reset: typeof reset;
67
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
68
+ close: () => any;
69
+ open: () => any;
70
+ "update:open": (value: boolean) => any;
71
+ layout: (layout: DialogLayout) => any;
72
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
73
+ onClose?: (() => any) | undefined;
74
+ onOpen?: (() => any) | undefined;
75
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
76
+ onLayout?: ((layout: DialogLayout) => any) | undefined;
77
+ }>, {
78
+ title: string;
79
+ modal: boolean;
80
+ ariaLabel: string;
81
+ closable: boolean;
82
+ closeLabel: string;
83
+ scroll: import('./types').DialogScroll;
84
+ width: number | string;
85
+ height: number | string;
86
+ stickyFooter: boolean;
87
+ minWidth: number;
88
+ minHeight: number;
89
+ sidebarWidth: number | string;
90
+ closeOnOverlay: boolean;
91
+ closeOnEscape: boolean;
92
+ overlay: boolean;
93
+ draggable: boolean;
94
+ resizable: boolean;
95
+ persist: string;
96
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
97
+ panel: HTMLDivElement;
98
+ }, any>;
99
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
100
+ export default _default;
101
+ type __VLS_WithTemplateSlots<T, S> = T & {
102
+ new (): {
103
+ $slots: S;
104
+ };
105
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxDialog } from './Dialog';
2
+ export type * from './types';
@@ -0,0 +1,60 @@
1
+ /**
2
+ * What scrolls when the content is longer than the screen: the body inside a panel that
3
+ * stops at the edge of the screen, or the whole panel inside the screen itself.
4
+ */
5
+ export type DialogScroll = 'body' | 'panel';
6
+ /** Where the panel was left: pixels, and the offset from the middle of the screen. */
7
+ export interface DialogLayout {
8
+ width?: number;
9
+ height?: number;
10
+ x?: number;
11
+ y?: number;
12
+ }
13
+ export interface DialogProps {
14
+ /** Heading of the panel. The `title` slot replaces it. */
15
+ title?: string;
16
+ /** Width of the panel: a number in pixels, or any CSS length — `520`, `'60%'`. */
17
+ width?: number | string;
18
+ /** Height of the panel. Without it the panel grows with its content, up to the screen. */
19
+ height?: number | string;
20
+ /**
21
+ * Where a long panel scrolls. `body` keeps the panel within the screen and scrolls what
22
+ * is between the heading and the footer. `panel` lets the panel grow past the screen and
23
+ * scrolls the whole of it — the heading goes with it, and dragging and resizing are off.
24
+ */
25
+ scroll?: DialogScroll;
26
+ /** In `scroll="panel"`, keep the footer against the bottom of the screen. */
27
+ stickyFooter?: boolean;
28
+ /** Smallest width a resize may reach, in pixels. */
29
+ minWidth?: number;
30
+ /** Smallest height a resize may reach, in pixels. */
31
+ minHeight?: number;
32
+ /** Width of the `sidebar` column: a number in pixels, or any CSS length. */
33
+ sidebarWidth?: number | string;
34
+ /** Adds a × to the heading. */
35
+ closable?: boolean;
36
+ /** Label of that ×, for screen readers. */
37
+ closeLabel?: string;
38
+ /** A click outside the panel closes it. */
39
+ closeOnOverlay?: boolean;
40
+ /** Escape closes it. */
41
+ closeOnEscape?: boolean;
42
+ /** Dim the page behind the panel. */
43
+ overlay?: boolean;
44
+ /** Block the page behind the panel, trap focus inside it and lock the page's scroll. */
45
+ modal?: boolean;
46
+ /** The panel can be dragged by its heading. */
47
+ draggable?: boolean;
48
+ /** The panel can be resized by the grip in its bottom-right corner. */
49
+ resizable?: boolean;
50
+ /** Remember size and position under this key, in `localStorage`. */
51
+ persist?: string;
52
+ /** Accessible name for the panel when it has no visible heading. */
53
+ ariaLabel?: string;
54
+ }
55
+ export interface DialogEmits {
56
+ open: [];
57
+ close: [];
58
+ /** The panel was dragged or resized. Carries what `persist` would store. */
59
+ layout: [layout: DialogLayout];
60
+ }
@@ -0,0 +1,98 @@
1
+ import { DrawerLayout, DrawerProps } from './types';
2
+ type __VLS_Props = DrawerProps;
3
+ declare function close(): void;
4
+ /** Back to the declared size, and forgotten. */
5
+ declare function reset(): void;
6
+ type __VLS_PublicProps = {
7
+ 'open'?: boolean;
8
+ } & __VLS_Props;
9
+ declare function __VLS_template(): {
10
+ attrs: Partial<{}>;
11
+ slots: Readonly<{
12
+ /** The control that opens the panel. Exactly one element. */
13
+ trigger?: (props: {
14
+ open: boolean;
15
+ }) => unknown;
16
+ /** The body. The one part of the panel that scrolls. */
17
+ default?: (props: {
18
+ close: () => void;
19
+ }) => unknown;
20
+ /** Replaces `title`. */
21
+ title?: () => unknown;
22
+ /** Next to the heading — badges, or actions that belong to the whole panel. */
23
+ extra?: (props: {
24
+ close: () => void;
25
+ }) => unknown;
26
+ /** A column beside the body. Its presence is what splits the body in two. */
27
+ sidebar?: (props: {
28
+ close: () => void;
29
+ }) => unknown;
30
+ /** A row under the body — where the Save and Cancel go. */
31
+ footer?: (props: {
32
+ close: () => void;
33
+ }) => unknown;
34
+ }> & {
35
+ /** The control that opens the panel. Exactly one element. */
36
+ trigger?: (props: {
37
+ open: boolean;
38
+ }) => unknown;
39
+ /** The body. The one part of the panel that scrolls. */
40
+ default?: (props: {
41
+ close: () => void;
42
+ }) => unknown;
43
+ /** Replaces `title`. */
44
+ title?: () => unknown;
45
+ /** Next to the heading — badges, or actions that belong to the whole panel. */
46
+ extra?: (props: {
47
+ close: () => void;
48
+ }) => unknown;
49
+ /** A column beside the body. Its presence is what splits the body in two. */
50
+ sidebar?: (props: {
51
+ close: () => void;
52
+ }) => unknown;
53
+ /** A row under the body — where the Save and Cancel go. */
54
+ footer?: (props: {
55
+ close: () => void;
56
+ }) => unknown;
57
+ };
58
+ refs: {};
59
+ rootEl: any;
60
+ };
61
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
62
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {
63
+ close: typeof close;
64
+ reset: typeof reset;
65
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
66
+ close: () => any;
67
+ open: () => any;
68
+ "update:open": (value: boolean) => any;
69
+ layout: (layout: DrawerLayout) => any;
70
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
71
+ onClose?: (() => any) | undefined;
72
+ onOpen?: (() => any) | undefined;
73
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
74
+ onLayout?: ((layout: DrawerLayout) => any) | undefined;
75
+ }>, {
76
+ size: number | string;
77
+ title: string;
78
+ side: import('./types').DrawerSide;
79
+ modal: boolean;
80
+ ariaLabel: string;
81
+ closable: boolean;
82
+ closeLabel: string;
83
+ sidebarWidth: number | string;
84
+ closeOnOverlay: boolean;
85
+ closeOnEscape: boolean;
86
+ overlay: boolean;
87
+ resizable: boolean;
88
+ persist: string;
89
+ minSize: number;
90
+ resizeLabel: string;
91
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
92
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
93
+ export default _default;
94
+ type __VLS_WithTemplateSlots<T, S> = T & {
95
+ new (): {
96
+ $slots: S;
97
+ };
98
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxDrawer } from './Drawer';
2
+ export type * from './types';
@@ -0,0 +1,46 @@
1
+ export type DrawerSide = 'right' | 'left' | 'top' | 'bottom';
2
+ /** Where the panel was left: its size along the axis it slides on, in pixels. */
3
+ export interface DrawerLayout {
4
+ size?: number;
5
+ }
6
+ export interface DrawerProps {
7
+ /** Heading of the panel. The `title` slot replaces it. */
8
+ title?: string;
9
+ /** Edge the panel slides in from. */
10
+ side?: DrawerSide;
11
+ /**
12
+ * How far the panel reaches into the screen: its width on the left and right, its
13
+ * height at the top and bottom. A number in pixels, or any CSS length — `380`, `'40%'`.
14
+ */
15
+ size?: number | string;
16
+ /** Smallest size a resize may reach, in pixels. */
17
+ minSize?: number;
18
+ /** Width of the `sidebar` column: a number in pixels, or any CSS length. */
19
+ sidebarWidth?: number | string;
20
+ /** Adds a × to the heading. */
21
+ closable?: boolean;
22
+ /** Label of that ×, for screen readers. */
23
+ closeLabel?: string;
24
+ /** A click outside the panel closes it. */
25
+ closeOnOverlay?: boolean;
26
+ /** Escape closes it. */
27
+ closeOnEscape?: boolean;
28
+ /** Dim the page behind the panel. */
29
+ overlay?: boolean;
30
+ /** Block the page behind the panel, trap focus inside it and lock the page's scroll. */
31
+ modal?: boolean;
32
+ /** The panel can be resized by the edge it faces the page with. */
33
+ resizable?: boolean;
34
+ /** Remember the size under this key, in `localStorage`. */
35
+ persist?: string;
36
+ /** Accessible name for the panel when it has no visible heading. */
37
+ ariaLabel?: string;
38
+ /** Label of the resize handle, for screen readers. */
39
+ resizeLabel?: string;
40
+ }
41
+ export interface DrawerEmits {
42
+ open: [];
43
+ close: [];
44
+ /** The panel was resized. Carries what `persist` would store. */
45
+ layout: [layout: DrawerLayout];
46
+ }
@@ -32,9 +32,9 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
32
32
  readonly: boolean;
33
33
  step: number;
34
34
  precision: number;
35
+ wheel: boolean;
35
36
  controls: boolean;
36
37
  controlsPosition: "sides" | "right";
37
- wheel: boolean;
38
38
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
39
39
  inputRef: HTMLInputElement;
40
40
  }, any>;
@@ -0,0 +1,82 @@
1
+ import { KanbanCard, KanbanColumn, KanbanId, KanbanProps, KanbanVia } from './types';
2
+ declare const _default: <T extends KanbanCard = KanbanCard>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly onAdd?: ((column: KanbanColumn<T>) => any) | undefined;
5
+ readonly onMove?: ((move: import('./types').KanbanMove<T>) => any) | undefined;
6
+ readonly "onUpdate:collapsed"?: ((value: KanbanId[]) => any) | undefined;
7
+ readonly "onColumn-move"?: ((move: import('./types').KanbanColumnMove<T>) => any) | undefined;
8
+ readonly "onAdd-column"?: (() => any) | undefined;
9
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onAdd" | "onMove" | "onUpdate:collapsed" | "onColumn-move" | "onAdd-column"> & ({
10
+ collapsed?: KanbanId[];
11
+ } & KanbanProps<T>) & Partial<{}>> & import('vue').PublicProps;
12
+ expose(exposed: import('vue').ShallowUnwrapRef<{
13
+ move: (from: KanbanColumn<T>, fromIndex: number, to: KanbanColumn<T>, toIndex: number, via: KanbanVia) => void;
14
+ moveColumn: (from: number, to: number, via: KanbanVia) => void;
15
+ toggle: (column: KanbanColumn<T>) => void;
16
+ }>): void;
17
+ attrs: any;
18
+ slots: Readonly<{
19
+ /** One card. Without it the board falls back to the card's own title. */
20
+ card?: (props: {
21
+ card: T;
22
+ column: KanbanColumn<T>;
23
+ index: number;
24
+ }) => unknown;
25
+ /** Replaces the title and the count above a column. */
26
+ 'column-header'?: (props: {
27
+ column: KanbanColumn<T>;
28
+ count: number;
29
+ overLimit: boolean;
30
+ }) => unknown;
31
+ /** The end of a column's heading — a plus, a menu, whatever the column can do. */
32
+ 'column-actions'?: (props: {
33
+ column: KanbanColumn<T>;
34
+ collapsed: boolean;
35
+ }) => unknown;
36
+ /** Under the cards, where the add button would be. */
37
+ 'column-footer'?: (props: {
38
+ column: KanbanColumn<T>;
39
+ }) => unknown;
40
+ /** Shown in a column holding no cards. */
41
+ empty?: (props: {
42
+ column: KanbanColumn<T>;
43
+ }) => unknown;
44
+ /** After the last column, in place of the add-a-column button. */
45
+ default?: () => unknown;
46
+ }> & {
47
+ /** One card. Without it the board falls back to the card's own title. */
48
+ card?: (props: {
49
+ card: T;
50
+ column: KanbanColumn<T>;
51
+ index: number;
52
+ }) => unknown;
53
+ /** Replaces the title and the count above a column. */
54
+ 'column-header'?: (props: {
55
+ column: KanbanColumn<T>;
56
+ count: number;
57
+ overLimit: boolean;
58
+ }) => unknown;
59
+ /** The end of a column's heading — a plus, a menu, whatever the column can do. */
60
+ 'column-actions'?: (props: {
61
+ column: KanbanColumn<T>;
62
+ collapsed: boolean;
63
+ }) => unknown;
64
+ /** Under the cards, where the add button would be. */
65
+ 'column-footer'?: (props: {
66
+ column: KanbanColumn<T>;
67
+ }) => unknown;
68
+ /** Shown in a column holding no cards. */
69
+ empty?: (props: {
70
+ column: KanbanColumn<T>;
71
+ }) => unknown;
72
+ /** After the last column, in place of the add-a-column button. */
73
+ default?: () => unknown;
74
+ };
75
+ emit: (((evt: "add", column: KanbanColumn<T>) => void) & ((evt: "move", move: import('./types').KanbanMove<T>) => void) & ((evt: "column-move", move: import('./types').KanbanColumnMove<T>) => void) & ((evt: "add-column") => void)) & ((evt: "update:collapsed", value: KanbanId[]) => void);
76
+ }>) => import('vue').VNode & {
77
+ __ctx?: Awaited<typeof __VLS_setup>;
78
+ };
79
+ export default _default;
80
+ type __VLS_PrettifyLocal<T> = {
81
+ [K in keyof T]: T[K];
82
+ } & {};
@@ -0,0 +1,2 @@
1
+ export { default as WxKanban } from './Kanban';
2
+ export type * from './types';
@@ -0,0 +1,83 @@
1
+ export type KanbanId = string | number;
2
+ /** Colour of the line above a column's heading. */
3
+ export type KanbanTone = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
4
+ export type KanbanSize = 'sm' | 'md';
5
+ /** How something was moved — worth knowing when you animate or undo. */
6
+ export type KanbanVia = 'pointer' | 'keyboard';
7
+ /** The least a card has to carry: something to key it by. */
8
+ export interface KanbanCard {
9
+ id: KanbanId;
10
+ [key: string]: unknown;
11
+ }
12
+ export interface KanbanColumn<T extends KanbanCard = KanbanCard> {
13
+ id: KanbanId;
14
+ title?: string;
15
+ /** The cards, in the order they are shown. The board writes moves back into it. */
16
+ items: T[];
17
+ /**
18
+ * How many cards the column is meant to hold. At the limit the count turns red and
19
+ * nothing more can be dropped in — a work-in-progress limit, the point of a board.
20
+ */
21
+ limit?: number;
22
+ /** Colour of the rule above the heading. */
23
+ tone?: KanbanTone;
24
+ /** Cards can be neither taken from this column nor put into it. */
25
+ disabled?: boolean;
26
+ }
27
+ /** Where a card came from and where it went. */
28
+ export interface KanbanMove<T extends KanbanCard = KanbanCard> {
29
+ card: T;
30
+ from: {
31
+ column: KanbanId;
32
+ index: number;
33
+ };
34
+ to: {
35
+ column: KanbanId;
36
+ index: number;
37
+ };
38
+ via: KanbanVia;
39
+ }
40
+ /** Where a column came from and where it went. */
41
+ export interface KanbanColumnMove<T extends KanbanCard = KanbanCard> {
42
+ column: KanbanColumn<T>;
43
+ from: number;
44
+ to: number;
45
+ via: KanbanVia;
46
+ }
47
+ export interface KanbanProps<T extends KanbanCard = KanbanCard> {
48
+ /** The columns, each carrying its own cards. */
49
+ columns: KanbanColumn<T>[];
50
+ /** Boards that share a name exchange cards. Left alone, a board keeps to itself. */
51
+ group?: string;
52
+ size?: KanbanSize;
53
+ /** Width of a column: a number is pixels, a string is any CSS length. */
54
+ columnWidth?: number | string;
55
+ /** Nothing on the board can be moved. */
56
+ disabled?: boolean;
57
+ /** CSS selector for the part of a card that starts a drag. */
58
+ handle?: string;
59
+ /** Shows an add button under every column, which emits `add`. */
60
+ addable?: boolean;
61
+ addLabel?: string;
62
+ /** Lets a column be folded down to a strip. Use `v-model:collapsed` to remember it. */
63
+ collapsible?: boolean;
64
+ /** Columns can be dragged into another order, by their heading. */
65
+ reorderColumns?: boolean;
66
+ /** Shows an add button after the last column, which emits `add-column`. */
67
+ columnAddable?: boolean;
68
+ addColumnLabel?: string;
69
+ /** Shown in a column with no cards. */
70
+ emptyText?: string;
71
+ /** Accessible name for the board. */
72
+ ariaLabel?: string;
73
+ }
74
+ export interface KanbanEmits<T extends KanbanCard = KanbanCard> {
75
+ /** A card changed position or column. The arrays have already been updated. */
76
+ move: [move: KanbanMove<T>];
77
+ /** A column changed position. */
78
+ 'column-move': [move: KanbanColumnMove<T>];
79
+ /** The add button under a column was pressed. */
80
+ add: [column: KanbanColumn<T>];
81
+ /** The add button after the last column was pressed. */
82
+ 'add-column': [];
83
+ }
@@ -63,8 +63,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
63
63
  ariaLabel: string;
64
64
  closable: boolean;
65
65
  closeLabel: string;
66
- arrow: boolean;
67
66
  width: number | string;
67
+ arrow: boolean;
68
68
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
69
69
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
70
70
  export default _default;
@@ -28,9 +28,9 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
28
28
  status: import('../..').ControlStatus;
29
29
  id: string;
30
30
  readonly: boolean;
31
+ resize: "none" | "vertical" | "both";
31
32
  maxlength: number;
32
33
  showCount: boolean;
33
- resize: "none" | "vertical" | "both";
34
34
  rows: number;
35
35
  autosize: boolean | import('./types').AutosizeOptions;
36
36
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
@@ -15,6 +15,8 @@ export * from './Countdown';
15
15
  export * from './DatePicker';
16
16
  export * from './DateRangePicker';
17
17
  export * from './DateTimePicker';
18
+ export * from './Dialog';
19
+ export * from './Drawer';
18
20
  export * from './Dropdown';
19
21
  export * from './DropdownItem';
20
22
  export * from './EntityCard';
@@ -25,6 +27,7 @@ export * from './Icon';
25
27
  export * from './Indicator';
26
28
  export * from './Input';
27
29
  export * from './InputNumber';
30
+ export * from './Kanban';
28
31
  export * from './Link';
29
32
  export * from './Pagination';
30
33
  export * from './Popover';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The pieces `WxDialog` and `WxDrawer` have in common: both take a size in pixels or
3
+ * per cent, both can be dragged to a new one, and both can be told to remember it.
4
+ */
5
+ /** A number is pixels, however it arrives — `width="520"` in a template is a string. */
6
+ export declare function cssLength(value: number | string | undefined): string | undefined;
7
+ /**
8
+ * The pixels behind a size prop, when there are any — `'60%'` has none, and a gesture
9
+ * that starts on such a panel has to measure it instead.
10
+ */
11
+ export declare function pixelLength(value: number | string | undefined): number | undefined;
12
+ export declare function clamp(value: number, min: number, max: number): number;
13
+ export interface PanelMemory<T> {
14
+ read: () => Partial<T> | null;
15
+ write: (value: T) => void;
16
+ clear: () => void;
17
+ }
18
+ /**
19
+ * `localStorage`, with every way it can fail treated the same way: remembering a panel's
20
+ * size is a convenience, and a private window or a full quota only costs the default.
21
+ */
22
+ export declare function usePanelMemory<T>(prefix: string, key: () => string | undefined): PanelMemory<T>;