Skip to content

Commit

Permalink
feat: add Readme to OnboardingMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-jpg committed Mar 19, 2024
1 parent e296ed4 commit 69f0b5c
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 4 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
/src/components/StoreBadge @NikitaCG
/src/components/Stories @darkgenius
/src/components/AdaptiveTabs @artemipanchuk
/src/components/OnboardingMenu @nikita-jpg
4 changes: 0 additions & 4 deletions src/components/OnboardingMenu/OnboardingMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ const OnboardingMenuParent = ({
className={cnOnboardingMenu('title-icon')}
/>
) : null}

{/* <span>
{title}
</span> */}
{title}
</button>
<Progress
Expand Down
51 changes: 51 additions & 0 deletions src/components/OnboardingMenu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## OnboardingMenu

A component for managing [onboarding presets](https://github.com/gravity-ui/onboarding) ([storybook](https://preview.gravity-ui.com/components/?path=/story/components-onboardingmenu--default)).

## Props

```ts
type OnboardingMenu = {
/** title of onboarding menu */
title: React.ReactNode;
/** number of presets passed. Changes the progress bar */
progress: number;
/** icon of onboarding menu */
icon?: IconData;

/** the default component is expand or collapsed */
defaultExpanded: boolean;
/** menu items*/
children?: React.ReactNode;

collapseButtonText?: string;
completeButtonText?: string;
className?: string;

onExpand?: (expanded: boolean) => void;
onCompleteClick: (event: React.MouseEvent) => void;
onCollapseClick?: (event: React.MouseEvent) => void;
};

type OnboardingMenu.ItemProps = {
title: string;
/** affects the item icon */
status?: 'completed' | 'pending';
children?: React.ReactNode;
buttons?: React.ReactNode;
/** usually the last element does not need a divider, then you need to pass false */
hasDivider?: boolean;
loading?: boolean;
};

type OnboardingMenu.ItemImage = {
src: string;
alt: string;
};

type OnboardingMenu.ItemText = {
src: string;
alt: string;
};

```
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ export * from './SharePopover';
export * from './StoreBadge';
export * from './Stories';
export * from './StoriesGroup';
export * from './OnboardingMenu';

0 comments on commit 69f0b5c

Please sign in to comment.