diff --git a/docs/src/components/FeatureMarquee.tsx b/docs/src/components/FeatureMarquee.tsx index d5137a3..06ece14 100644 --- a/docs/src/components/FeatureMarquee.tsx +++ b/docs/src/components/FeatureMarquee.tsx @@ -9,6 +9,7 @@ const featureList = [ "Light-weight", "Feature Rich", "Highly Customizable", + "Supports all Major Browsers", "Easy to use", "Accessible", "Frameworks Ready", @@ -21,7 +22,7 @@ export function FeatureMarquee() {

{ featureList.map((featureItem, index) => ( - { featureItem } · + { featureItem }· ))}

diff --git a/docs/src/components/UsecaseItem.astro b/docs/src/components/UsecaseItem.astro new file mode 100644 index 0000000..e6c3600 --- /dev/null +++ b/docs/src/components/UsecaseItem.astro @@ -0,0 +1,18 @@ +--- +export interface Props { + title: string; + description: string; +} + +const { title, description } = Astro.props; +--- + +
+ +

+ { title } +

+

+ { description } +

+
\ No newline at end of file diff --git a/docs/src/components/examples/ExampleButton.tsx b/docs/src/components/examples/ExampleButton.tsx new file mode 100644 index 0000000..6ffcbda --- /dev/null +++ b/docs/src/components/examples/ExampleButton.tsx @@ -0,0 +1,16 @@ +type ExampleButtonProps = { + onClick: () => void; + text: string; +}; + +export function ExampleButton(props: ExampleButtonProps) { + const { onClick, text } = props; + + return ( + + ); +} \ No newline at end of file diff --git a/docs/src/pages/index.astro b/docs/src/pages/index.astro index 892013a..2d5aa9f 100644 --- a/docs/src/pages/index.astro +++ b/docs/src/pages/index.astro @@ -2,6 +2,8 @@ import BaseLayout from "../layouts/BaseLayout.astro"; import { FeatureMarquee } from "../components/FeatureMarquee"; import Container from "../components/Container.astro"; +import UsecaseItem from "../components/UsecaseItem.astro"; +import { ExampleButton } from "../components/examples/ExampleButton"; ---
@@ -27,46 +29,52 @@ import Container from "../components/Container.astro";
-
+
-

Usecases

-

Due to it's extensive API, driver.js can be used for a wide range of use cases.

+

Examples

+

Here are just a few examples; find more in the documentation.

+ +
+ + + + + + + + + + + + + + and much more ... + +
+ +

Due to it's extensive API, driver.js can be used for a wide range of use + cases.

-
- -

Onboard Users

-

- Onboard your users by explaining how to use your product and answer common - questions. -

-
- -
- -

- Remove Distractions -

-

- With highlight feature, you can remove distractions and focus your users attention on what matters. -

-
- -
- -

Contextual Help

-

- Provide contextual help for your users, explain how to use your product and answer common questions. -

-
- -
- -

Feature Adoption

-

- Highlight new features, explain how to use them and make sure your users don't miss them. -

-
+ + + +
+ diff --git a/src/popover.ts b/src/popover.ts index 6ca828d..d79c502 100644 --- a/src/popover.ts +++ b/src/popover.ts @@ -102,7 +102,6 @@ export function renderPopover(element: Element, step: DriveStep) { const showFooter = showButtonsConfig?.includes("next") || showButtonsConfig?.includes("previous") || - showButtonsConfig?.includes("close") || showProgressConfig; popover.closeButton.style.display = showButtonsConfig.includes("close") ? "block" : "none"; @@ -160,7 +159,10 @@ export function renderPopover(element: Element, step: DriveStep) { // If the user has provided a custom callback, call it // otherwise, emit the event. if (onNextClick) { - return onNextClick(element, step); + return onNextClick(element, step, { + config: getConfig(), + state: getState(), + }); } else { return emit("nextClick"); } @@ -168,7 +170,10 @@ export function renderPopover(element: Element, step: DriveStep) { if (target.classList.contains("driver-popover-prev-btn")) { if (onPrevClick) { - return onPrevClick(element, step); + return onPrevClick(element, step, { + config: getConfig(), + state: getState(), + }); } else { return emit("prevClick"); } @@ -176,7 +181,10 @@ export function renderPopover(element: Element, step: DriveStep) { if (target.classList.contains("driver-popover-close-btn")) { if (onCloseClick) { - return onCloseClick(element, step); + return onCloseClick(element, step, { + config: getConfig(), + state: getState(), + }); } else { return emit("closeClick"); }