@gamecrafters/base-ui 0.0.23 → 0.0.25
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/build/components/avatar/Avatar.d.ts +1 -1
- package/build/components/avatar/Avatar.types.d.ts +1 -1
- package/build/components/avatar/index.d.ts +1 -1
- package/build/components/avatar-stack/AvatarStack.d.ts +4 -3
- package/build/components/avatar-stack/AvatarStack.types.d.ts +8 -4
- package/build/components/combobox/Combobox.d.ts +36 -0
- package/build/components/combobox/Combobox.types.d.ts +146 -0
- package/build/components/combobox/ComboboxClearTrigger.d.ts +6 -0
- package/build/components/combobox/ComboboxContent.d.ts +5 -0
- package/build/components/combobox/ComboboxContext.d.ts +4 -0
- package/build/components/combobox/ComboboxControl.d.ts +5 -0
- package/build/components/combobox/ComboboxEmpty.d.ts +5 -0
- package/build/components/combobox/ComboboxInput.d.ts +5 -0
- package/build/components/combobox/ComboboxItem.d.ts +9 -0
- package/build/components/combobox/ComboboxItemGroup.d.ts +6 -0
- package/build/components/combobox/ComboboxItemGroupLabel.d.ts +5 -0
- package/build/components/combobox/ComboboxItemIndicator.d.ts +5 -0
- package/build/components/combobox/ComboboxItemText.d.ts +5 -0
- package/build/components/combobox/ComboboxLabel.d.ts +5 -0
- package/build/components/combobox/ComboboxList.d.ts +5 -0
- package/build/components/combobox/ComboboxPositioner.d.ts +8 -0
- package/build/components/combobox/ComboboxTrigger.d.ts +6 -0
- package/build/components/combobox/index.d.ts +104 -0
- package/build/components/index.d.ts +3 -0
- package/build/components/swap/Swap.d.ts +10 -0
- package/build/components/swap/Swap.types.d.ts +19 -0
- package/build/components/swap/SwapContext.d.ts +2 -0
- package/build/components/swap/SwapIndicator.d.ts +8 -0
- package/build/components/swap/index.d.ts +18 -0
- package/build/components/tour/Tour.d.ts +9 -0
- package/build/components/tour/Tour.types.d.ts +143 -0
- package/build/components/tour/TourActionTrigger.d.ts +8 -0
- package/build/components/tour/TourActions.d.ts +7 -0
- package/build/components/tour/TourArrow.d.ts +4 -0
- package/build/components/tour/TourBackdrop.d.ts +6 -0
- package/build/components/tour/TourCloseTrigger.d.ts +6 -0
- package/build/components/tour/TourContent.d.ts +5 -0
- package/build/components/tour/TourContext.d.ts +3 -0
- package/build/components/tour/TourControl.d.ts +5 -0
- package/build/components/tour/TourDescription.d.ts +5 -0
- package/build/components/tour/TourPositioner.d.ts +9 -0
- package/build/components/tour/TourProgressText.d.ts +5 -0
- package/build/components/tour/TourSpotlight.d.ts +6 -0
- package/build/components/tour/TourTitle.d.ts +5 -0
- package/build/components/tour/index.d.ts +64 -0
- package/build/components/tour/useTour.d.ts +2 -0
- package/build/components/tour/waitFor.d.ts +10 -0
- package/build/main.cjs.js +70 -70
- package/build/main.esm.js +68 -68
- package/build/styles/main.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import type { ButtonVariant, ButtonVisual } from "../button";
|
|
3
|
+
import type { CaretProps } from "../caret";
|
|
4
|
+
import type { AnchorAlignment, AnchorSide } from "../tooltip/anchoredPosition";
|
|
5
|
+
export type TourStepType = "dialog" | "tooltip" | "floating";
|
|
6
|
+
export type TourFloatingPlacement = "top-start" | "top-end" | "bottom-start" | "bottom-end";
|
|
7
|
+
export type TourActionKind = "next" | "prev" | "dismiss";
|
|
8
|
+
export type TourAction = {
|
|
9
|
+
label: string;
|
|
10
|
+
action: TourActionKind | ((tour: TourApi) => void);
|
|
11
|
+
};
|
|
12
|
+
export type TourStepUpdate = {
|
|
13
|
+
title?: React.ReactNode;
|
|
14
|
+
description?: React.ReactNode;
|
|
15
|
+
actions?: TourAction[];
|
|
16
|
+
};
|
|
17
|
+
export type TourStepEffectArgs = {
|
|
18
|
+
next: () => void;
|
|
19
|
+
prev: () => void;
|
|
20
|
+
goto: (stepId: string) => void;
|
|
21
|
+
dismiss: () => void;
|
|
22
|
+
show: () => void;
|
|
23
|
+
update: (details: TourStepUpdate) => void;
|
|
24
|
+
target: () => HTMLElement | null;
|
|
25
|
+
};
|
|
26
|
+
export type TourStepEffectCleanup = (() => void) | void;
|
|
27
|
+
export type TourStep = {
|
|
28
|
+
id: string;
|
|
29
|
+
type?: TourStepType;
|
|
30
|
+
title?: React.ReactNode;
|
|
31
|
+
description?: React.ReactNode;
|
|
32
|
+
target?: () => HTMLElement | null;
|
|
33
|
+
side?: AnchorSide;
|
|
34
|
+
align?: AnchorAlignment;
|
|
35
|
+
placement?: TourFloatingPlacement;
|
|
36
|
+
actions?: TourAction[];
|
|
37
|
+
backdrop?: boolean;
|
|
38
|
+
arrow?: boolean;
|
|
39
|
+
effect?: (args: TourStepEffectArgs) => TourStepEffectCleanup;
|
|
40
|
+
};
|
|
41
|
+
export type TourStatus = "started" | "completed" | "dismissed";
|
|
42
|
+
export type TourStatusChangeDetails = {
|
|
43
|
+
status: TourStatus;
|
|
44
|
+
};
|
|
45
|
+
export type TourStepChangeDetails = {
|
|
46
|
+
stepId: string | null;
|
|
47
|
+
stepIndex: number;
|
|
48
|
+
count: number;
|
|
49
|
+
};
|
|
50
|
+
export type TourRect = {
|
|
51
|
+
top: number;
|
|
52
|
+
left: number;
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
};
|
|
56
|
+
export type TourApi = {
|
|
57
|
+
open: boolean;
|
|
58
|
+
step: TourStep | null;
|
|
59
|
+
stepIndex: number;
|
|
60
|
+
steps: TourStep[];
|
|
61
|
+
start: (stepId?: string) => void;
|
|
62
|
+
next: () => void;
|
|
63
|
+
prev: () => void;
|
|
64
|
+
goto: (stepId: string) => void;
|
|
65
|
+
dismiss: () => void;
|
|
66
|
+
progressText: string;
|
|
67
|
+
progressPercent: number;
|
|
68
|
+
hasNext: boolean;
|
|
69
|
+
hasPrev: boolean;
|
|
70
|
+
};
|
|
71
|
+
export type TourContextValue = TourApi & {
|
|
72
|
+
titleId: string;
|
|
73
|
+
descriptionId: string;
|
|
74
|
+
stepType: TourStepType;
|
|
75
|
+
ready: boolean;
|
|
76
|
+
targetRect: TourRect | null;
|
|
77
|
+
getTarget: () => HTMLElement | null;
|
|
78
|
+
spotlightOffset: number;
|
|
79
|
+
spotlightRadius: number;
|
|
80
|
+
contentRef: React.RefObject<HTMLDivElement | null>;
|
|
81
|
+
};
|
|
82
|
+
export type TourPositionerContextValue = {
|
|
83
|
+
side: AnchorSide;
|
|
84
|
+
align: AnchorAlignment;
|
|
85
|
+
};
|
|
86
|
+
export type TourProps = {
|
|
87
|
+
steps: TourStep[];
|
|
88
|
+
step?: string | null;
|
|
89
|
+
defaultStep?: string | null;
|
|
90
|
+
onStepChange?: (details: TourStepChangeDetails) => void;
|
|
91
|
+
open?: boolean;
|
|
92
|
+
defaultOpen?: boolean;
|
|
93
|
+
onOpenChange?: (open: boolean) => void;
|
|
94
|
+
onStatusChange?: (details: TourStatusChangeDetails) => void;
|
|
95
|
+
keyboardNavigation?: boolean;
|
|
96
|
+
closeOnEscape?: boolean;
|
|
97
|
+
closeOnInteractOutside?: boolean;
|
|
98
|
+
spotlightOffset?: number;
|
|
99
|
+
spotlightRadius?: number;
|
|
100
|
+
id?: string;
|
|
101
|
+
children?: React.ReactNode;
|
|
102
|
+
};
|
|
103
|
+
export type TourBackdropProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
104
|
+
portalContainerName?: string;
|
|
105
|
+
className?: string;
|
|
106
|
+
};
|
|
107
|
+
export type TourSpotlightProps = TourBackdropProps;
|
|
108
|
+
export type TourPositionerProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
109
|
+
side?: AnchorSide;
|
|
110
|
+
align?: AnchorAlignment;
|
|
111
|
+
placement?: TourFloatingPlacement;
|
|
112
|
+
portalContainerName?: string;
|
|
113
|
+
className?: string;
|
|
114
|
+
};
|
|
115
|
+
export type TourContentProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
116
|
+
className?: string;
|
|
117
|
+
};
|
|
118
|
+
export type TourArrowProps = Omit<CaretProps, "location">;
|
|
119
|
+
export type TourCloseTriggerProps = Omit<React.ComponentPropsWithoutRef<"button">, "aria-labelledby"> & {
|
|
120
|
+
icon?: NonNullable<ButtonVisual>;
|
|
121
|
+
className?: string;
|
|
122
|
+
};
|
|
123
|
+
export type TourTitleProps = React.ComponentPropsWithoutRef<"h2"> & {
|
|
124
|
+
className?: string;
|
|
125
|
+
};
|
|
126
|
+
export type TourDescriptionProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
127
|
+
className?: string;
|
|
128
|
+
};
|
|
129
|
+
export type TourProgressTextProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
130
|
+
className?: string;
|
|
131
|
+
};
|
|
132
|
+
export type TourControlProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
133
|
+
className?: string;
|
|
134
|
+
};
|
|
135
|
+
export type TourActionsProps = {
|
|
136
|
+
children: (actions: TourAction[]) => React.ReactNode;
|
|
137
|
+
};
|
|
138
|
+
export type TourActionTriggerProps = Omit<React.ComponentPropsWithoutRef<"button">, "action" | "children"> & {
|
|
139
|
+
action: TourAction;
|
|
140
|
+
variant?: ButtonVariant;
|
|
141
|
+
children?: React.ReactNode;
|
|
142
|
+
className?: string;
|
|
143
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const _default: (props: Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "children" | "action"> & {
|
|
3
|
+
action: import("./Tour.types").TourAction;
|
|
4
|
+
variant?: import("..").ButtonVariant;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
} & React.RefAttributes<any>) => React.ReactNode;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const _default: (props: Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
portalContainerName?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
} & React.RefAttributes<any>) => React.ReactNode;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const _default: (props: Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "aria-labelledby"> & {
|
|
3
|
+
icon?: NonNullable<import("..").ButtonVisual>;
|
|
4
|
+
className?: string;
|
|
5
|
+
} & React.RefAttributes<any>) => React.ReactNode;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const _default: (props: Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
side?: import("..").AnchorSide;
|
|
4
|
+
align?: import("..").AnchorAlignment;
|
|
5
|
+
placement?: import("./Tour.types").TourFloatingPlacement;
|
|
6
|
+
portalContainerName?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
} & React.RefAttributes<any>) => React.ReactNode;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const _default: (props: Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
portalContainerName?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
} & React.RefAttributes<any>) => React.ReactNode;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import TourBase, { DEFAULT_SPOTLIGHT_OFFSET, DEFAULT_SPOTLIGHT_RADIUS } from "./Tour";
|
|
2
|
+
import TourActions from "./TourActions";
|
|
3
|
+
import TourActionTrigger from "./TourActionTrigger";
|
|
4
|
+
import TourArrow from "./TourArrow";
|
|
5
|
+
import TourBackdrop from "./TourBackdrop";
|
|
6
|
+
import TourCloseTrigger from "./TourCloseTrigger";
|
|
7
|
+
import TourContent from "./TourContent";
|
|
8
|
+
import TourControl from "./TourControl";
|
|
9
|
+
import TourDescription from "./TourDescription";
|
|
10
|
+
import TourPositioner from "./TourPositioner";
|
|
11
|
+
import TourProgressText from "./TourProgressText";
|
|
12
|
+
import TourSpotlight from "./TourSpotlight";
|
|
13
|
+
import TourTitle from "./TourTitle";
|
|
14
|
+
export declare const Tour: typeof TourBase & {
|
|
15
|
+
Backdrop: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
16
|
+
portalContainerName?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
19
|
+
Spotlight: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
20
|
+
portalContainerName?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
23
|
+
Positioner: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
24
|
+
side?: import("..").AnchorSide;
|
|
25
|
+
align?: import("..").AnchorAlignment;
|
|
26
|
+
placement?: import("./Tour.types").TourFloatingPlacement;
|
|
27
|
+
portalContainerName?: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
30
|
+
Content: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
31
|
+
className?: string;
|
|
32
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
33
|
+
Arrow: (props: import("./Tour.types").TourArrowProps & import("react").RefAttributes<any>) => React.ReactNode;
|
|
34
|
+
CloseTrigger: (props: Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "aria-labelledby"> & {
|
|
35
|
+
icon?: NonNullable<import("..").ButtonVisual>;
|
|
36
|
+
className?: string;
|
|
37
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
38
|
+
ProgressText: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
39
|
+
className?: string;
|
|
40
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
41
|
+
Title: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & {
|
|
42
|
+
className?: string;
|
|
43
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
44
|
+
Description: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
45
|
+
className?: string;
|
|
46
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
47
|
+
Control: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
48
|
+
className?: string;
|
|
49
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
50
|
+
Actions: typeof TourActions;
|
|
51
|
+
ActionTrigger: (props: Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "children" | "action"> & {
|
|
52
|
+
action: import("./Tour.types").TourAction;
|
|
53
|
+
variant?: import("..").ButtonVariant;
|
|
54
|
+
children?: React.ReactNode;
|
|
55
|
+
className?: string;
|
|
56
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
57
|
+
};
|
|
58
|
+
export { TourBackdrop, TourSpotlight, TourPositioner, TourContent, TourArrow, TourCloseTrigger, TourProgressText, TourTitle, TourDescription, TourControl, TourActions, TourActionTrigger, };
|
|
59
|
+
export { DEFAULT_SPOTLIGHT_OFFSET, DEFAULT_SPOTLIGHT_RADIUS };
|
|
60
|
+
export { TourContext, TourPositionerContext } from "./TourContext";
|
|
61
|
+
export { useTour } from "./useTour";
|
|
62
|
+
export { waitForElement, waitForElementValue, waitForEvent } from "./waitFor";
|
|
63
|
+
export type { TourWait, TourWaitOptions, TourWaitForEventOptions } from "./waitFor";
|
|
64
|
+
export * from "./Tour.types";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type TourWait<T> = [Promise<T | null>, () => void];
|
|
2
|
+
export type TourWaitOptions = {
|
|
3
|
+
timeout?: number;
|
|
4
|
+
};
|
|
5
|
+
export type TourWaitForEventOptions = AddEventListenerOptions & {
|
|
6
|
+
predicate?: (element: HTMLElement) => boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const waitForEvent: <K extends keyof HTMLElementEventMap>(target: (() => HTMLElement | null) | undefined, event: K, options?: TourWaitForEventOptions) => TourWait<HTMLElementEventMap[K]>;
|
|
9
|
+
export declare const waitForElement: (query: () => HTMLElement | null, options?: TourWaitOptions) => TourWait<HTMLElement>;
|
|
10
|
+
export declare const waitForElementValue: (query: () => HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null, value: string, options?: TourWaitOptions) => TourWait<HTMLElement>;
|