Skip to content

Commit

Permalink
fix(OnboardingMenu): add re-export and docs (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-jpg authored Mar 19, 2024
1 parent e296ed4 commit 84df613
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
* @amje @ValeraS @korvin89
/src/components/AdaptiveTabs @artemipanchuk
/src/components/DefinitionList @Raubzeug
/src/components/FilePreview @KirillDyachkovskiy
/src/components/FormRow @ogonkov
/src/components/HelpPopover @Raubzeug
/src/components/OnboardingMenu @nikita-jpg
/src/components/PlaceholderContainer @Marginy605
/src/components/PromoSheet @Avol-V
/src/components/SharePopover @niktverd
/src/components/StoreBadge @NikitaCG
/src/components/Stories @darkgenius
/src/components/AdaptiveTabs @artemipanchuk

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
49 changes: 49 additions & 0 deletions src/components/OnboardingMenu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## 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 OnboardingMenuProps = {
/** 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 OnboardingMenuItemProps = {
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 OnboardingMenuItemImageProps = {
src: string;
alt: string;
};

type OnboardingMenuItemTextProps = {
text: string;
};
```
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export * from './InfiniteScroll';
export * from './ItemSelector';
export * from './Notification';
export * from './Notifications';
export * from './OnboardingMenu';
export * from './PasswordInput';
export * from './PlaceholderContainer';
export * from './PromoSheet';
Expand Down

0 comments on commit 84df613

Please sign in to comment.