Skip to content

Commit

Permalink
fixing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joaosoutto committed Jan 8, 2025
1 parent fb8db6c commit dfed8d0
Show file tree
Hide file tree
Showing 13 changed files with 325 additions and 347 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="@baseapp-frontend / DesignSystem/General" />
<Meta title="@baseapp-frontend | designSystem/General/Logo" />

# Component Documentation

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="@baseapp-frontend / DesignSystem/Popover" />
<Meta title="@baseapp-frontend | designSystem/Popover/Popover" />

# Component Documentation

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="@baseapp-frontend | designSystem/Avatars/AvatarWithPlaceholder" />

# Components Documentation

## AvatarWithPlaceholder

- **Purpose**: A flexible avatar component that displays either an image, text content, or a placeholder when no content is provided. It handles various content types gracefully while maintaining consistent sizing and styling.
- **Expected Behavior**: Renders an avatar with the provided content (image or text), and falls back to a placeholder when no content is available.

## Use Cases

- **Current Usage**:
- User profile avatars throughout the application
- Team member displays
- Contact lists
- Comment sections
- **Potential Usage**:
- Group chat avatars
- Organization logos
- Project thumbnails
- Social media integrations

## Props

- **width** (number): Width of the avatar in pixels. Default is 36.
- **height** (number): Height of the avatar in pixels. Default is 36.
- **children** (ReactNode): Content to be displayed within the avatar - can be an image component or text.
- **...props** (AvatarProps): Additional props are passed through to the underlying MUI Avatar component.

## Notes

- **Related Components**:
- ClickableAvatar: Extends this component with click functionality
- Avatar: MUI's base avatar component
- Badge: Can be used to add status indicators
- AvatarGroup: For displaying multiple avatars together

## Example Usage

```javascript
import { AvatarWithPlaceholder } from '@baseapp-frontend/design-system'

const MyComponent = () => {
return (
<AvatarWithPlaceholder width={50} height={50}>
"AA"
</AvatarWithPlaceholder>
)
}
export default MyComponent
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="@baseapp-frontend | designSystem/Avatars/ClickableAvatar" />

# Component Documentation
## ClickableAvatar

- **Purpose**: An enhanced avatar component that adds click interactivity and hover animations using Framer Motion. Built on top of AvatarWithPlaceholder to provide a clickable interface with visual feedback.
- **Expected Behavior**: Renders a clickable avatar that scales up slightly on hover and provides tap animation feedback. Can display images or text content with consistent sizing.

## Use Cases

- **Current Usage**:
- Interactive user avatars
- Profile picture buttons
- Avatar menu triggers
- Clickable user representations

## Props

- **onClick** (function): Handler function called when avatar is clicked
- **isOpen** (boolean): Controls the open state of the avatar (default: false)
- **width** (number): Width of the avatar in pixels (default: 36)
- **height** (number): Height of the avatar in pixels (default: 36)
- **children** (ReactNode): Content to be displayed within the avatar
- **...props**: Additional props are passed through to the underlying AvatarWithPlaceholder component

## Notes

- **Related Components**:
- AvatarWithPlaceholder: Base component providing avatar display functionality
- IconButtonStyled: Styled button wrapper providing click interaction
- MUI IconButton: Base component for click functionality

## Example Usage

```javascript
import { ClickableAvatar } from '@baseapp-frontend/design-system'

import Image from 'next/image'

const MyComponent = () => {
return (
<ClickableAvatar isOpen={false} width={50} height={50} onClick={() => {}}>
<Image
src="https://nyc3.digitaloceanspaces.com/baseapp-production-storage/media/user-avatars/5/6/4/resized/50/50/185a04dfdaa512d218cf9b7a5097e3c9.png"
alt="Avatar Icon"
width={50}
height={50}
/>
</ClickableAvatar>
)
}
export default MyComponent
```

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="@baseapp-frontend / DesignSystem/Buttons" />
<Meta title="@baseapp-frontend | designSystem/Buttons/IconButton" />

# Component Documentation

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="@baseapp-frontend / DesignSystem/Dialogs" />
<Meta title="@baseapp-frontend | designSystem/Dialogs/ConfirmDialog" />

# Component Documentation

Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="@baseapp-frontend / DesignSystem/Drawers" />
<Meta title="@baseapp-frontend | designSystem/Drawers/SwipeableDrawer" />

# Component Documentation

## SwipeableDrawer

- **Purpose**: A swipeable drawer component that provides a sliding panel from any edge of the screen, with touch and swipe gesture support for enhanced mobile interaction.
- **Expected Behavior**: Opens smoothly with swipe gestures or programmatic control. Provides haptic feedback and smooth animations. Can be dismissed via swipe, backdrop click, or programmatic close. Maintains proper touch interaction zones and respects system gestures.
- **Purpose**: A customized MUI SwipeableDrawer component that provides a bottom sliding panel with a puller handle and custom styling.
- **Expected Behavior**: Renders a bottom-anchored drawer that can be opened and closed programmatically. Features a visual puller handle and custom content container. Disables swipe-to-open functionality but maintains swipe-to-close.

## Use Cases

- **Current Usage**:
- Mobile navigation menus
- Filter panels in mobile views
- Action sheets
- Mobile cart drawers in e-commerce
- **Potential Usage**:
- Quick settings panels
- Mobile search interfaces
- Context menus
- Detail view panels
- Bottom sheet dialogs
- Mobile action sheets
- Expandable bottom panels
- Touch-friendly modal interfaces

## Props

- **open** (boolean): Controls the open/closed state of the drawer
- **onClose** (function): Callback fired when the drawer should close
- **onOpen** (function): Callback fired when the drawer should open
- **globalHeight** (number): Global height of the drawer
- **children** (ReactNode): Content to be rendered inside the drawer
- **globalHeight** (string): Height of the drawer paper component (default: `calc(25% - SWIPE_AREA_WIDTH)`)
- **...MUISwipeableDrawerProps**: All other props are passed to the underlying MUI SwipeableDrawer component
- open
- onClose
- onOpen (defaults to no-op function)
- anchor (fixed to "bottom")
- disableSwipeToOpen (fixed to true)

## Notes

- **Related Components**:
- Drawer: Standard non-swipeable drawer variant
- Modal: For modal dialogs
- Paper: Used as the surface component
- Backdrop: For the overlay effect
- MUI SwipeableDrawer: Base component providing core functionality
- ContentContainer: Styled component for content layout
- Puller: Visual handle component
- SwipeableContainer: Container for the puller

## Example Usage

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="@baseapp-frontend | designSystem/Inputs/SocialTextField" />

# Component Documentation

## SocialTextField

- **Purpose**: A TextField component made specifically for comments creation, with support for replies and additional social features.
- **Expected Behavior**: Renders a textarea field with optional reply functionality showing who is being replied to, and a container for additional actions/children.

## Use Cases

- **Current Usage**:
- Comments sections
- Reply threads
- Social interactions
- **Potential Usage**:
- Discussion forums
- Messaging interfaces
- Any social commenting system

## Props

- **children** (ReactNode): Content rendered below the textarea, typically action buttons
- **isReply** (boolean): If true, shows the reply interface with target user's name
- **replyTargetName** (string): Name of the user being replied to, shown when isReply is true
- **onCancelReply** (function): Callback fired when clicking the cancel reply button
- **...TextareaFieldProps**: All other props are passed to the underlying TextareaField component

## Notes

- **Related Components**:
- TextareaField: Used as the base input component
- IconButton: Used for the cancel reply action
- Typography/TypographyWithEllipsis: Used for reply text display
- CommentReplyIcon/CloseIcon: Icons used in the reply interface

## Example Usage

```javascript
import { SocialTextField } from '@baseapp-frontend/design-system'

const MyComponent = () => {
const [value, setValue] = useState < string > ''

return (
<SocialTextField
label="Default Label"
placeholder="Type something..."
value={value}
onChange={(e) => setValue(e.target.value)}
isReply={true}
replyTargetName="John Doe"
helperText="This is a helper text"
isResponsive={true}
onCancelReply={() => {}}
/>
)
}
export default MyComponent
```
Loading

0 comments on commit dfed8d0

Please sign in to comment.