Skip to content

Commit

Permalink
Merge branch 'release/0.11.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Eitan Elbaz committed Jun 28, 2023
2 parents ae93a15 + e90ebd3 commit af6049e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-grand-tour",
"version": "0.11.1",
"version": "0.11.2",
"description": "",
"main": "./dist/main.cjs.js",
"module": "./dist/main.es.js",
Expand Down
12 changes: 3 additions & 9 deletions src/ReactGrandTour.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import React, { useMemo, useCallback, useState, PropsWithChildren, useEffect } from 'react';
import styles from './styles';
import {
ComponentOverrides,
ComponentVisibility,
ReactGrandTourCloseReason,
ReactGrandTourProps,
ReactGrandTourStep,
} from './types';
import { ReactGrandTourCloseReason, ReactGrandTourProps, ReactGrandTourStep } from './types';
import {
Arrow,
CurrentStepLabel,
Expand All @@ -21,7 +15,7 @@ import {
} from './components';
import ReactGrandTourContext from './Context';

type Props = PropsWithChildren<ReactGrandTourProps & Partial<ComponentOverrides>>;
type Props = PropsWithChildren<ReactGrandTourProps>;

const defaultShortcuts = {
closeModal: ['Escape'],
Expand Down Expand Up @@ -61,7 +55,7 @@ const ReactGrandTour: React.FC<Props> = ({
hidePreviousStepButton,
hideStepButtons,
}) => {
const [open, setOpen] = useState(defaultOpen);
const [open, setOpen] = useState(false);
const [currentIndex, setCurrentIndex] = useState(openAt);
const [steps, setSteps] = useState(defaultSteps);
const allSteps = useMemo(() => steps.map((_, i) => i), [steps]);
Expand Down
31 changes: 16 additions & 15 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import React, { PropsWithChildren, ReactNode } from 'react';

export type ReactGrandTourProps = ComponentVisibility & {
open?: boolean;
onOpen?: () => void;
onClose?: (reason?: ReactGrandTourCloseReason) => void;
onStepChange?: (props: OnStepChangeProps) => void;
openAt?: number;
steps?: ReactGrandTourStep[];
scrollIntoViewOptions?: ScrollIntoViewOptions;
transitionSpeed?: number;
disableCloseOnEscape?: boolean;
disableCloseBtn?: boolean;
disableCloseOnBackdropClick?: boolean;
stylingOverrides?: ReactGrandTourStylingOverrides;
keyboardShortcuts?: ReactGrandTourShortcuts;
};
export type ReactGrandTourProps = ComponentVisibility &
Partial<ComponentOverrides> & {
open?: boolean;
onOpen?: () => void;
onClose?: (reason?: ReactGrandTourCloseReason) => void;
onStepChange?: (props: OnStepChangeProps) => void;
openAt?: number;
steps?: ReactGrandTourStep[];
scrollIntoViewOptions?: ScrollIntoViewOptions;
transitionSpeed?: number;
disableCloseOnEscape?: boolean;
disableCloseBtn?: boolean;
disableCloseOnBackdropClick?: boolean;
stylingOverrides?: ReactGrandTourStylingOverrides;
keyboardShortcuts?: ReactGrandTourShortcuts;
};

export type ComponentVisibility = {
hideCloseButton?: boolean;
Expand Down

0 comments on commit af6049e

Please sign in to comment.