-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BA-1850: Add Missing MDX Doc Files for BaseApp Frontend Packages - group 1 #167
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# @baseapp-frontend/components | ||
|
||
## 1.0.0 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies | ||
- @baseapp-frontend/[email protected] | ||
|
||
## 0.0.42 | ||
|
||
### Patch Changes | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Meta } from '@storybook/addon-docs' | ||
|
||
<Meta title="@baseapp-frontend | designSystem/General/Logo" /> | ||
|
||
# Component Documentation | ||
|
||
## Logo | ||
|
||
- **Purpose**: A flexible component that wraps logo content in a consistent container with optional link functionality. | ||
- **Expected Behavior**: Renders a container that centers its content. When not disabled, wraps the logo in a link to the homepage ("/"). | ||
|
||
## Use Cases | ||
|
||
- **Current Usage**: | ||
- Application header logos | ||
|
||
## Props | ||
|
||
- **children** (ReactNode): The logo content to be displayed in the container | ||
- **disabledLink** (boolean): If true, removes the link wrapper (defaults to false) | ||
- **sx** (object): MUI system props for custom styling | ||
- **...other**: Additional props are passed to the root Box component | ||
|
||
## Notes | ||
|
||
- **Related Components**: | ||
- Box: Used as the container component | ||
- Link: Wraps the logo when clickable | ||
- Various logo icon components that can be passed as children | ||
|
||
## Example Usage | ||
|
||
```javascript | ||
import { Logo } from '@baseapp-frontend/design-system' | ||
import { BaseAppLogoCondensed } from '@baseapp-frontend/design-system/icons' | ||
|
||
const MyComponent = () => { | ||
return ( | ||
<Logo disabledLink={false}> | ||
<BaseAppLogoCondensed /> | ||
</Logo> | ||
) | ||
} | ||
export default MyComponent | ||
``` |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,54 @@ | ||||||||||||||||||||||||||||
import { Meta } from '@storybook/addon-docs' | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
<Meta title="@baseapp-frontend | designSystem/Popover/Popover" /> | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
# Component Documentation | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
## Popover | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
- **Purpose**: A customized wrapper around MUI's Popover component that provides consistent positioning and styling, with an optional arrow indicator. It's used for displaying floating content like menus and tooltips with precise positioning control. | ||||||||||||||||||||||||||||
- **Expected Behavior**: Renders a popover anchored to a specified element (currently only AccountPopover), with configurable arrow placement and positioning. | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
## Use Cases | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
- **Current Usage**: | ||||||||||||||||||||||||||||
- AccountPopover | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
## Props | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
- **open** (HTMLElement | null): The anchor element to position the popover against | ||||||||||||||||||||||||||||
- **children** (ReactNode): Content to render inside the popover | ||||||||||||||||||||||||||||
- **arrow** (string, optional): Position of the arrow indicator (default: 'top-right') | ||||||||||||||||||||||||||||
- **hiddenArrow** (boolean, optional): Whether to hide the arrow indicator | ||||||||||||||||||||||||||||
- **sx** (object, optional): Additional styles to apply to the popover | ||||||||||||||||||||||||||||
- **...other**: All other props are passed to MUI Popover | ||||||||||||||||||||||||||||
Comment on lines
+19
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enhance props documentation The -**open** (HTMLElement | null): The anchor element to position the popover against
+**open** (boolean): Whether the popover is currently open
+**anchorEl** (HTMLElement | null): The anchor element to position the popover against
**children** (ReactNode): Content to render inside the popover
**arrow** (string, optional): Position of the arrow indicator (default: 'top-right')
**hiddenArrow** (boolean, optional): Whether to hide the arrow indicator
**sx** (object, optional): Additional styles to apply to the popover
**...other**: All other props are passed to MUI Popover 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
## Notes | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
- **Related Components**: | ||||||||||||||||||||||||||||
- AccountPopover: Uses Popover internally for dropdown menus | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
## Example Usage | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
```javascript | ||||||||||||||||||||||||||||
import { Popover } from '@baseapp-frontend/design-system' | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
const MyComponent = () => { | ||||||||||||||||||||||||||||
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null) | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => { | ||||||||||||||||||||||||||||
setAnchorEl(event.currentTarget) | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
const handleClose = () => { | ||||||||||||||||||||||||||||
setAnchorEl(null) | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
return ( | ||||||||||||||||||||||||||||
<Popover open={anchorEl} onClose={handleClose}> | ||||||||||||||||||||||||||||
<div>This is the content of the Popover</div> | ||||||||||||||||||||||||||||
</Popover> | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
export default MyComponent | ||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||
Comment on lines
+33
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance example usage with trigger element The example is incomplete as it doesn't show the trigger element that opens the popover. ```javascript
import { Popover } from '@baseapp-frontend/design-system'
+import { Button } from '@mui/material'
const MyComponent = () => {
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null)
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
setAnchorEl(event.currentTarget)
}
const handleClose = () => {
setAnchorEl(null)
}
return (
+ <>
+ <Button onClick={handleClick}>
+ Open Popover
+ </Button>
<Popover open={anchorEl} onClose={handleClose}>
<div>This is the content of the Popover</div>
</Popover>
+ </>
)
}
export default MyComponent
|
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" /> | ||||||||||||||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Update the title format as requested As mentioned in the PR comments, remove "-template" from the title since this documentation is for the packages themselves. -<Meta title="@baseapp-frontend | designSystem/Avatars/AvatarWithPlaceholder" />
+<Meta title="@baseapp-frontend-packages | designSystem/Avatars/AvatarWithPlaceholder" /> 📝 Committable suggestion
Suggested change
|
||||||||||||||
|
||||||||||||||
# 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. | ||||||||||||||
Comment on lines
+9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance placeholder behavior documentation The documentation should specify:
|
||||||||||||||
|
||||||||||||||
## 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 | ||||||||||||||
|
||||||||||||||
Comment on lines
+14
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add package-specific use cases The current use cases are too generic. As mentioned in the PR comments, please provide specific examples of where this component is used within the BaseApp packages. |
||||||||||||||
## 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" /> | ||||||||||||||||||||||||||||||||||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Update the title format as requested As mentioned in the PR comments, update the package name in the title. -<Meta title="@baseapp-frontend | designSystem/Avatars/ClickableAvatar" />
+<Meta title="@baseapp-frontend-packages | designSystem/Avatars/ClickableAvatar" /> 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
# 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> | ||||||||||||||||||||||||||||||||||
Comment on lines
+44
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace hardcoded image URL with a placeholder The example uses a hardcoded DigitalOcean Spaces URL which may not be accessible and could become invalid. Replace it with a placeholder or local asset path. <Image
- src="https://nyc3.digitaloceanspaces.com/baseapp-production-storage/media/user-avatars/5/6/4/resized/50/50/185a04dfdaa512d218cf9b7a5097e3c9.png"
+ src="/assets/placeholder-avatar.png"
alt="Avatar Icon"
width={50}
height={50}
/> 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
export default MyComponent | ||||||||||||||||||||||||||||||||||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { Meta } from '@storybook/addon-docs' | ||
|
||
<Meta title="@baseapp-frontend | designSystem/Buttons/IconButton" /> | ||
|
||
# Component Documentation | ||
|
||
## IconButton | ||
|
||
- **Purpose**: The IconButton component provides a clickable button that displays an icon. | ||
- **Expected Behavior**: The IconButton renders as a circular button containing an icon. It responds to hover and click states with visual feedback, and can be disabled when needed. | ||
|
||
## Use Cases | ||
|
||
- **Current Usage**: | ||
- Navigation menus | ||
- Toolbars | ||
- Action buttons in tables/lists | ||
- Close buttons for modals/dialogs | ||
- Toggle buttons for expandable content | ||
- **Potential Usage**: | ||
- Social media sharing buttons | ||
- Media player controls | ||
- Form field actions (clear, show/hide password) | ||
- Mini floating action buttons | ||
|
||
## Props | ||
|
||
- **children** (ReactNode): The icon element to be displayed inside the button. | ||
- **color** (string): The color of the button. | ||
- **disabled** (boolean): If true, the button will be disabled. | ||
- **isLoading** (boolean): If true, the button will be in a loading state. | ||
- **onClick** (function): The function to be called when the button is clicked. | ||
- **hasTooltip** (boolean): If true, the button will have a tooltip. | ||
|
||
Comment on lines
+28
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Complete props documentation The props section needs the following enhancements:
- **color** (string): The color of the button.
+ **color** `"primary" | "secondary" | "error" | "warning" | "info" | "success"` (default: `"primary"`): The color of the button.
+ **tooltipText** `string`: The text to display in the tooltip when hasTooltip is true.
|
||
## Notes | ||
|
||
- **Related Components**: | ||
- Button: Standard button component for text-based actions | ||
- Tooltip: Often wraps IconButton to provide additional context | ||
- Menu: Can be triggered by IconButton | ||
- Icons: Provides the visual elements used within IconButton | ||
|
||
## Example Usage | ||
|
||
```javascript | ||
import { IconButton } from '@baseapp-frontend/design-system' | ||
import { CloseIcon } from '@baseapp-frontend/design-system/icons' | ||
|
||
const MyComponent = () => { | ||
return ( | ||
<IconButton | ||
hasTooltip={true} | ||
isLoading={false} | ||
disabled={false} | ||
color="primary" | ||
onClick={() => {}} | ||
> | ||
<CloseIcon /> | ||
</IconButton> | ||
) | ||
} | ||
export default MyComponent | ||
``` |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,78 @@ | ||||||||||||||
import { Meta } from '@storybook/addon-docs' | ||||||||||||||
|
||||||||||||||
<Meta title="@baseapp-frontend | designSystem/Dialogs/ConfirmDialog" /> | ||||||||||||||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update the Storybook title according to the new convention As per the PR comments, the title should not include "@baseapp-frontend". Please update it to follow the correct format. -<Meta title="@baseapp-frontend | designSystem/Dialogs/ConfirmDialog" />
+<Meta title="designSystem/Dialogs/ConfirmDialog" /> 📝 Committable suggestion
Suggested change
|
||||||||||||||
|
||||||||||||||
# Component Documentation | ||||||||||||||
|
||||||||||||||
## ConfirmDialog | ||||||||||||||
|
||||||||||||||
- **Purpose**: A dialog component that prompts users to confirm or cancel an action, providing a clear decision point before proceeding with important operations. | ||||||||||||||
- **Expected Behavior**: Opens as a modal dialog with a message, title, and two action buttons (confirm and cancel). Blocks interaction with the main content until a choice is made. | ||||||||||||||
Comment on lines
+9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add BaseApp-specific implementation details While the general purpose and behavior are well described, please add specific details about how this component is used within BaseApp. For example:
|
||||||||||||||
|
||||||||||||||
## Use Cases | ||||||||||||||
|
||||||||||||||
- **Current Usage**: | ||||||||||||||
- Delete confirmation dialogs | ||||||||||||||
- Save changes confirmations | ||||||||||||||
- Logout confirmations | ||||||||||||||
- Form submission confirmations | ||||||||||||||
- **Potential Usage**: | ||||||||||||||
- Bulk action confirmations | ||||||||||||||
- Settings changes verification | ||||||||||||||
- Account modifications | ||||||||||||||
- Data export confirmations | ||||||||||||||
Comment on lines
+14
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Replace generic use cases with actual BaseApp implementations Instead of listing generic use cases, document specific implementations within BaseApp. For each use case:
|
||||||||||||||
|
||||||||||||||
## Props | ||||||||||||||
|
||||||||||||||
- **open** (boolean): Controls the visibility of the dialog | ||||||||||||||
- **title** (string): The heading text displayed at the top of the dialog | ||||||||||||||
- **content** (ReactNode): The main message or content displayed in the dialog body | ||||||||||||||
- **cancelText** (string): Custom text for the cancel button (optional, defaults to "Cancel") | ||||||||||||||
- **onClose** (function): Callback function executed when the cancel button is clicked | ||||||||||||||
- **action** (ReactNode): The action button to be displayed in the dialog | ||||||||||||||
|
||||||||||||||
Comment on lines
+27
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance props documentation with accessibility and customization options The props documentation should include:
|
||||||||||||||
## Notes | ||||||||||||||
|
||||||||||||||
- **Related Components**: | ||||||||||||||
- Dialog: Base dialog component | ||||||||||||||
- AlertDialog: For displaying important messages | ||||||||||||||
- Modal: For more complex modal interactions | ||||||||||||||
- Button: Used within the dialog for actions | ||||||||||||||
|
||||||||||||||
## Example Usage | ||||||||||||||
|
||||||||||||||
```javascript | ||||||||||||||
import { ConfirmDialog } from '@baseapp-frontend/design-system' | ||||||||||||||
import { Button } from '@baseapp-frontend/design-system' | ||||||||||||||
|
||||||||||||||
const MyComponent = () => { | ||||||||||||||
const [open, setOpen] = useState(false) | ||||||||||||||
|
||||||||||||||
const handleClickOpen = () => { | ||||||||||||||
setOpen(true) | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
const handleClose = () => { | ||||||||||||||
setOpen(false) | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
const handleConfirm = () => { | ||||||||||||||
alert('Confirmed') | ||||||||||||||
handleClose() | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
return ( | ||||||||||||||
<> | ||||||||||||||
<Button onClick={handleClickOpen}>Open Confirm Dialog</Button> | ||||||||||||||
<ConfirmDialog | ||||||||||||||
open={open} | ||||||||||||||
title="Are you sure?" | ||||||||||||||
content="This action cannot be undone." | ||||||||||||||
onClose={handleClose} | ||||||||||||||
action={<Button onClick={handleConfirm}>Confirm</Button>} | ||||||||||||||
/> | ||||||||||||||
</> | ||||||||||||||
) | ||||||||||||||
} | ||||||||||||||
export default MyComponent | ||||||||||||||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version and changelog details need improvement
The major version bump (1.0.0) seems inconsistent with the nature of changes:
The changelog entry lacks specific details:
Consider:
📝 Committable suggestion