Skip to content
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

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

joaosoutto
Copy link
Contributor

@joaosoutto joaosoutto commented Dec 23, 2024

Acceptance Criteria
Context:
The BaseApp Frontend Packages https://github.com/silverlogic/baseapp-frontend contains a number of pages and components that currently have Storybook stories but are missing corresponding MDX documentation files.

Create MDX Documentation Files: For each missing component or page listed below, create an .mdx file in the storybook folder within the component’s or page's directory.

Follow Documentation Standards: Use the MDX Documentation Template provided in our Tettra guide https://app.tettra.co/teams/TSL/pages/frontend-documentation-guide

Please check examples on:

https://bitbucket.org/silverlogic/baseapp-frontend-template/src/master/apps/web/components/design-system/inputs/PasswordField/__storybook__/PasswordField.mdx

https://bitbucket.org/silverlogic/baseapp-frontend-template/src/master/apps/web/app/(with-navigation)/__storybook__/HomePage.mdx

Missing MDX:

Popover

TextField

SocialTextField

TextareaField

Logo

IconButton

TypographyWithEllipsis

SwipeableDrawer

ClickableAvatar

AvatarWithPlaceholder

ConfirmDialog

Approvd
https://app.approvd.io/projects/BA/stories/36543

Summary by CodeRabbit

  • Documentation
    • Added comprehensive Storybook documentation for multiple design system components, including:
      • Logo
      • Popover
      • IconButton
      • ConfirmDialog
      • SwipeableDrawer
      • TypographyWithEllipsis
      • AvatarWithPlaceholder
      • ClickableAvatar
      • SocialTextField
      • TextField
      • TextareaField
  • Changelog
    • Updated version entries for @baseapp-frontend/components, @baseapp-frontend/design-system, and @baseapp-frontend/wagtail packages to reflect new versions and dependencies.

Copy link

changeset-bot bot commented Dec 23, 2024

⚠️ No Changeset found

Latest commit: 031df5c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

coderabbitai bot commented Dec 23, 2024

Walkthrough

This pull request introduces comprehensive Storybook documentation for multiple components within the design system. The documentation covers various UI components like Logo, Popover, IconButton, ConfirmDialog, SwipeableDrawer, TypographyWithEllipsis, AvatarWithPlaceholder, ClickableAvatar, SocialTextField, TextField, and TextareaField. Each documentation file follows a consistent Storybook format, providing details about component purpose, expected behavior, use cases, props, and example implementations.

Changes

File Path Change Summary
packages/design-system/components/*/__storybook__/*.mdx Added Storybook documentation for multiple design system components, including Logo, Popover, IconButton, ConfirmDialog, SwipeableDrawer, TypographyWithEllipsis, AvatarWithPlaceholder, ClickableAvatar, SocialTextField, TextField, and TextareaField.
packages/components/CHANGELOG.md Added new version entry 1.0.0, documenting the update to @baseapp-frontend/design-system dependency.
packages/components/package.json Updated version from 0.0.42 to 1.0.0.
packages/design-system/CHANGELOG.md Added new version entry 1.0.0, indicating the addition of MDX documentation files for several components.
packages/design-system/package.json Updated version from 0.0.27 to 1.0.0.
packages/wagtail/CHANGELOG.md Added new version entry 2.0.0, documenting the update to @baseapp-frontend/design-system dependency.
packages/wagtail/package.json Updated version from 1.0.12 to 2.0.0.

Possibly related PRs

Suggested Reviewers

  • deboracosilveira
  • anicioalexandre
  • priscilladeroode

Poem

🐰 Hop, hop, documentation's here!
Components dancing, crystal clear
Storybook pages, a design delight
Explaining each pixel with rabbit might
Our UI system, now brightly shown 🎨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

🧹 Nitpick comments (20)
packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx (3)

32-33: Consider removing redundant multiline prop

Since this is specifically a TextareaField component, the multiline prop seems redundant as textareas are inherently multi-line. Consider removing this prop to avoid confusion, unless it's required for compatibility with the base TextField component.


28-34: Enhance props documentation with types and default values

Consider enhancing the props documentation by:

  1. Adding TypeScript types for each prop
  2. Including default values where applicable
  3. Marking required props

Example format:

- **value** (string, required): The controlled value of the textarea.
- **onChange** (function(event: ChangeEvent<HTMLTextAreaElement>), required): Callback fired when the textarea value changes.
- **maxRows** (number, optional, default: undefined): Maximum number of rows before scrolling begins.

49-49: Fix TypeScript syntax in example code

The TypeScript generic syntax in useState has incorrect spacing.

-  const [value, setValue] = useState < string > ''
+  const [value, setValue] = useState<string>('')
packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (2)

27-34: Enhance props documentation with validation details

The props documentation should include:

  1. TypeScript types for each prop
  2. Validation constraints for the value prop
  3. Event type for onChange callback
  4. Default values for boolean props

49-49: Fix TypeScript syntax in example code

The TypeScript generic syntax in useState has incorrect spacing.

-  const [value, setValue] = useState < string > ''
+  const [value, setValue] = useState<string>('')
packages/design-system/components/inputs/TextField/__storybook__/TextField.mdx (3)

10-10: Fix grammar in expected behavior description

There's a missing possessive apostrophe in "users input".

-The TextField responds to users input, displaying the values typed by the user.
+The TextField responds to user's input, displaying the values typed by the user.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~10-~10: It looks like there might be a possessive apostrophe missing. Consider inserting it.
Context: ...d Behavior**: The TextField responds to users input, displaying the values typed by t...

(AI_EN_LECTOR_MISSING_NOUN_POSSESSIVE)


27-34: Enhance props documentation

As this is the base TextField component, its props documentation should be especially thorough. Consider adding:

  1. TypeScript types for all props
  2. Default values
  3. Required vs optional status
  4. Validation props and their possible values
  5. Event types for callbacks

49-49: Fix TypeScript syntax in example code

The TypeScript generic syntax in useState has incorrect spacing.

-  const [value, setValue] = useState < string > ''
+  const [value, setValue] = useState<string>('')
packages/design-system/components/Logo/__storybook__/Logo.mdx (1)

27-28: Enhance props documentation

The props section should include:

  • Type annotations (e.g., disabledLink?: boolean)
  • Default values
  • Required/optional status
- **disabledLink** (boolean): If true, the logo will not be a link (will not redirect to any page).
- **children** (ReactNode): The logo icon or text to be displayed.
+ **disabledLink?** `boolean` (default: `false`): If true, the logo will not be a link (will not redirect to any page).
+ **children** `ReactNode` (required): The logo icon or text to be displayed.
packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx (1)

42-53: Improve example code

The current example uses a string literal "AA" which doesn't clearly demonstrate the component's capabilities.

const MyComponent = () => {
+ const userName = "Alice Anderson";
  return (
    <AvatarWithPlaceholder width={50} height={50}>
-     "AA"
+     {userName}
    </AvatarWithPlaceholder>
  )
}
packages/design-system/components/buttons/IconButton/__storybook__/IconButton.mdx (1)

45-63: Enhance example code with tooltip usage

The example enables the tooltip but doesn't demonstrate how to set the tooltip text.

  <IconButton
    hasTooltip={true}
+   tooltipText="Close dialog"
    isLoading={false}
    disabled={false}
    color="primary"
    onClick={() => {}}
  >
    <CloseIcon />
  </IconButton>
packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx (2)

27-32: Enhance props documentation with required/optional status and default values

The props documentation should be enriched with:

  • Required/optional status for each prop
  • Default values where applicable
  • Type information for the action prop should specify that it expects a Button component

44-77: Add TypeScript types to the example code

The example code would be more helpful with TypeScript types for better developer experience. Also consider adding comments explaining the state management pattern.

 const MyComponent = () => {
-  const [open, setOpen] = useState(false)
+  // Control dialog visibility state
+  const [open, setOpen] = useState<boolean>(false)

-  const handleClickOpen = () => {
+  const handleClickOpen = (): void => {
     setOpen(true)
   }

-  const handleClose = () => {
+  const handleClose = (): void => {
     setOpen(false)
   }

-  const handleConfirm = () => {
+  const handleConfirm = (): void => {
     alert('Confirmed')
     handleClose()
   }
packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx (3)

9-10: Improve grammar in component behavior description

The expected behavior description should be a complete sentence.

-- **Expected Behavior**: Displays an avatar image or fallback text, responds to click events, and provides visual feedback for hover/active states. Can be configured with different sizes and styles.
++ **Expected Behavior**: Displays an avatar image or fallback text, responds to click events, and provides visual feedback for hover/active states. The component can be configured with different sizes and styles.
🧰 Tools
🪛 LanguageTool

[style] ~10-~10: To form a complete sentence, be sure to include a subject.
Context: ...isual feedback for hover/active states. Can be configured with different sizes and ...

(MISSING_IT_THERE)


27-32: Enhance props documentation with required/optional status and validation rules

The props documentation needs:

  • Required/optional status for each prop
  • Validation rules for width/height (min/max values)
  • Type information for the onClick handler
  • Description of the expected children structure

37-37: Fix preposition in related components description

Change "in conjunction for" to "in conjunction with" for better grammar.

-  - Popover: Often used in conjunction for dropdown menus
+  - Popover: Often used in conjunction with dropdown menus
🧰 Tools
🪛 LanguageTool

[uncategorized] ~37-~37: The preposition ‘to’ seems more likely in this position.
Context: ... - Popover: Often used in conjunction for dropdown menus - Badge: Can be combin...

(AI_HYDRA_LEO_REPLACE_FOR_TO)

packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (1)

40-51: Add more comprehensive examples

Consider adding more examples that demonstrate:

  1. Different lineClamp values and their effects
  2. Integration with Tooltip for full text display
  3. Usage within common containers (Table, Card, etc.)
  4. Responsive behavior examples

Example:

// Example with tooltip and responsive behavior
const ResponsiveExample = () => {
  return (
    <Box sx={{ width: { xs: '100%', md: '50%' } }}>
      <Tooltip title="This is a long text that demonstrates truncation with tooltip integration">
        <TypographyWithEllipsis lineClamp={1}>
          This is a long text that demonstrates truncation with tooltip integration
        </TypographyWithEllipsis>
      </Tooltip>
    </Box>
  );
};
packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (3)

1-3: Consider enhancing the Meta configuration with additional metadata.

The Meta configuration could be enriched with tags and parameters to improve component discoverability and organization in Storybook.

 import { Meta } from '@storybook/addon-docs'

-<Meta title="@baseapp-frontend-template / Design System/Components/SwipeableDrawer" />
+<Meta 
+  title="@baseapp-frontend-template / Design System/Components/SwipeableDrawer"
+  tags={['autodocs', 'mobile-first', 'gesture-based']}
+  parameters={{
+    componentSubtitle: 'A swipeable drawer component with touch gesture support',
+    status: 'stable'
+  }}
+/>

9-10: Improve grammar and structure in the behavior description.

The behavior description has a minor grammatical issue and could be more structured.

 - **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.
+- **Expected Behavior**: The drawer opens smoothly with swipe gestures or programmatic control. It provides haptic feedback and smooth animations. It can be dismissed via swipe, backdrop click, or programmatic close. The component maintains proper touch interaction zones and respects system gestures.
🧰 Tools
🪛 LanguageTool

[style] ~10-~10: To form a complete sentence, be sure to include a subject.
Context: ... haptic feedback and smooth animations. Can be dismissed via swipe, backdrop click,...

(MISSING_IT_THERE)


74-74: Add maintenance-related sections to the documentation.

Consider adding the following sections to improve maintainability:

  • Version compatibility
  • Changelog
  • Testing guidelines
 export default MyComponent

+## Version Compatibility
+
+| Version | Changes | Breaking |
+|---------|---------|-----------|
+| 1.0.0 | Initial implementation | No |
+
+## Testing Guidelines
+
+### Unit Tests
+- Test open/close behavior
+- Test swipe gesture interactions
+- Test keyboard navigation
+
+### Integration Tests
+- Test with different screen sizes
+- Test with various content heights
+- Test focus management


</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 8b2cfcf21325e83282b714c5c65caa732d6a2d20 and a4c59d85802ad016a080e44c13fba43468f935e8.

</details>

<details>
<summary>📒 Files selected for processing (11)</summary>

* `packages/design-system/components/Logo/__storybook__/Logo.mdx` (1 hunks)
* `packages/design-system/components/Popover/__storybook__/Popover.mdx` (1 hunks)
* `packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx` (1 hunks)
* `packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx` (1 hunks)
* `packages/design-system/components/buttons/IconButton/__storybook__/IconButton.mdx` (1 hunks)
* `packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx` (1 hunks)
* `packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx` (1 hunks)
* `packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx` (1 hunks)
* `packages/design-system/components/inputs/TextField/__storybook__/TextField.mdx` (1 hunks)
* `packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx` (1 hunks)
* `packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx` (1 hunks)

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (1)</summary>

* packages/design-system/components/Popover/__storybook__/Popover.mdx

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 LanguageTool</summary>

<details>
<summary>packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx</summary>

[uncategorized] ~27-~27: A determiner appears to be missing. Consider inserting it.
Context: ...number): Width of the avatar in pixels. Default is 36. - **height** (number): Height of...

(AI_EN_LECTOR_MISSING_DETERMINER)

---

[uncategorized] ~28-~28: A determiner appears to be missing. Consider inserting it.
Context: ...umber): Height of the avatar in pixels. Default is 36. - **children** (ReactNode): Cont...

(AI_EN_LECTOR_MISSING_DETERMINER)

</details>
<details>
<summary>packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx</summary>

[style] ~10-~10: To form a complete sentence, be sure to include a subject.
Context: ...isual feedback for hover/active states. Can be configured with different sizes and ...

(MISSING_IT_THERE)

---

[uncategorized] ~37-~37: The preposition ‘to’ seems more likely in this position.
Context: ...   - Popover: Often used in conjunction for dropdown menus   - Badge: Can be combin...

(AI_HYDRA_LEO_REPLACE_FOR_TO)

</details>
<details>
<summary>packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx</summary>

[style] ~10-~10: To form a complete sentence, be sure to include a subject.
Context: ... haptic feedback and smooth animations. Can be dismissed via swipe, backdrop click,...

(MISSING_IT_THERE)

</details>
<details>
<summary>packages/design-system/components/inputs/TextField/__storybook__/TextField.mdx</summary>

[uncategorized] ~10-~10: It looks like there might be a possessive apostrophe missing. Consider inserting it.
Context: ...d Behavior**: The TextField responds to users input, displaying the values typed by t...

(AI_EN_LECTOR_MISSING_NOUN_POSSESSIVE)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (1)</summary>

<details>
<summary>packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (1)</summary>

`14-24`: **Well-documented use cases!**

The comprehensive list of current and potential use cases provides excellent guidance for developers on where and how to use this component effectively.

</details>

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Comment on lines 9 to 10
- **Purpose**: The SocialTextField component extends the base TextField component to provide specialized input handling for social media handles and usernames. It includes validation and formatting specific to social media inputs.
- **Expected Behavior**: The component validates and formats social media handles as users type, ensuring proper format (e.g., removing @ symbols if entered, validating allowed characters). It inherits responsive behavior from TextField.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Document validation rules and @ symbol handling

The expected behavior mentions validation and @ symbol handling, but the specific rules are not documented. Consider adding:

  1. Exact validation rules for allowed characters
  2. How @ symbols are handled (when are they removed, are users notified)
  3. Any other special character handling

Comment on lines 9 to 10
- **Purpose**: The TextField component provides a customizable input field for text entry. It supports various input types, validation states, and helper text to create accessible and user-friendly form controls.
- **Expected Behavior**: The TextField responds to users input, displaying the values typed by the user.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Document validation states

The purpose mentions "validation states" but these are not documented. Please add:

  1. Available validation states (error, warning, success, etc.)
  2. How to trigger each state
  3. Visual indicators for each state
  4. Associated props for validation handling
🧰 Tools
🪛 LanguageTool

[uncategorized] ~10-~10: It looks like there might be a possessive apostrophe missing. Consider inserting it.
Context: ...d Behavior**: The TextField responds to users input, displaying the values typed by t...

(AI_EN_LECTOR_MISSING_NOUN_POSSESSIVE)

Comment on lines 9 to 10
- **Purpose**: The Logo component displays the application's branding mark or logotype. It provides consistent brand representation across the application.
- **Expected Behavior**: The Logo component renders the brand mark at a specified size while maintaining aspect ratio. It can be clickable when used as a link and supports different variants.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add accessibility considerations

The documentation should include accessibility guidelines for the Logo component, such as:

  • Proper alt text requirements for the logo image
  • ARIA attributes when used as a link
  • Color contrast requirements

Comment on lines 40 to 45
```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
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix syntax error in example code

The example code contains an extra closing tag /> on line 50 that should be removed.

  return (
    <Logo disabledLink={false}>
      <BaseAppLogoCondensed />
    </Logo>
-   />
  )

Comment on lines +9 to +10
- **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.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance placeholder behavior documentation

The documentation should specify:

  • What the default placeholder looks like
  • How the placeholder is generated (e.g., initials from text)
  • Customization options for the placeholder

Comment on lines 27 to 28
- **children** (ReactNode): The text content to be displayed and potentially truncated.
- **lineClamp** (number): The number of lines to clamp the text to.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance props documentation

Please enhance the props documentation by adding:

  1. Default values for props (especially lineClamp)
  2. Whether props are required or optional
  3. Any constraints on prop values (e.g., minimum/maximum values for lineClamp)

Example format:

- **children** (ReactNode, required): The text content to be displayed and potentially truncated.
- **lineClamp** (number, optional, default: 1): The number of lines to clamp the text to. Must be a positive integer.

Comment on lines 9 to 10
- **Purpose**: A typography component that truncates text with an ellipsis when it exceeds the available space, ensuring clean text overflow handling.
- **Expected Behavior**: The component displays text normally when it fits within its container. When text overflows, it truncates the content and adds an ellipsis (...) at the end. The full text remains accessible via tooltip on hover.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Documentation needs clarification about tooltip implementation

The documentation is misleading as it implies built-in tooltip functionality, but:

  • The props section only lists children and lineClamp, with no tooltip-related props
  • The example usage shows basic implementation without any tooltip configuration
  • The "Related Components" section suggests Tooltip is a separate component to be used in conjunction

Please update the documentation to:

  1. Remove the statement "The full text remains accessible via tooltip on hover" from Expected Behavior
  2. Add a usage example showing how to combine TypographyWithEllipsis with the Tooltip component
  3. Add a note explaining that tooltip functionality requires manual implementation using the separate Tooltip component
🔗 Analysis chain

Clarify tooltip implementation details

The documentation mentions tooltip functionality on hover, but it's unclear whether this is built into the component or needs to be implemented separately. Please specify:

  1. Is the tooltip functionality built into the component?
  2. If not, add an example showing how to implement it with the Tooltip component mentioned in the Related Components section.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if TypographyWithEllipsis has built-in tooltip implementation
ast-grep --pattern 'export const TypographyWithEllipsis = $$$' -f packages/design-system/components/typographies/TypographyWithEllipsis/TypographyWithEllipsis.tsx

Length of output: 342


Script:

#!/bin/bash
# Let's try to find and examine the TypographyWithEllipsis component implementation
fd "TypographyWithEllipsis.tsx" --type f --exec cat {}

Length of output: 56


Script:

#!/bin/bash
# Let's try a broader search to find any mentions of tooltip in relation to TypographyWithEllipsis
rg -i "tooltip" --type tsx --type ts --type mdx -C 3 -l | grep -i "typography"

# Also search for the component implementation files
fd -e tsx -e ts -e mdx "TypographyWithEllipsis"

Length of output: 263


Script:

#!/bin/bash
# Let's examine the content of the MDX file to see if there are any other mentions of tooltip implementation
cat packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx

# Also try to find the actual component implementation
find . -type f -name "TypographyWithEllipsis.*" -not -path "*/__storybook__/*" -exec cat {} \;

Length of output: 1842

Comment on lines 42 to 71
```javascript
import { useState } from 'react'

import { Button, Typography } from '@mui/material'

import { SwipeableDrawer } from '@baseapp-frontend/design-system'

const [open, setOpen] = useState(false)

const handleOpen = () => {
setOpen(true)
}

const handleClose = () => {
setOpen(false)
}

const MyComponent = () => {
return (
<>
<Button variant="outlined" onClick={handleOpen} style={{ width: '250px' }}>
Open Swipeable Drawer
</Button>
<SwipeableDrawer {...args} open={open} onClose={handleClose} onOpen={handleOpen}>
<Typography variant="body1" sx={{ p: 2 }}>
This is the content of the Swipeable Drawer. You can put any components or content here.
</Typography>
</SwipeableDrawer>
</>
)
}
export default MyComponent
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve example code with best practices.

The example code could be enhanced with error handling, accessibility, and proper props usage.

 ```javascript
 import { useState } from 'react'
 import { Button, Typography } from '@mui/material'
 import { SwipeableDrawer } from '@baseapp-frontend/design-system'

-const [open, setOpen] = useState(false)
-
-const handleOpen = () => {
-  setOpen(true)
-}
-
-const handleClose = () => {
-  setOpen(false)
-}
-
 const MyComponent = () => {
+  const [open, setOpen] = useState(false)
+
+  const handleOpen = (event) => {
+    event.preventDefault()
+    setOpen(true)
+  }
+
+  const handleClose = (event) => {
+    event.preventDefault()
+    setOpen(false)
+  }
+
   return (
     <>
-      <Button variant="outlined" onClick={handleOpen} style={{ width: '250px' }}>
+      <Button
+        variant="outlined"
+        onClick={handleOpen}
+        aria-controls="swipeable-drawer"
+        aria-expanded={open}
+        sx={{ width: '250px' }}
+      >
         Open Swipeable Drawer
       </Button>
-      <SwipeableDrawer {...args} open={open} onClose={handleClose} onOpen={handleOpen}>
-        <Typography variant="body1" sx={{ p: 2 }}>
+      <SwipeableDrawer
+        id="swipeable-drawer"
+        role="dialog"
+        aria-modal="true"
+        open={open}
+        onClose={handleClose}
+        onOpen={handleOpen}
+        globalHeight={window.innerHeight}
+      >
+        <Typography variant="body1" component="div" sx={{ p: 2 }}>
           This is the content of the Swipeable Drawer. You can put any components or content here.
         </Typography>
       </SwipeableDrawer>
     </>
   )
 }
+
 export default MyComponent

<!-- This is an auto-generated comment by CodeRabbit -->

- **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

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add accessibility guidelines section.

The documentation should include accessibility considerations to ensure proper implementation.

 - **globalHeight** (number): Global height of the drawer

+## Accessibility
+
+### ARIA Roles and Attributes
+- The drawer should have `role="dialog"` and `aria-modal="true"`
+- The trigger button should have `aria-controls` referencing the drawer's ID
+- The trigger button should have `aria-expanded` to indicate the drawer's state
+
+### Keyboard Navigation
+- ESC key should close the drawer
+- Focus should be trapped within the drawer when open
+- Focus should return to the trigger element when closed
+
 ## Notes
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **globalHeight** (number): Global height of the drawer
## Accessibility
### ARIA Roles and Attributes
- The drawer should have `role="dialog"` and `aria-modal="true"`
- The trigger button should have `aria-controls` referencing the drawer's ID
- The trigger button should have `aria-expanded` to indicate the drawer's state
### Keyboard Navigation
- ESC key should close the drawer
- Focus should be trapped within the drawer when open
- Focus should return to the trigger element when closed
## Notes

Comment on lines 27 to 30
- **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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance props documentation with additional details.

The props documentation should include more details to help developers implement the component correctly.

-- **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
+### Props
+
+| Name | Type | Required | Default | Description |
+|------|------|----------|---------|-------------|
+| open | boolean | Yes | - | Controls the open/closed state of the drawer |
+| onClose | (event: React.KeyboardEvent &#124; React.MouseEvent) => void | Yes | - | Callback fired when the drawer should close |
+| onOpen | (event: React.KeyboardEvent &#124; React.MouseEvent) => void | Yes | - | Callback fired when the drawer should open |
+| globalHeight | number | No | window.innerHeight | Global height of the drawer in pixels. Must be a positive number. |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **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
### Props
| Name | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| open | boolean | Yes | - | Controls the open/closed state of the drawer |
| onClose | (event: React.KeyboardEvent &#124; React.MouseEvent) => void | Yes | - | Callback fired when the drawer should close |
| onOpen | (event: React.KeyboardEvent &#124; React.MouseEvent) => void | Yes | - | Callback fired when the drawer should open |
| globalHeight | number | No | window.innerHeight | Global height of the drawer in pixels. Must be a positive number. |

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (1)
packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (1)

9-10: 🛠️ Refactor suggestion

Expand Expected Behavior section

The expected behavior section needs more detail about social media-specific functionality.

 - **Purpose**: The SocialTextField component extends the base TextField component to provide handling for social media interactions.
-**Expected Behavior**: It inherits responsive behavior from TextField.
+**Expected Behavior**: 
+  - Inherits responsive behavior from TextField
+  - Automatically handles @ mentions
+  - Supports reply threading
+  - Provides character limit indicators
+  - Shows typing indicators
+  - Handles emoji inputs

Additionally, please document the validation rules and @ symbol handling as mentioned in the previous review.

🧹 Nitpick comments (7)
packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (2)

9-10: Enhance component description with technical details and fix grammar.

The description should be more technically complete and grammatically correct.

 - **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.
+  - **Expected Behavior**: The drawer opens smoothly with swipe gestures or programmatic control. It provides haptic feedback and smooth animations. It can be dismissed via swipe, backdrop click, or programmatic close. The component maintains proper touch interaction zones and respects system gestures. It supports both left-to-right (LTR) and right-to-left (RTL) layouts.
🧰 Tools
🪛 LanguageTool

[style] ~10-~10: To form a complete sentence, be sure to include a subject.
Context: ... haptic feedback and smooth animations. Can be dismissed via swipe, backdrop click,...

(MISSING_IT_THERE)


34-38: Clarify component relationships and usage guidelines.

Add guidance on when to use each related component to help developers make informed decisions.

 - **Related Components**:
-  - Drawer: Standard non-swipeable drawer variant
-  - Modal: For modal dialogs
-  - Paper: Used as the surface component
-  - Backdrop: For the overlay effect
+  - **Drawer**: Standard non-swipeable drawer variant. Use this when touch/swipe interactions are not required or for desktop-only interfaces.
+  - **Modal**: For modal dialogs. Prefer this when the content requires immediate attention and should block interactions with the main content.
+  - **Paper**: Used as the surface component. This component provides the visual foundation and elevation effects.
+  - **Backdrop**: For the overlay effect. Controls the dimming of the background content and handles click-away interactions.
+
+Choose SwipeableDrawer over standard Drawer when:
+  - Building mobile-first interfaces
+  - Touch/swipe interactions are essential
+  - The content is supplementary and should be easily dismissible
packages/design-system/components/inputs/TextField/__storybook__/TextField.mdx (3)

10-10: Fix grammatical error in Expected Behavior

Change "users input" to "user's input" to correct the possessive form.

-**Expected Behavior**: The TextField responds to users input, displaying the values typed by the user.
+**Expected Behavior**: The TextField responds to user's input, displaying the values typed by the user.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~10-~10: It looks like there might be a possessive apostrophe missing. Consider inserting it.
Context: ...d Behavior**: The TextField responds to users input, displaying the values typed by t...

(AI_EN_LECTOR_MISSING_NOUN_POSSESSIVE)


25-34: Document additional common input field props

Consider documenting these additional common props:

  • error (boolean): Error state of the input
  • helperText (string): Helper text below the input
  • required (boolean): If the field is required
  • maxLength (number): Maximum input length
  • inputProps (object): Props applied to the input element

43-61: Enhance example with proper TypeScript syntax and error handling

The example could be improved to better demonstrate the component's capabilities.

 const MyComponent = () => {
-  const [value, setValue] = useState < string > ''
+  const [value, setValue] = useState<string>('')
+  const [error, setError] = useState<boolean>(false)
+  const [helperText, setHelperText] = useState<string>('')
+
+  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
+    const newValue = e.target.value
+    setValue(newValue)
+    
+    // Example validation
+    if (newValue.length < 3) {
+      setError(true)
+      setHelperText('Input must be at least 3 characters')
+    } else {
+      setError(false)
+      setHelperText('')
+    }
+  }

   return (
     <TextField
       label="Default Label"
       placeholder="Type something..."
       value={value}
-      onChange={(e) => setValue(e.target.value)}
+      onChange={handleChange}
+      error={error}
+      helperText={helperText}
+      required
     />
   )
 }
packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (1)

25-34: Add TypeScript type definitions for callback functions

Please enhance the props documentation with proper TypeScript types:

 ## Props
 
 - **value** (string): The controlled value of the input field.
 - **placeholder** (string): Placeholder text displayed when the input is empty.
-**onChange** (function): Callback fired when the input value changes.
+**onChange** (function): `(event: React.ChangeEvent<HTMLInputElement>) => void`: Callback fired when the input value changes.
 - **isReply** (boolean): If true, the input will be a reply input.
 - **replyTargetName** (string): The name of the user being replied to.
 - **helperText** (string): Helper text displayed below the input field.
 - **isResponsive** (boolean): If true, the input will be responsive.
-**onCancelReply** (function): Callback fired when the reply is canceled.
+**onCancelReply** (function): `() => void`: Callback fired when the reply is canceled.
packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (1)

38-51: Add more comprehensive usage examples

Please enhance the example section with:

  1. Integration with Tooltip component for full text display
  2. Multiple line clamp scenarios
  3. Real-world example with container width constraints

Example:

import { TypographyWithEllipsis, Tooltip, Box } from '@baseapp-frontend/design-system'

const MyComponent = () => {
  return (
    <>
      {/* Basic usage */}
      <TypographyWithEllipsis lineClamp={2}>
        This is a long text that will be truncated.
      </TypographyWithEllipsis>

      {/* With tooltip */}
      <Box width={200}>
        <Tooltip title="This is the full text that appears in the tooltip">
          <TypographyWithEllipsis>
            This is the full text that appears in the tooltip
          </TypographyWithEllipsis>
        </Tooltip>
      </Box>
    </>
  )
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a4c59d8 and 688f6eb.

📒 Files selected for processing (5)
  • packages/design-system/components/Logo/__storybook__/Logo.mdx (1 hunks)
  • packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (1 hunks)
  • packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (1 hunks)
  • packages/design-system/components/inputs/TextField/__storybook__/TextField.mdx (1 hunks)
  • packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/design-system/components/Logo/storybook/Logo.mdx
🧰 Additional context used
🪛 LanguageTool
packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx

[style] ~10-~10: To form a complete sentence, be sure to include a subject.
Context: ... haptic feedback and smooth animations. Can be dismissed via swipe, backdrop click,...

(MISSING_IT_THERE)

packages/design-system/components/inputs/TextField/__storybook__/TextField.mdx

[uncategorized] ~10-~10: It looks like there might be a possessive apostrophe missing. Consider inserting it.
Context: ...d Behavior**: The TextField responds to users input, displaying the values typed by t...

(AI_EN_LECTOR_MISSING_NOUN_POSSESSIVE)

🔇 Additional comments (8)
packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (2)

27-30: Enhance props documentation with additional details.

The props documentation needs to be more detailed and structured.


42-72: Improve example code with best practices.

The example code needs improvements in error handling, accessibility, and proper props usage.

packages/design-system/components/inputs/TextField/__storybook__/TextField.mdx (3)

1-3: LGTM!

The Meta configuration and title structure follow the design system conventions.


9-10: Document validation states

The documentation should include details about validation states.

Please add:

  1. Available validation states (error, warning, success)
  2. How to trigger each state
  3. Visual indicators for each state
  4. Associated props for validation handling
🧰 Tools
🪛 LanguageTool

[uncategorized] ~10-~10: It looks like there might be a possessive apostrophe missing. Consider inserting it.
Context: ...d Behavior**: The TextField responds to users input, displaying the values typed by t...

(AI_EN_LECTOR_MISSING_NOUN_POSSESSIVE)


12-24: LGTM!

Comprehensive coverage of both current and potential use cases.

packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (3)

1-8: LGTM!

The Meta configuration and title structure follow the correct format for the design system documentation.


12-24: LGTM!

The use cases section provides comprehensive coverage of both current and potential usage scenarios, offering valuable guidance for developers.


27-28: Enhance props documentation with additional details

The props documentation needs enhancement:

  1. Mark required/optional status for the children prop
  2. Add constraints for the lineClamp prop (e.g., must be positive integer)
  3. Include detailed type information

Example format:

- **children** (ReactNode, required): The text content to be displayed and potentially truncated.
- **lineClamp** (number, optional, default: 1): The number of lines to clamp the text to. Must be a positive integer.

<Button variant="outlined" onClick={handleOpen} style={{ width: '250px' }}>
Open Swipeable Drawer
</Button>
<SwipeableDrawer {...args} open={open} onClose={handleClose} onOpen={handleOpen}>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove spread operator with unknown args.

Using the spread operator with unknown args ({...args}) can lead to security vulnerabilities and unexpected behavior.

-      <SwipeableDrawer {...args} open={open} onClose={handleClose} onOpen={handleOpen}>
+      <SwipeableDrawer
+        open={open}
+        onClose={handleClose}
+        onOpen={handleOpen}
+        anchor="left"
+      >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<SwipeableDrawer {...args} open={open} onClose={handleClose} onOpen={handleOpen}>
<SwipeableDrawer
open={open}
onClose={handleClose}
onOpen={handleOpen}
anchor="left"
>

Comment on lines 36 to 38
## Notes

- **Related Components**:
- TextField: Base component that SocialTextField extends
- FormControl: Parent component for form organization
- FormHelperText: For validation messages

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add accessibility documentation

Please add an Accessibility section to document:

  • ARIA labels and roles
  • Keyboard navigation
  • Screen reader considerations
  • Color contrast requirements

Comment on lines 43 to 66
## 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
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add examples demonstrating social media features

The example should showcase social media specific functionality.

 const MyComponent = () => {
-  const [value, setValue] = useState < string > ''
+  const [value, setValue] = useState<string>('')
+  const [mentions, setMentions] = useState<string[]>([])
+
+  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
+    setValue(e.target.value)
+    // Extract mentions
+    const newMentions = e.target.value.match(/@[\w]+/g) || []
+    setMentions(newMentions)
+  }
+
+  const handleCancelReply = () => {
+    setValue('')
+    setMentions([])
+  }

   return (
     <SocialTextField
       label="Default Label"
-      placeholder="Type something..."
+      placeholder="Type @ to mention someone..."
       value={value}
-      onChange={(e) => setValue(e.target.value)}
+      onChange={handleChange}
       isReply={true}
       replyTargetName="John Doe"
-      helperText="This is a helper text"
+      helperText={`Mentioned users: ${mentions.join(', ')}`}
       isResponsive={true}
-      onCancelReply={() => {}}
+      onCancelReply={handleCancelReply}
     />
   )
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## 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
```
## Example Usage

Comment on lines 9 to 10
- **Purpose**: A typography component that truncates text with an ellipsis when it exceeds the available space, ensuring clean text overflow handling.
- **Expected Behavior**: The component displays text normally when it fits within its container. When text overflows, it truncates the content and adds an ellipsis (...) at the end.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Documentation should clarify that tooltip functionality needs to be implemented separately

The component implementation shows that it only handles text truncation with ellipsis. The tooltip functionality mentioned in the documentation needs to be implemented separately by wrapping this component with MUI's Tooltip component.

  • The component only implements:
    • Single line truncation with ellipsis (default)
    • Multi-line truncation with lineClamp prop
  • No built-in tooltip functionality exists in the implementation
🔗 Analysis chain

Verify tooltip functionality implementation

The documentation should clarify whether the tooltip functionality is:

  1. Built into the component
  2. Needs to be implemented separately using the Tooltip component

Let's verify the component implementation:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check the TypographyWithEllipsis implementation for tooltip functionality
ast-grep --pattern 'export const TypographyWithEllipsis = $$$' -f packages/design-system/components/typographies/TypographyWithEllipsis/TypographyWithEllipsis.tsx

# Search for tooltip-related imports or usage
rg -i "tooltip" --type tsx -C 3 packages/design-system/components/typographies/TypographyWithEllipsis/TypographyWithEllipsis.tsx

Length of output: 499


Script:

#!/bin/bash
# Check the TypographyWithEllipsis implementation
ast-grep --pattern 'export const TypographyWithEllipsis = $$$'

# Search for tooltip-related imports or usage
rg -i "tooltip" -C 3

Length of output: 23523


Script:

#!/bin/bash
# Check the TypographyWithEllipsis implementation
rg -t ts -t tsx -C 5 "TypographyWithEllipsis" packages/design-system/components/typographies/TypographyWithEllipsis/TypographyWithEllipsis.tsx

Length of output: 170


Script:

#!/bin/bash
# Check the TypographyWithEllipsis implementation
rg -C 5 "TypographyWithEllipsis" packages/design-system/components/typographies/TypographyWithEllipsis/TypographyWithEllipsis.tsx

# Also check for any tooltip usage in the component
rg -C 3 "Tooltip" packages/design-system/components/typographies/TypographyWithEllipsis/TypographyWithEllipsis.tsx

Length of output: 518


Script:

#!/bin/bash
# Find the TypographyWithEllipsis component file
fd TypographyWithEllipsis.tsx

# Find any files related to TypographyWithEllipsis
rg -l "TypographyWithEllipsis"

Length of output: 651


Script:

#!/bin/bash
# Check the implementation in the main component file
rg -C 5 "export" packages/design-system/components/typographies/TypographyWithEllipsis/index.tsx

# Check for any Tooltip imports or usage
rg -C 3 "Tooltip" packages/design-system/components/typographies/TypographyWithEllipsis/index.tsx

# Check the types file
cat packages/design-system/components/typographies/TypographyWithEllipsis/types.ts

Length of output: 513


Script:

#!/bin/bash
# Check the full implementation of the component
cat packages/design-system/components/typographies/TypographyWithEllipsis/index.tsx

# Check the stories file for any tooltip usage examples
cat packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/stories.tsx

Length of output: 1650

@deboracosilveira
Copy link
Collaborator

please review your use cases and notes to have there specific info about the package and not so generic info, like i've commented on the other comments

@deboracosilveira
Copy link
Collaborator

plase update the title of all mdx. They all include "@baseapp-frontend-template" which is wrong, since we are talking about the packages. Besides that, the idea is that document pages live close to the referring component, like on the image.
image
To do so, use the same name of the stories, eg @baseapp-frontend | designSystem/Avatars/AvatarWithPlaceholder

- Application header/navbar
- Login/signup pages
- Marketing materials
- Footer branding
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont use it on footer. For writing down this section, check where the component is used inside the packages. If it's not used anywhere, just write where it could be used

- Header: Often contains the Logo component
- Navbar: May include Logo as part of navigation
- Footer: May display Logo as part of branding
- BrandingElements: Other brand-related components
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont use it on footer or BrandingElements..only write real components that are in fact related, otherwise omit the section

- **Related Components**:
- Menu: Uses Popover internally for dropdown menus
- Tooltip: Similar positioning logic but for simpler hover interactions
- Modal: For larger overlay content that should be more prominent
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same about Logo, search over our code to see where component is used and not a generic usage. Right now inside the pakcages i think the only place it's used is on AccountPopover. Check use cases and notes

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

🧹 Nitpick comments (5)
packages/design-system/components/Logo/__storybook__/Logo.mdx (1)

19-22: Enhance props documentation with accessibility attributes

The props documentation should include accessibility-related attributes that can be passed to the root Box component.

Add the following 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
+- **aria-label** (string): Accessible label for the logo when used as a link
+- **role** (string): ARIA role attribute for accessibility
packages/design-system/components/avatars/__storybook__/AvatarsComponents.mdx (1)

31-34: Enhance props documentation with detailed type information

The props sections for both components should be enhanced with a table format that includes type information, required status, and default values.

Example format for AvatarWithPlaceholder:

| Name | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| width | number | No | 36 | Width of the avatar in pixels |
| height | number | No | 36 | Height of the avatar in pixels |
| children | ReactNode | No | - | Content to be displayed within the avatar |
| className | string | No | - | Additional CSS class name |

Also applies to: 81-85

packages/design-system/components/inputs/__storybook__/Inputs.mdx (3)

53-53: Fix TypeScript generic syntax in examples.

Remove spaces around angle brackets in useState generic type declarations.

-const [value, setValue] = useState < string > ''
+const [value, setValue] = useState<string>('')

Also applies to: 116-116, 174-174


31-39: Add type information to props documentation.

Consider adding more detailed type information for the props. For example:

  • Specify the exact function signature for callbacks (onChange, onCancelReply)
  • Add default values where applicable

1-188: Consider adding these improvements to enhance the documentation:

  1. Add a "Composition" section for each component showing how it relates to other components in the design system
  2. Include accessibility considerations and ARIA attributes usage
  3. Add links to related components' documentation
  4. Include a "Variants" section showing different configurations
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 688f6eb and fb8db6c.

📒 Files selected for processing (8)
  • packages/design-system/components/Logo/__storybook__/Logo.mdx (1 hunks)
  • packages/design-system/components/Popover/__storybook__/Popover.mdx (1 hunks)
  • packages/design-system/components/avatars/__storybook__/AvatarsComponents.mdx (1 hunks)
  • packages/design-system/components/buttons/IconButton/__storybook__/IconButton.mdx (1 hunks)
  • packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx (1 hunks)
  • packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (1 hunks)
  • packages/design-system/components/inputs/__storybook__/Inputs.mdx (1 hunks)
  • packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/design-system/components/dialogs/ConfirmDialog/storybook/ConfirmDialog.mdx
🧰 Additional context used
🪛 LanguageTool
packages/design-system/components/avatars/__storybook__/AvatarsComponents.mdx

[style] ~64-~64: To form a complete sentence, be sure to include a subject.
Context: ...isual feedback for hover/active states. Can be configured with different sizes and ...

(MISSING_IT_THERE)

packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx

[style] ~10-~10: To form a complete sentence, be sure to include a subject.
Context: ... haptic feedback and smooth animations. Can be dismissed via swipe, backdrop click,...

(MISSING_IT_THERE)

🔇 Additional comments (5)
packages/design-system/components/Popover/__storybook__/Popover.mdx (1)

3-3: 🛠️ Refactor suggestion

Update the title format

The title should not include "@baseapp-frontend". Please update it to match the correct format:

-<Meta title="@baseapp-frontend / DesignSystem/Popover" />
+<Meta title="Design System/General/Popover" />

Likely invalid or redundant comment.

packages/design-system/components/buttons/IconButton/__storybook__/IconButton.mdx (1)

28-34: 🛠️ Refactor suggestion

Enhance props documentation with missing details

The props section is missing some properties that are shown in the example code, and existing props need more detailed type information.

-## 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.
+## Props
+
+| Name | Type | Required | Default | Description |
+|------|------|----------|---------|-------------|
+| children | ReactNode | Yes | - | The icon element to be displayed inside the button |
+| color | "primary" \| "secondary" \| "error" \| "warning" \| "info" \| "success" | No | "primary" | The color of the button |
+| disabled | boolean | No | false | If true, the button will be disabled |
+| isLoading | boolean | No | false | If true, the button will be in a loading state |
+| onClick | (event: React.MouseEvent) => void | Yes | - | The function to be called when the button is clicked |
+| hasTooltip | boolean | No | false | If true, the button will have a tooltip |
+| tooltipText | string | Yes (if hasTooltip=true) | - | The text to display in the tooltip |

Likely invalid or redundant comment.

packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (2)

27-30: Enhance props documentation with additional details

The props documentation needs to be more comprehensive and include all available props from MUI's SwipeableDrawer.


64-64: Remove spread operator with unknown args

Using the spread operator with unknown args can lead to security vulnerabilities and unexpected behavior.

packages/design-system/components/inputs/__storybook__/Inputs.mdx (1)

132-188: Well-documented component!

The TextareaField documentation is comprehensive and includes all necessary information, good examples, and clear use cases.

@@ -0,0 +1,45 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="@baseapp-frontend / DesignSystem/General" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update the title format

The title should not include "@baseapp-frontend-template". Please update it to match the correct format:

-<Meta title="@baseapp-frontend / DesignSystem/General" />
+<Meta title="Design System/General/Logo" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Meta title="@baseapp-frontend / DesignSystem/General" />
<Meta title="Design System/General/Logo" />

Comment on lines +40 to +45
```javascript
import { TypographyWithEllipsis } from '@baseapp-frontend/design-system'

const MyComponent = () => {
return (
<TypographyWithEllipsis lineClamp={2}>
This is a long text that should be truncated with an ellipsis.
</TypographyWithEllipsis>
)
}
export default MyComponent
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add example with tooltip integration

The example should demonstrate how to combine TypographyWithEllipsis with Tooltip for the full text display on hover.

 ```javascript
 import { TypographyWithEllipsis } from '@baseapp-frontend/design-system'
+import { Tooltip } from '@mui/material'
 
 const MyComponent = () => {
+  const text = 'This is a long text that should be truncated with an ellipsis.'
   return (
-    <TypographyWithEllipsis lineClamp={2}>
-      This is a long text that should be truncated with an ellipsis.
-    </TypographyWithEllipsis>
+    <Tooltip title={text}>
+      <TypographyWithEllipsis lineClamp={2}>
+        {text}
+      </TypographyWithEllipsis>
+    </Tooltip>
   )
 }
 export default MyComponent

<!-- This is an auto-generated comment by CodeRabbit -->

@@ -0,0 +1,51 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="@baseapp-frontend / DesignSystem/Typographies" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update the title format

The title should not include "@baseapp-frontend". Please update it to match the correct format:

-<Meta title="@baseapp-frontend / DesignSystem/Typographies" />
+<Meta title="Design System/Typographies/TypographyWithEllipsis" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Meta title="@baseapp-frontend / DesignSystem/Typographies" />
<Meta title="Design System/Typographies/TypographyWithEllipsis" />

Comment on lines +33 to +54
```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
```
Copy link

Choose a reason for hiding this comment

The 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

<!-- This is an auto-generated comment by CodeRabbit -->

Comment on lines +19 to +24
- **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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Enhance props documentation

The open prop type is incorrectly documented. It should be a boolean, while the anchor element is passed separately.

-**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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **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
- **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

@@ -0,0 +1,115 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="@baseapp-frontend / DesignSystem / Avatars" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update the documentation title format

Per the PR comments, remove "@baseapp-frontend" from the title as it's incorrect for package documentation.

-<Meta title="@baseapp-frontend / DesignSystem / Avatars" />
+<Meta title="DesignSystem/Avatars/Overview" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Meta title="@baseapp-frontend / DesignSystem / Avatars" />
<Meta title="DesignSystem/Avatars/Overview" />

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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove hardcoded production URL

The example contains a hardcoded production URL which should be replaced with a placeholder or local asset.

-        src="https://nyc3.digitaloceanspaces.com/baseapp-production-storage/media/user-avatars/5/6/4/resized/50/50/185a04dfdaa512d218cf9b7a5097e3c9.png"
+        src="/placeholder-avatar.png"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
src="https://nyc3.digitaloceanspaces.com/baseapp-production-storage/media/user-avatars/5/6/4/resized/50/50/185a04dfdaa512d218cf9b7a5097e3c9.png"
src="/placeholder-avatar.png"

Comment on lines 18 to 28
- **Current Usage**:
- Comments
- Chat
- Social media profile forms
- Messages
- Replies
- **Potential Usage**:
- Social media integration features
- Social sharing components
- Contact management systems

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Make use cases more specific to the package context.

As per review feedback, the use cases should contain details pertinent to this specific package rather than generic information. Consider adding concrete examples from the actual implementation.

Comment on lines 94 to 102
- **value** (string): The controlled value of the input field.
- **onChange** (function): Callback fired when the input value changes.
- **label** (string): Text label that appears above the input field.
- **disabled** (boolean): If true, the input will be disabled.
- **placeholder** (string): Placeholder text displayed when the input is empty.
- **type** (string): Type of input field (text, password, email, etc.).
- **fullWidth** (boolean): If true, the input will take up the full width of its container.
- **isResponsive** (boolean): If true, the input will be responsive.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Document all available props consistently.

The props section is missing some props that are shown in the example code. Ensure all available props are documented, including:

  • error prop for error states
  • helperText prop for validation messages
  • Other MUI TextField props that are supported

Comment on lines 1 to 3
import { Meta } from '@storybook/addon-docs'

<Meta title="@baseapp-frontend / DesignSystem / Inputs" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update the title format as per review feedback.

The title should match the format: @baseapp-frontend | designSystem/[Component]. Please update it to follow this convention.

-<Meta title="@baseapp-frontend / DesignSystem / Inputs" />
+<Meta title="@baseapp-frontend | designSystem/Inputs" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { Meta } from '@storybook/addon-docs'
<Meta title="@baseapp-frontend / DesignSystem / Inputs" />
import { Meta } from '@storybook/addon-docs'
<Meta title="@baseapp-frontend | designSystem/Inputs" />

@joaosoutto joaosoutto requested a review from sundayguru January 7, 2025 13:50
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🧹 Nitpick comments (12)
packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx (2)

25-33: Enhance props documentation with additional details

Consider adding more information about props:

  • Indicate which props are required vs optional
  • Document default values for all optional props (currently only done for cancelText)
  • Add type information in a consistent format

Example format:

- **open** (boolean, required): Controls the visibility of the dialog
- **title** (string, required): The heading text displayed at the top of the dialog
- **content** (ReactNode, required): The main message or content displayed in the dialog body
- **cancelText** (string, optional, default: "Cancel"): Custom text for the cancel button
- **onClose** (function, required): Callback function executed when the cancel button is clicked
- **action** (ReactNode, required): The action button to be displayed in the dialog

42-78: Consider enhancing the example with TypeScript

The example is comprehensive but could benefit from TypeScript types for better documentation and developer experience.

Example with TypeScript:

 ```typescript
 import { ConfirmDialog } from '@baseapp-frontend/design-system'
 import { Button } from '@baseapp-frontend/design-system'
+import { FC, useState } from 'react'
 
-const MyComponent = () => {
+const MyComponent: FC = () => {
   const [open, setOpen] = useState(false)
 
-  const handleClickOpen = () => {
+  const handleClickOpen = (): void => {
     setOpen(true)
   }
 
-  const handleClose = () => {
+  const handleClose = (): void => {
     setOpen(false)
   }
 
-  const handleConfirm = () => {
+  const handleConfirm = (): void => {
     alert('Confirmed')
     handleClose()
   }
packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (1)

26-30: Expand the Notes section

Please add implementation details and best practices:

  • Performance considerations
  • Accessibility implications
  • Browser compatibility notes
  • Common pitfalls to avoid
packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx (2)

25-28: Enhance props documentation

The props section should include:

  1. Type information for inherited TextField props
  2. Default values
  3. Whether props are required or optional

42-56: Fix TypeScript syntax and improve example

The example code has formatting issues and could be more comprehensive:

-  const [value, setValue] = useState < string > ''
+  const [value, setValue] = useState<string>('')

   return (
     <TextareaField
       label="Default Label"
       placeholder="Type something..."
       value={value}
       onChange={(e) => setValue(e.target.value)}
-      multiline={true}  // Remove as it's hardcoded
-      maxRows={3}       // Remove as it's hardcoded
+      required={true}   // Add example of inherited TextField prop
+      helperText="Helper text example"  // Add example of inherited TextField prop
     />
   )
packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (1)

25-29: Enhance props documentation

The props section should include:

  1. Type information for each prop
  2. Whether props are required or optional
  3. Default values
  4. Examples of valid values
packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx (2)

25-30: Enhance props documentation with type information

Please add:

  • Type information for the spread props (AvatarProps)
  • Indication of which props are required vs optional
  • Validation rules or constraints for each prop
🧰 Tools
🪛 LanguageTool

[uncategorized] ~27-~27: A determiner appears to be missing. Consider inserting it.
Context: ...number): Width of the avatar in pixels. Default is 36. - height (number): Height of...

(AI_EN_LECTOR_MISSING_DETERMINER)


[uncategorized] ~28-~28: A determiner appears to be missing. Consider inserting it.
Context: ...umber): Height of the avatar in pixels. Default is 36. - children (ReactNode): Cont...

(AI_EN_LECTOR_MISSING_DETERMINER)


40-53: Add more comprehensive usage examples

Consider adding examples for:

  • Usage with an image
  • Placeholder fallback scenario
  • Custom sizing and styling
  • Integration with related components (Badge, AvatarGroup)
packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx (2)

19-27: Enhance props documentation with detailed descriptions

Please add:

  • Callback signature for onClick (parameters and return type)
  • Detailed description of how isOpen affects the component's behavior
  • Type information for the spread props

8-9: Add detailed animation documentation

Please document:

  • Available animation configurations
  • How to customize animation timing and behavior
  • How to disable animations if needed
🧰 Tools
🪛 LanguageTool

[grammar] ~8-~8: Possible subject-verb agreement error.
Context: ...onent that adds click interactivity and hover animations using Framer Motion. Built o...

(IS_AND_ARE)

packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (2)

41-46: Organize imports following best practices

Group and sort imports by type (React, external libraries, internal packages).

-import { useState } from 'react'
-
-import { SwipeableDrawer } from '@baseapp-frontend/design-system'
-
-import { Button, Typography } from '@mui/material'
+// React
+import { useState } from 'react'
+
+// External Libraries
+import { Button, Typography } from '@mui/material'
+
+// Internal Packages
+import { SwipeableDrawer } from '@baseapp-frontend/design-system'

47-69: Add error handling and loading state examples

The example should demonstrate proper error handling and loading states.

 const MyComponent = () => {
   const [open, setOpen] = useState(false)
+  const [isLoading, setIsLoading] = useState(false)
+  const [error, setError] = useState(null)
 
-  const handleOpen = () => {
-    setOpen(true)
+  const handleOpen = async () => {
+    try {
+      setIsLoading(true)
+      // Async operations if needed
+      setOpen(true)
+    } catch (err) {
+      setError(err.message)
+    } finally {
+      setIsLoading(false)
+    }
   }
 
   const handleClose = () => {
     setOpen(false)
+    setError(null)
   }
 
   return (
     <>
       <Button
         variant="outlined"
         onClick={handleOpen}
+        disabled={isLoading}
         style={{ width: '250px' }}
       >
-        Open Swipeable Drawer
+        {isLoading ? 'Loading...' : 'Open Swipeable Drawer'}
       </Button>
+      {error && (
+        <Typography color="error" sx={{ mt: 1 }}>
+          {error}
+        </Typography>
+      )}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb8db6c and 50f5e8d.

📒 Files selected for processing (11)
  • packages/design-system/components/Logo/__storybook__/Logo.mdx (1 hunks)
  • packages/design-system/components/Popover/__storybook__/Popover.mdx (1 hunks)
  • packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx (1 hunks)
  • packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx (1 hunks)
  • packages/design-system/components/buttons/IconButton/__storybook__/IconButton.mdx (1 hunks)
  • packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx (1 hunks)
  • packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (1 hunks)
  • packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (1 hunks)
  • packages/design-system/components/inputs/TextField/__storybook__/TextField.mdx (1 hunks)
  • packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx (1 hunks)
  • packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/design-system/components/inputs/TextField/storybook/TextField.mdx
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/design-system/components/buttons/IconButton/storybook/IconButton.mdx
  • packages/design-system/components/Popover/storybook/Popover.mdx
  • packages/design-system/components/Logo/storybook/Logo.mdx
🧰 Additional context used
🪛 LanguageTool
packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx

[grammar] ~36-~36: A word such as an article or a possessive pronoun before ‘reply’ seems to be missing.
Context: ...graphy/TypographyWithEllipsis: Used for reply text display - CommentReplyIcon/Close...

(FOR_REPLY)

packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx

[uncategorized] ~9-~9: Possible missing comma found.
Context: ...er. Disables swipe-to-open functionality but maintains swipe-to-close. ## Use Cases...

(AI_HYDRA_LEO_MISSING_COMMA)

packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx

[uncategorized] ~27-~27: A determiner appears to be missing. Consider inserting it.
Context: ...number): Width of the avatar in pixels. Default is 36. - height (number): Height of...

(AI_EN_LECTOR_MISSING_DETERMINER)


[uncategorized] ~28-~28: A determiner appears to be missing. Consider inserting it.
Context: ...umber): Height of the avatar in pixels. Default is 36. - children (ReactNode): Cont...

(AI_EN_LECTOR_MISSING_DETERMINER)

packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx

[grammar] ~34-~34: Possible typo detected: Did you mean to write ‘from’ instead of ‘form’?
Context: ...ality - withController: HOC that adds form control capabilities - Textarea: Styl...

(TYPO_FORM_FROM)

packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx

[grammar] ~8-~8: Possible subject-verb agreement error.
Context: ...onent that adds click interactivity and hover animations using Framer Motion. Built o...

(IS_AND_ARE)

packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx

[uncategorized] ~10-~10: Did you mean: “By default,”?
Context: ...Renders text with a max width of 300px. By default shows single line with ellipsis, but ca...

(BY_DEFAULT_COMMA)


[uncategorized] ~10-~10: Possible missing article found.
Context: ... a max width of 300px. By default shows single line with ellipsis, but can display mul...

(AI_HYDRA_LEO_MISSING_A)

🔇 Additional comments (13)
packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx (3)

5-10: Well-structured component overview!

The purpose and expected behavior are clearly defined with specific details about the component's functionality.


12-24: Comprehensive use cases with practical examples!

Good separation between current and potential usage scenarios, providing specific examples that help developers understand the component's applications.


34-41: Clear and relevant related components section!

Good job providing context about related components and their relationships to ConfirmDialog.

packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (3)

3-3: Update the title format

The title should follow the correct format without "@baseapp-frontend".

-<Meta title="@baseapp-frontend | designSystem/Typographies/TypographyWithEllipsis" />
+<Meta title="Design System/Typographies/TypographyWithEllipsis" />

22-24: Enhance props documentation

Please enhance the props documentation by adding:

  1. Default values for props (especially lineClamp)
  2. Whether props are required or optional
  3. Any constraints on prop values

Example format:

- **children** (ReactNode, required): The text content to be displayed and potentially truncated.
- **lineClamp** (number, optional, default: 1): The number of lines to clamp the text to. Must be a positive integer.
- **maxWidth** (number, optional, default: 300): The maximum width in pixels for the container.

34-45: Add example with tooltip integration

Please add an example demonstrating tooltip integration for full text display on hover.

 ```javascript
 import { TypographyWithEllipsis } from '@baseapp-frontend/design-system'
+import { Tooltip } from '@mui/material'
 
 const MyComponent = () => {
+  const text = 'This is a long text that should be truncated with an ellipsis.'
   return (
-    <TypographyWithEllipsis lineClamp={2}>
-      This is a long text that should be truncated with an ellipsis.
-    </TypographyWithEllipsis>
+    <Tooltip title={text}>
+      <TypographyWithEllipsis lineClamp={2}>
+        {text}
+      </TypographyWithEllipsis>
+    </Tooltip>
   )
 }
 export default MyComponent

</details>
<details>
<summary>packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (3)</summary>

`9-11`: **Document validation rules and @ symbol handling**

The documentation should specify:
1. How @ mentions are handled
2. Character limits
3. Input validation rules

---

`31-38`: **Add accessibility documentation**

Please add an Accessibility section documenting:
- ARIA labels and roles
- Keyboard navigation
- Screen reader considerations
- Color contrast requirements

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 LanguageTool</summary>

[grammar] ~36-~36: A word such as an article or a possessive pronoun before ‘reply’ seems to be missing.
Context: ...graphy/TypographyWithEllipsis: Used for reply text display   - CommentReplyIcon/Close...

(FOR_REPLY)

</details>

</details>

---

`44-58`: **Improve example code to demonstrate social features**

The example should showcase social media specific functionality:

```diff
-  const [value, setValue] = useState < string > ''
+  const [value, setValue] = useState<string>('')
+  const [mentions, setMentions] = useState<string[]>([])
+
+  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
+    setValue(e.target.value)
+    // Extract mentions
+    const newMentions = e.target.value.match(/@[\w]+/g) || []
+    setMentions(newMentions)
+  }
+
+  const handleCancelReply = () => {
+    setValue('')
+    setMentions([])
+  }

   return (
     <SocialTextField
       label="Default Label"
-      placeholder="Type something..."
+      placeholder="Type @ to mention someone..."
       value={value}
-      onChange={(e) => setValue(e.target.value)}
+      onChange={handleChange}
       isReply={true}
       replyTargetName="John Doe"
-      helperText="This is a helper text"
+      helperText={`Mentioned users: ${mentions.join(', ')}`}
-      onCancelReply={() => {}}
+      onCancelReply={handleCancelReply}
     >
+      {/* Add example of children prop usage */}
+      <Button onClick={() => console.log('Post comment')}>
+        Post
+      </Button>
     </SocialTextField>
   )
packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx (1)

9-10: Enhance placeholder behavior documentation

The documentation should specify:

  • What the default placeholder looks like
  • How the placeholder is generated (e.g., initials from text)
  • Customization options for the placeholder
packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx (1)

44-50: Replace hardcoded image URL with a placeholder

The example uses a hardcoded DigitalOcean Spaces URL which may not be accessible and could become invalid.

packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (2)

3-3: Update documentation title format per requirements

The title format needs to be updated as "@baseapp-frontend" should not be included in package documentation.

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

21-23: ⚠️ Potential issue

Fix incorrect prop type and add validation details

The globalHeight prop type is documented as string but the example uses a number. Also, add validation requirements for the props.

-- **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
+### Props
+
+| Name | Type | Required | Validation | Default |
+|------|------|----------|------------|---------|
+| children | ReactNode | Yes | Valid React node | - |
+| globalHeight | number | No | Positive number | calc(25% - SWIPE_AREA_WIDTH) |
+| ...MUISwipeableDrawerProps | SwipeableDrawerProps | No | See MUI documentation | - |

Likely invalid or redundant comment.

Comment on lines +1 to +3
import { Meta } from '@storybook/addon-docs'

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { Meta } from '@storybook/addon-docs'
<Meta title="@baseapp-frontend | designSystem/Dialogs/ConfirmDialog" />
import { Meta } from '@storybook/addon-docs'
<Meta title="designSystem/Dialogs/ConfirmDialog" />

Comment on lines +9 to +10
- **Purpose**: A styled Typography component that handles text overflow with ellipsis, with optional multi-line clamping support.
- **Expected Behavior**: Renders text with a max width of 300px. By default shows single line with ellipsis, but can display multiple lines when lineClamp prop is provided.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve clarity in Expected Behavior section

  1. Fix grammatical issues:
-- **Expected Behavior**: Renders text with a max width of 300px. By default shows single line with ellipsis, but can display multiple lines when lineClamp prop is provided.
+- **Expected Behavior**: Renders text with a max width of 300px. By default, it shows a single line with ellipsis, but can display multiple lines when the lineClamp prop is provided.
  1. Add a note about tooltip functionality:
+Note: For displaying the full text on hover, wrap this component with MUI's Tooltip component (see example usage below).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **Purpose**: A styled Typography component that handles text overflow with ellipsis, with optional multi-line clamping support.
- **Expected Behavior**: Renders text with a max width of 300px. By default shows single line with ellipsis, but can display multiple lines when lineClamp prop is provided.
- **Purpose**: A styled Typography component that handles text overflow with ellipsis, with optional multi-line clamping support.
- **Expected Behavior**: Renders text with a max width of 300px. By default, it shows a single line with ellipsis, but can display multiple lines when the lineClamp prop is provided.
Note: For displaying the full text on hover, wrap this component with MUI's Tooltip component (see example usage below).
🧰 Tools
🪛 LanguageTool

[uncategorized] ~10-~10: Did you mean: “By default,”?
Context: ...Renders text with a max width of 300px. By default shows single line with ellipsis, but ca...

(BY_DEFAULT_COMMA)


[uncategorized] ~10-~10: Possible missing article found.
Context: ... a max width of 300px. By default shows single line with ellipsis, but can display mul...

(AI_HYDRA_LEO_MISSING_A)

@@ -0,0 +1,57 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="@baseapp-frontend | designSystem/Inputs/TextareaField" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update the title format

Per PR comments, update the title to match the correct format:

-<Meta title="@baseapp-frontend | designSystem/Inputs/TextareaField" />
+<Meta title="@baseapp-frontend/design-system | Inputs/TextareaField" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Meta title="@baseapp-frontend | designSystem/Inputs/TextareaField" />
<Meta title="@baseapp-frontend/design-system | Inputs/TextareaField" />

@@ -0,0 +1,62 @@
import { Meta } from '@storybook/addon-docs'

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update the title format

Per PR comments, update the title to match the correct format:

-<Meta title="@baseapp-frontend | designSystem/Inputs/SocialTextField" />
+<Meta title="@baseapp-frontend/design-system | Inputs/SocialTextField" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Meta title="@baseapp-frontend | designSystem/Inputs/SocialTextField" />
<Meta title="@baseapp-frontend/design-system | Inputs/SocialTextField" />

Comment on lines +1 to +3
import { Meta } from '@storybook/addon-docs'

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

Choose a reason for hiding this comment

The 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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { Meta } from '@storybook/addon-docs'
<Meta title="@baseapp-frontend | designSystem/Avatars/AvatarWithPlaceholder" />
import { Meta } from '@storybook/addon-docs'
<Meta title="@baseapp-frontend-packages | designSystem/Avatars/AvatarWithPlaceholder" />

Comment on lines +1 to +3
import { Meta } from '@storybook/addon-docs'

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

Choose a reason for hiding this comment

The 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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { Meta } from '@storybook/addon-docs'
<Meta title="@baseapp-frontend | designSystem/Avatars/ClickableAvatar" />
import { Meta } from '@storybook/addon-docs'
<Meta title="@baseapp-frontend-packages | designSystem/Avatars/ClickableAvatar" />

Comment on lines +8 to +9
- **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.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add package-specific information and fix grammar

The component overview needs more specific information relevant to this package's implementation, as mentioned in PR comments. Also, there's a missing comma in the expected behavior description.

-- **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.
+- **Purpose**: A customized MUI SwipeableDrawer component that provides a bottom sliding panel with a puller handle and custom styling, specifically designed for the BaseApp design system to ensure consistent mobile interactions.
+- **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.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **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.
- **Purpose**: A customized MUI SwipeableDrawer component that provides a bottom sliding panel with a puller handle and custom styling, specifically designed for the BaseApp design system to ensure consistent mobile interactions.
- **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.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~9-~9: Possible missing comma found.
Context: ...er. Disables swipe-to-open functionality but maintains swipe-to-close. ## Use Cases...

(AI_HYDRA_LEO_MISSING_COMMA)

- ContentContainer: Styled component for content layout
- Puller: Visual handle component
- SwipeableContainer: Container for the puller

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add testing and performance sections

Documentation should include testing guidelines and performance considerations.

   - SwipeableContainer: Container for the puller

+## Testing Guidelines
+
+- Test opening and closing behavior
+- Verify swipe gestures work as expected
+- Test with different content heights
+- Ensure proper cleanup on unmount
+
+## Performance Considerations
+
+- Lazy load drawer content when possible
+- Optimize animations for mobile devices
+- Monitor memory usage with large content
+
 ## Example Usage
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- SwipeableContainer: Container for the puller
## Testing Guidelines
- Test opening and closing behavior
- Verify swipe gestures work as expected
- Test with different content heights
- Ensure proper cleanup on unmount
## Performance Considerations
- Lazy load drawer content when possible
- Optimize animations for mobile devices
- Monitor memory usage with large content
## Example Usage

@joaosoutto joaosoutto force-pushed the BA-2000-missing-MDX-group1 branch from 50f5e8d to dfed8d0 Compare January 8, 2025 12:31
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (11)
packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx (3)

27-32: Enhance props documentation with additional details

Please enhance the props documentation with:

  • Mark required props with an asterisk (*)
  • Include default values for optional props
  • Add any value constraints or validation rules
  • Document the expected shape of the ReactNode props

36-40: Clarify relationships between components

For each related component, explain:

  • How it differs from ConfirmDialog
  • When to use one over the other
  • How they can be used together

44-78: Enhance example with TypeScript and additional scenarios

Consider enhancing the example:

  • Add TypeScript types for props and handlers
  • Include error handling for the confirm action
  • Show additional examples with different configurations (e.g., custom styling, different button layouts)
  • Add comments explaining key implementation details
packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (1)

28-30: Add Tooltip to related components

Please add the Tooltip component to the Related Components section since it's commonly used with TypographyWithEllipsis.

 - **Related Components**:
   - Typography: Base MUI component that provides core text styling
   - Box: Can be used as container to control width constraints
+  - Tooltip: Can be used to display full text on hover
packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx (1)

25-28: Enhance props documentation

Please improve the props documentation by:

  • Listing all inherited TextField props with their types and default values
  • Explaining why certain props are hardcoded
  • Adding code examples for common prop combinations
packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (1)

36-36: Fix grammar in component description

Add an article before "reply text display":

-  - Typography/TypographyWithEllipsis: Used for reply text display
+  - Typography/TypographyWithEllipsis: Used for the reply text display
🧰 Tools
🪛 LanguageTool

[grammar] ~36-~36: A word such as an article or a possessive pronoun before ‘reply’ seems to be missing.
Context: ...graphy/TypographyWithEllipsis: Used for reply text display - CommentReplyIcon/Close...

(FOR_REPLY)

packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx (2)

27-30: Enhance props documentation

Please improve the props documentation by:

  • Indicating which props are required vs optional
  • Adding type information for the spread props from MUI's AvatarProps
  • Including prop validation rules or constraints
🧰 Tools
🪛 LanguageTool

[uncategorized] ~27-~27: A determiner appears to be missing. Consider inserting it.
Context: ...number): Width of the avatar in pixels. Default is 36. - height (number): Height of...

(AI_EN_LECTOR_MISSING_DETERMINER)


[uncategorized] ~28-~28: A determiner appears to be missing. Consider inserting it.
Context: ...umber): Height of the avatar in pixels. Default is 36. - children (ReactNode): Cont...

(AI_EN_LECTOR_MISSING_DETERMINER)


42-53: Expand example usage section

The current example only demonstrates text content. Consider adding examples that show:

  • Image usage
  • Placeholder fallback behavior
  • Different size configurations
packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx (2)

8-9: Add technical implementation details

Please enhance the documentation with:

  • Specific animation parameters (scale factor, duration)
  • Accessibility considerations for interactive elements
  • Touch device behavior specifics
🧰 Tools
🪛 LanguageTool

[grammar] ~8-~8: Possible subject-verb agreement error.
Context: ...onent that adds click interactivity and hover animations using Framer Motion. Built o...

(IS_AND_ARE)


44-44: Improve onClick handler example

The current example uses an empty onClick handler. Consider adding a meaningful example that demonstrates typical usage patterns (e.g., opening a profile menu).

packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (1)

13-17: Enhance use cases with package-specific examples

The current use cases are too generic. Include specific examples from the BaseApp implementation to help developers understand when and how to use this component.

 - **Current Usage**:
-  - Bottom sheet dialogs
-  - Mobile action sheets
-  - Expandable bottom panels
-  - Touch-friendly modal interfaces
+  - Mobile navigation menu in responsive layouts
+  - Filter panels in mobile search interfaces
+  - Action sheets for sharing options
+  - Settings panels in mobile views
+  Example: Used in the BaseApp mobile navigation to provide access to secondary menu items
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 50f5e8d and 70aa0c0.

📒 Files selected for processing (11)
  • packages/design-system/components/Logo/__storybook__/Logo.mdx (1 hunks)
  • packages/design-system/components/Popover/__storybook__/Popover.mdx (1 hunks)
  • packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx (1 hunks)
  • packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx (1 hunks)
  • packages/design-system/components/buttons/IconButton/__storybook__/IconButton.mdx (1 hunks)
  • packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx (1 hunks)
  • packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (1 hunks)
  • packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (1 hunks)
  • packages/design-system/components/inputs/TextField/__storybook__/TextField.mdx (1 hunks)
  • packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx (1 hunks)
  • packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/design-system/components/Popover/storybook/Popover.mdx
  • packages/design-system/components/buttons/IconButton/storybook/IconButton.mdx
  • packages/design-system/components/Logo/storybook/Logo.mdx
  • packages/design-system/components/inputs/TextField/storybook/TextField.mdx
🧰 Additional context used
🪛 LanguageTool
packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx

[grammar] ~36-~36: A word such as an article or a possessive pronoun before ‘reply’ seems to be missing.
Context: ...graphy/TypographyWithEllipsis: Used for reply text display - CommentReplyIcon/Close...

(FOR_REPLY)

packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx

[uncategorized] ~27-~27: A determiner appears to be missing. Consider inserting it.
Context: ...number): Width of the avatar in pixels. Default is 36. - height (number): Height of...

(AI_EN_LECTOR_MISSING_DETERMINER)


[uncategorized] ~28-~28: A determiner appears to be missing. Consider inserting it.
Context: ...umber): Height of the avatar in pixels. Default is 36. - children (ReactNode): Cont...

(AI_EN_LECTOR_MISSING_DETERMINER)

packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx

[grammar] ~8-~8: Possible subject-verb agreement error.
Context: ...onent that adds click interactivity and hover animations using Framer Motion. Built o...

(IS_AND_ARE)

packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx

[grammar] ~34-~34: Possible typo detected: Did you mean to write ‘from’ instead of ‘form’?
Context: ...ality - withController: HOC that adds form control capabilities - Textarea: Styl...

(TYPO_FORM_FROM)

packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx

[uncategorized] ~10-~10: Did you mean: “By default,”?
Context: ...Renders text with a max width of 300px. By default shows single line with ellipsis, but ca...

(BY_DEFAULT_COMMA)


[uncategorized] ~10-~10: Possible missing article found.
Context: ... a max width of 300px. By default shows single line with ellipsis, but can display mul...

(AI_HYDRA_LEO_MISSING_A)

🔇 Additional comments (21)
packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx (1)

1-3: Update the Storybook title according to the new convention

The title should not include "@baseapp-frontend" as per the PR comments.

-<Meta title="@baseapp-frontend | designSystem/Dialogs/ConfirmDialog" />
+<Meta title="designSystem/Dialogs/ConfirmDialog" />
packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (5)

1-3: Update the title format

The title should follow the correct format without "@baseapp-frontend".

-<Meta title="@baseapp-frontend | designSystem/Typographies/TypographyWithEllipsis" />
+<Meta title="Design System/Typographies/TypographyWithEllipsis" />

9-10: Improve component overview clarity and accuracy

The Expected Behavior section needs grammatical fixes and should clarify the tooltip functionality.

-- **Expected Behavior**: Renders text with a max width of 300px. By default shows single line with ellipsis, but can display multiple lines when lineClamp prop is provided.
+- **Expected Behavior**: Renders text with a max width of 300px. By default, it shows a single line with ellipsis, but can display multiple lines when the lineClamp prop is provided.
+
+Note: To display the full text on hover, wrap this component with MUI's Tooltip component (see example usage below).
🧰 Tools
🪛 LanguageTool

[uncategorized] ~10-~10: Did you mean: “By default,”?
Context: ...Renders text with a max width of 300px. By default shows single line with ellipsis, but ca...

(BY_DEFAULT_COMMA)


[uncategorized] ~10-~10: Possible missing article found.
Context: ... a max width of 300px. By default shows single line with ellipsis, but can display mul...

(AI_HYDRA_LEO_MISSING_A)


14-18: Add package-specific use cases

The current use cases are too generic. Please provide specific examples from the BaseApp Frontend packages.

Examples should include:

  • Truncating long titles in card components
  • Handling overflow in navigation items
  • Managing text in specific UI layouts unique to your application

22-24: Enhance props documentation

Please enhance the props documentation by adding:

  1. Default values for props (especially lineClamp)
  2. Whether props are required or optional
  3. Any constraints on prop values

Example format:

- **children** (ReactNode, required): The text content to be displayed and potentially truncated.
- **lineClamp** (number, optional, default: 1): The number of lines to clamp the text to. Must be a positive integer.
- **maxWidth** (number, optional, default: 300): The maximum width in pixels for the container.

34-45: Add example with tooltip integration

The example should demonstrate how to combine TypographyWithEllipsis with Tooltip for the full text display on hover.

 ```javascript
 import { TypographyWithEllipsis } from '@baseapp-frontend/design-system'
+import { Tooltip } from '@mui/material'
 
 const MyComponent = () => {
+  const text = 'This is a long text that should be truncated with an ellipsis.'
   return (
-    <TypographyWithEllipsis lineClamp={2}>
-      This is a long text that should be truncated with an ellipsis.
-    </TypographyWithEllipsis>
+    <Tooltip title={text}>
+      <TypographyWithEllipsis lineClamp={2}>
+        {text}
+      </TypographyWithEllipsis>
+    </Tooltip>
   )
 }
 export default MyComponent

</details>
<details>
<summary>packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx (1)</summary>

`3-3`: **Update the title format**

The title format needs to be updated to match the correct format as requested in the PR comments.

</details>
<details>
<summary>packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (5)</summary>

`1-3`: **Update the title format per PR requirements**

The title format needs to be updated to match the correct package name.

---

`9-10`: **Document validation rules and @ symbol handling**

The expected behavior section should include specific details about validation rules and special character handling.

---

`31-38`: **Add accessibility documentation**

The Notes section should include accessibility considerations.

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 LanguageTool</summary>

[grammar] ~36-~36: A word such as an article or a possessive pronoun before ‘reply’ seems to be missing.
Context: ...graphy/TypographyWithEllipsis: Used for reply text display   - CommentReplyIcon/Close...

(FOR_REPLY)

</details>

</details>

---

`41-62`: **Add examples demonstrating social media features**

The example should showcase social media specific functionality.

---

`45-45`: _:warning: Potential issue_

**Fix TypeScript generic syntax**

There's incorrect spacing in the useState generic:
```diff
-  const [value, setValue] = useState < string > ''
+  const [value, setValue] = useState<string>('')

Likely invalid or redundant comment.

packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx (2)

1-3: Update the title format as requested

The title should use "@baseapp-frontend-packages" instead of "@baseapp-frontend" as per PR comments.


9-10: Enhance placeholder behavior documentation

The documentation should provide more specific details about the placeholder implementation.

packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx (2)

1-3: Update the title format as requested

The title should use "@baseapp-frontend-packages" instead of "@baseapp-frontend" as per PR comments.


44-51: Replace hardcoded image URL with a placeholder

The example uses a production URL which could pose security risks and may become invalid.

packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (5)

1-3: Update documentation title format

Remove "@baseapp-frontend" from the title as it's incorrect for package documentation.

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

8-9: Add package-specific information and fix grammar

The component overview needs more specific information relevant to this package's implementation. Also, there's a missing comma in the expected behavior description.

-- **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.
+- **Purpose**: A customized MUI SwipeableDrawer component that provides a bottom sliding panel with a puller handle and custom styling, specifically designed for the BaseApp design system to ensure consistent mobile interactions.
+- **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.

21-28: Enhance props documentation with additional details

The props documentation should include more details to help developers implement the component correctly.

-- **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)
+### Props
+
+| Name | Type | Required | Default | Description |
+|------|------|----------|---------|-------------|
+| children | ReactNode | Yes | - | Content to be rendered inside the drawer |
+| globalHeight | string | No | calc(25% - SWIPE_AREA_WIDTH) | Height of the drawer paper component |
+| open | boolean | Yes | - | Controls the drawer's visibility |
+| onClose | (event: React.KeyboardEvent &#124; React.MouseEvent) => void | Yes | - | Callback fired when the drawer should close |
+| onOpen | (event: React.KeyboardEvent &#124; React.MouseEvent) => void | No | () => {} | Callback fired when the drawer should open |
+| anchor | 'bottom' | No | 'bottom' | Fixed to bottom position |
+| disableSwipeToOpen | boolean | No | true | Fixed to true to disable swipe-to-open |

29-29: Add accessibility guidelines section

The documentation should include accessibility considerations to ensure proper implementation.

 - **globalHeight** (number): Global height of the drawer

+## Accessibility
+
+### ARIA Roles and Attributes
+- The drawer should have `role="dialog"` and `aria-modal="true"`
+- The trigger button should have `aria-controls` referencing the drawer's ID
+- The trigger button should have `aria-expanded` to indicate the drawer's state
+
+### Keyboard Navigation
+- ESC key should close the drawer
+- Focus should be trapped within the drawer when open
+- Focus should return to the trigger element when closed
+
 ## Notes

40-71: Improve example code with best practices

The example code could be enhanced with error handling, accessibility, and proper props usage.

 ```javascript
 import { useState } from 'react'
 import { Button, Typography } from '@mui/material'
 import { SwipeableDrawer } from '@baseapp-frontend/design-system'

-const [open, setOpen] = useState(false)
-
-const handleOpen = () => {
-  setOpen(true)
-}
-
-const handleClose = () => {
-  setOpen(false)
-}
-
 const MyComponent = () => {
+  const [open, setOpen] = useState(false)
+
+  const handleOpen = (event) => {
+    event.preventDefault()
+    setOpen(true)
+  }
+
+  const handleClose = (event) => {
+    event.preventDefault()
+    setOpen(false)
+  }
+
   return (
     <>
-      <Button variant="outlined" onClick={handleOpen} style={{ width: '250px' }}>
+      <Button
+        variant="outlined"
+        onClick={handleOpen}
+        aria-controls="swipeable-drawer"
+        aria-expanded={open}
+        sx={{ width: '250px' }}
+      >
         Open Swipeable Drawer
       </Button>
-      <SwipeableDrawer {...args} open={open} onClose={handleClose} onOpen={handleOpen}>
-        <Typography variant="body1" sx={{ p: 2 }}>
+      <SwipeableDrawer
+        id="swipeable-drawer"
+        role="dialog"
+        aria-modal="true"
+        open={open}
+        onClose={handleClose}
+        onOpen={handleOpen}
+        globalHeight={window.innerHeight}
+      >
+        <Typography variant="body1" component="div" sx={{ p: 2 }}>
           This is the content of the Swipeable Drawer. You can put any components or content here.
         </Typography>
       </SwipeableDrawer>
     </>
   )
 }
+
 export default MyComponent

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Comment on lines +9 to +10
- **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.
Copy link

Choose a reason for hiding this comment

The 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:

  • What are the standard styling conventions?
  • Are there any BaseApp-specific behaviors or configurations?
  • What are the accessibility considerations in the BaseApp implementation?

Comment on lines +14 to +23
- **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
Copy link

Choose a reason for hiding this comment

The 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:

  • Reference the actual component/page where it's being used
  • Describe the specific confirmation scenarios
  • Include any custom configurations used

Comment on lines +14 to +21
- **Current Usage**:
- Comment sections
- Description fields
- Any multiline text input needs
- **Potential Usage**:
- Form text areas
- Message composition
- Note inputs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add package-specific use cases

Replace generic examples with actual use cases from the BaseApp Frontend packages. For each use case:

  • Reference the specific package/component where it's being used
  • Explain why TextareaField was chosen over alternatives
  • Include any relevant business context

import { TextareaField } from '@baseapp-frontend/design-system'

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix TypeScript syntax in example

There's a syntax error in the useState generic type declaration.

-  const [value, setValue] = useState < string > ''
+  const [value, setValue] = useState<string>('')
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const [value, setValue] = useState < string > ''
const [value, setValue] = useState<string>('')

Comment on lines +23 to +29
## 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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance props documentation with TypeScript types and required information

Please improve the props documentation by adding:

  1. TypeScript interfaces/types for each prop
  2. Required vs optional status for each prop
  3. Default values where applicable
  4. Prop validation rules and constraints

Example format:

interface SocialTextFieldProps extends TextareaFieldProps {
  /** Content rendered below the textarea */
  children?: ReactNode;
  /** Controls visibility of reply interface */
  isReply: boolean;
  /** Name of the user being replied to */
  replyTargetName?: string;
  /** Callback for reply cancellation */
  onCancelReply?: () => void;
}

Comment on lines +14 to +24
- **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

Copy link

Choose a reason for hiding this comment

The 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.

@joaosoutto joaosoutto force-pushed the BA-2000-missing-MDX-group1 branch from 70aa0c0 to 0136309 Compare January 8, 2025 13:07
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (8)
packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx (2)

26-28: Document rationale for hardcoded props

Please explain why these values are hardcoded and cannot be overridden:

  • Why is maxRows specifically set to 3?
  • Why is the border always hidden?
  • What are the implications of these restrictions?

46-53: Improve example code

The example includes unnecessary props that are hardcoded in the component:

  • Remove multiline={true} since it's always true
  • Remove maxRows={3} since it's hardcoded

Also consider:

  • Adding error handling example
  • Showing form integration
  • Demonstrating character limit usage
packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (1)

30-30: Fix grammar in related components section

-- Box: Can be used as container to control width constraints
+- Box: Can be used as a container to control width constraints
🧰 Tools
🪛 LanguageTool

[uncategorized] ~30-~30: You might be missing the article “a” here.
Context: ...re text styling - Box: Can be used as container to control width constraints ## Exampl...

(AI_EN_LECTOR_MISSING_DETERMINER_A)

packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx (2)

36-40: Enhance related components section with usage guidelines

For each related component, explain:

  • How it differs from ConfirmDialog
  • When to use one over the other
  • How they can be used together effectively

44-78: Add more comprehensive examples

Consider adding examples for:

  • Different variants/sizes if supported
  • Custom styling through className/style props
  • Proper accessibility implementation with ARIA attributes
  • Error handling scenarios
packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx (1)

27-30: Enhance props documentation

Please enhance the props documentation by:

  • Specifying which props are required vs optional
  • Documenting the specific MUI AvatarProps that are commonly used
  • Adding validation rules or constraints for each prop
🧰 Tools
🪛 LanguageTool

[uncategorized] ~27-~27: A determiner appears to be missing. Consider inserting it.
Context: ...number): Width of the avatar in pixels. Default is 36. - height (number): Height of...

(AI_EN_LECTOR_MISSING_DETERMINER)


[uncategorized] ~28-~28: A determiner appears to be missing. Consider inserting it.
Context: ...umber): Height of the avatar in pixels. Default is 36. - children (ReactNode): Cont...

(AI_EN_LECTOR_MISSING_DETERMINER)

packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx (2)

8-9: Document animation configuration and accessibility

Please enhance the documentation to include:

  • Available animation configuration options
  • Accessibility considerations (ARIA attributes, keyboard navigation)
  • How to customize or disable animations
🧰 Tools
🪛 LanguageTool

[grammar] ~8-~8: Possible subject-verb agreement error.
Context: ...onent that adds click interactivity and hover animations using Framer Motion. Built o...

(IS_AND_ARE)


44-44: Improve example with meaningful onClick handler

The current example uses an empty onClick handler. Provide a meaningful example that demonstrates typical usage patterns, such as opening a menu or navigating to a profile page.

-    <ClickableAvatar isOpen={false} width={50} height={50} onClick={() => {}}>
+    <ClickableAvatar
+      isOpen={isMenuOpen}
+      width={50}
+      height={50}
+      onClick={() => setIsMenuOpen(!isMenuOpen)}
+    >
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 70aa0c0 and be15fec.

📒 Files selected for processing (11)
  • packages/design-system/components/Logo/__storybook__/Logo.mdx (1 hunks)
  • packages/design-system/components/Popover/__storybook__/Popover.mdx (1 hunks)
  • packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx (1 hunks)
  • packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx (1 hunks)
  • packages/design-system/components/buttons/IconButton/__storybook__/IconButton.mdx (1 hunks)
  • packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx (1 hunks)
  • packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (1 hunks)
  • packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (1 hunks)
  • packages/design-system/components/inputs/TextField/__storybook__/TextField.mdx (1 hunks)
  • packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx (1 hunks)
  • packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/design-system/components/inputs/TextField/storybook/TextField.mdx
  • packages/design-system/components/Popover/storybook/Popover.mdx
  • packages/design-system/components/buttons/IconButton/storybook/IconButton.mdx
  • packages/design-system/components/Logo/storybook/Logo.mdx
🧰 Additional context used
🪛 LanguageTool
packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx

[uncategorized] ~9-~9: Possible missing comma found.
Context: ...er. Disables swipe-to-open functionality but maintains swipe-to-close. ## Use Cases...

(AI_HYDRA_LEO_MISSING_COMMA)

packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx

[grammar] ~36-~36: A word such as an article or a possessive pronoun before ‘reply’ seems to be missing.
Context: ...graphy/TypographyWithEllipsis: Used for reply text display - CommentReplyIcon/Close...

(FOR_REPLY)

packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx

[uncategorized] ~27-~27: A determiner appears to be missing. Consider inserting it.
Context: ...number): Width of the avatar in pixels. Default is 36. - height (number): Height of...

(AI_EN_LECTOR_MISSING_DETERMINER)


[uncategorized] ~28-~28: A determiner appears to be missing. Consider inserting it.
Context: ...umber): Height of the avatar in pixels. Default is 36. - children (ReactNode): Cont...

(AI_EN_LECTOR_MISSING_DETERMINER)

packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx

[grammar] ~8-~8: Possible subject-verb agreement error.
Context: ...onent that adds click interactivity and hover animations using Framer Motion. Built o...

(IS_AND_ARE)

packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx

[grammar] ~34-~34: Possible typo detected: Did you mean to write ‘from’ instead of ‘form’?
Context: ...ality - withController: HOC that adds form control capabilities - Textarea: Styl...

(TYPO_FORM_FROM)

packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx

[uncategorized] ~10-~10: Did you mean: “By default,”?
Context: ...Renders text with a max width of 300px. By default shows single line with ellipsis, but ca...

(BY_DEFAULT_COMMA)


[uncategorized] ~10-~10: Possible missing article found.
Context: ... a max width of 300px. By default shows single line with ellipsis, but can display mul...

(AI_HYDRA_LEO_MISSING_A)


[uncategorized] ~30-~30: You might be missing the article “a” here.
Context: ...re text styling - Box: Can be used as container to control width constraints ## Exampl...

(AI_EN_LECTOR_MISSING_DETERMINER_A)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Component Test Applications and Packages
  • GitHub Check: Lint
🔇 Additional comments (26)
packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx (3)

3-3: Update the title format

The title format needs to be updated to match the correct package name structure.


14-21: Add package-specific use cases

Replace generic examples with actual use cases from the BaseApp Frontend packages.


43-43: Fix TypeScript syntax in example

The useState generic type declaration contains a syntax error.

packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (5)

3-3: Update title format to match documentation standards

-<Meta title="@baseapp-frontend | designSystem/Typographies/TypographyWithEllipsis" />
+<Meta title="Design System/Typographies/TypographyWithEllipsis" />

9-10: Improve component description clarity and completeness

  1. Fix grammatical issues:
-- **Expected Behavior**: Renders text with a max width of 300px. By default shows single line with ellipsis, but can display multiple lines when lineClamp prop is provided.
+- **Expected Behavior**: Renders text with a max width of 300px. By default, it shows a single line with ellipsis, but can display multiple lines when the lineClamp prop is provided.
  1. Add tooltip functionality note:
+Note: For displaying the full text on hover, wrap this component with MUI's Tooltip component (see example usage below).
🧰 Tools
🪛 LanguageTool

[uncategorized] ~10-~10: Did you mean: “By default,”?
Context: ...Renders text with a max width of 300px. By default shows single line with ellipsis, but ca...

(BY_DEFAULT_COMMA)


[uncategorized] ~10-~10: Possible missing article found.
Context: ... a max width of 300px. By default shows single line with ellipsis, but can display mul...

(AI_HYDRA_LEO_MISSING_A)


14-18: Add package-specific use cases

The current use cases are too generic. Please provide specific examples from the BaseApp Frontend packages where this component is being used, such as:

  • Truncating long titles in card components
  • Handling overflow in navigation items
  • Managing text in specific UI layouts unique to your application

22-24: Enhance props documentation

Please enhance the props documentation by adding:

  1. Default values for props (especially lineClamp)
  2. Whether props are required or optional
  3. Any constraints on prop values

Example format:

- **children** (ReactNode, required): The text content to be displayed and potentially truncated.
- **lineClamp** (number, optional, default: 1): The number of lines to clamp the text to. Must be a positive integer.
- **maxWidth** (number, optional, default: 300): The maximum width in pixels for the container.

34-45: Add example with tooltip integration

 ```javascript
 import { TypographyWithEllipsis } from '@baseapp-frontend/design-system'
+import { Tooltip } from '@mui/material'
 
 const MyComponent = () => {
+  const text = 'This is a long text that should be truncated with an ellipsis.'
   return (
-    <TypographyWithEllipsis lineClamp={2}>
-      This is a long text that should be truncated with an ellipsis.
-    </TypographyWithEllipsis>
+    <Tooltip title={text}>
+      <TypographyWithEllipsis lineClamp={2}>
+        {text}
+      </TypographyWithEllipsis>
+    </Tooltip>
   )
 }
 export default MyComponent
packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx (3)

1-3: Update the Storybook title according to the new convention

The title should not include "@baseapp-frontend" prefix as per PR comments.

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

9-10: 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.


14-23: Replace generic use cases with actual BaseApp implementations

Instead of listing generic use cases, document specific implementations within BaseApp.

packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx (3)

1-3: Update package name in title

As mentioned in the PR comments, update the package name in the title to remove "-template" and use the correct package name.

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

9-10: Enhance placeholder behavior documentation

The documentation should specify:

  • What the default placeholder looks like
  • How the placeholder is generated (e.g., initials from text)
  • Customization options for the placeholder

14-24: 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.

packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx (2)

1-3: Update package name in title

As mentioned in the PR comments, update the package name in the title to use the correct package name.

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

44-51: Replace hardcoded image URL with a placeholder

The example uses a hardcoded DigitalOcean Spaces URL which may not be accessible and could become invalid.

      <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}
      />
packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (5)

3-3: Update the title format to match package naming.

The title should follow the correct format for package documentation.

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

9-10: Enhance component behavior documentation.

The expected behavior section should include more specific details about:

  1. Input validation rules
  2. Special character handling (e.g., @ symbol)
  3. Maximum length constraints

23-29: Enhance props documentation with TypeScript details.

The props section should include TypeScript interfaces and additional details about prop requirements.


31-38: Add accessibility documentation and fix grammar.

  1. Fix grammar in line 36: "Used for the reply text display"
  2. Add an accessibility section documenting:
    • ARIA attributes
    • Keyboard navigation
    • Screen reader support
🧰 Tools
🪛 LanguageTool

[grammar] ~36-~36: A word such as an article or a possessive pronoun before ‘reply’ seems to be missing.
Context: ...graphy/TypographyWithEllipsis: Used for reply text display - CommentReplyIcon/Close...

(FOR_REPLY)


41-62: 🛠️ Refactor suggestion

Fix TypeScript syntax and enhance example.

  1. Fix the TypeScript syntax error in useState:
-  const [value, setValue] = useState < string > ''
+  const [value, setValue] = useState<string>('')
  1. Add examples demonstrating social features:
    • Mention functionality
    • Reply handling
    • Input validation

Likely invalid or redundant comment.

packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (5)

3-3: Update documentation title format

Per PR requirements, remove "@baseapp-frontend" from the title and update the format.

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

8-9: Enhance component overview with package-specific details

The overview needs more specific information relevant to this package's implementation and requires grammar fixes.

-- **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.
+- **Purpose**: A customized MUI SwipeableDrawer component that provides a bottom sliding panel with a puller handle and custom styling, specifically designed for the BaseApp design system to ensure consistent mobile interactions.
+- **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.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~9-~9: Possible missing comma found.
Context: ...er. Disables swipe-to-open functionality but maintains swipe-to-close. ## Use Cases...

(AI_HYDRA_LEO_MISSING_COMMA)


21-29: Enhance props documentation with detailed table format

The props documentation should be more detailed and structured.

-## Props
-
-- **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)
+## Props
+
+| Name | Type | Required | Default | Description |
+|------|------|----------|---------|-------------|
+| children | ReactNode | Yes | - | Content to be rendered inside the drawer |
+| globalHeight | string | No | calc(25% - SWIPE_AREA_WIDTH) | Height of the drawer paper component |
+| open | boolean | Yes | - | Controls the drawer's visibility |
+| onClose | (event: React.KeyboardEvent &#124; React.MouseEvent) => void | Yes | - | Callback fired when the drawer should close |
+| onOpen | (event: React.KeyboardEvent &#124; React.MouseEvent) => void | No | () => {} | Callback fired when the drawer should open |
+| anchor | 'bottom' | No | 'bottom' | Fixed to bottom position |
+| disableSwipeToOpen | boolean | No | true | Fixed to true to disable swipe-to-open |

37-37: Add accessibility and testing guidelines

Documentation should include accessibility considerations and testing guidelines.

   - SwipeableContainer: Container for the puller

+## Accessibility
+
+### ARIA Roles and Attributes
+- The drawer should have `role="dialog"` and `aria-modal="true"`
+- The trigger button should have `aria-controls` referencing the drawer's ID
+- The trigger button should have `aria-expanded` to indicate the drawer's state
+
+### Keyboard Navigation
+- ESC key should close the drawer
+- Focus should be trapped within the drawer when open
+- Focus should return to the trigger element when closed
+
+## Testing Guidelines
+
+- Test opening and closing behavior
+- Verify swipe gestures work as expected
+- Test with different content heights
+- Ensure proper cleanup on unmount
+
 ## Example Usage

40-71: Improve example code with best practices and accessibility

The example code needs enhancement for better practices, accessibility, and proper props usage.

 ```javascript
 import { useState } from 'react'
 import { Button, Typography } from '@mui/material'
 import { SwipeableDrawer } from '@baseapp-frontend/design-system'

-const [open, setOpen] = useState(false)
-
-const handleOpen = () => {
-  setOpen(true)
-}
-
-const handleClose = () => {
-  setOpen(false)
-}
-
 const MyComponent = () => {
+  const [open, setOpen] = useState(false)
+
+  const handleOpen = (event) => {
+    event.preventDefault()
+    setOpen(true)
+  }
+
+  const handleClose = (event) => {
+    event.preventDefault()
+    setOpen(false)
+  }
+
   return (
     <>
-      <Button variant="outlined" onClick={handleOpen} style={{ width: '250px' }}>
+      <Button
+        variant="outlined"
+        onClick={handleOpen}
+        aria-controls="swipeable-drawer"
+        aria-expanded={open}
+        sx={{ width: '250px' }}
+      >
         Open Swipeable Drawer
       </Button>
-      <SwipeableDrawer {...args} open={open} onClose={handleClose} onOpen={handleOpen}>
-        <Typography variant="body1" sx={{ p: 2 }}>
+      <SwipeableDrawer
+        id="swipeable-drawer"
+        role="dialog"
+        aria-modal="true"
+        open={open}
+        onClose={handleClose}
+        onOpen={handleOpen}
+        globalHeight={window.innerHeight}
+      >
+        <Typography variant="body1" component="div" sx={{ p: 2 }}>
           This is the content of the Swipeable Drawer. You can put any components or content here.
         </Typography>
       </SwipeableDrawer>
     </>
   )
 }
+
 export default MyComponent

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Comment on lines +9 to +10
- **Purpose**: A simple textarea component that extends TextField with multiline support and consistent styling. It wraps the base component with form controller functionality.
- **Expected Behavior**: Renders a multiline text input field with a maximum of 3 rows before scrolling begins. The border is hidden by default.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add technical implementation details

The description should include:

  • How the form controller integration works
  • Any performance implications of the wrapper
  • Event handling specifics
  • Whether the component is controlled or uncontrolled by default

Comment on lines +27 to +33
- **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

Copy link

Choose a reason for hiding this comment

The 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:

  • Accessibility props (e.g., aria-labelledby, aria-describedby)
  • Styling/theming props (e.g., className, style)
  • Size/variant props if supported

Comment on lines +14 to +22
- **Current Usage**:
- Comments sections
- Reply threads
- Social interactions
- **Potential Usage**:
- Discussion forums
- Messaging interfaces
- Any social commenting system

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add BaseApp-specific use cases and examples.

Per PR feedback, the documentation should contain details specific to BaseApp packages rather than generic information. Consider:

  1. Adding real examples from BaseApp implementation
  2. Describing specific integration points within the BaseApp ecosystem
  3. Including screenshots or links to live examples

Comment on lines +13 to +17
- **Current Usage**:
- Bottom sheet dialogs
- Mobile action sheets
- Expandable bottom panels
- Touch-friendly modal interfaces
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add package-specific use cases

The current usage examples are too generic. Include specific examples from the BaseApp implementation.

 - **Current Usage**:
-  - Bottom sheet dialogs
-  - Mobile action sheets
-  - Expandable bottom panels
-  - Touch-friendly modal interfaces
+  - Mobile navigation menu in BaseApp's responsive layout
+  - User profile settings panel in mobile view
+  - Filter options panel in mobile search interface
+  - Action menu in mobile dashboard
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **Current Usage**:
- Bottom sheet dialogs
- Mobile action sheets
- Expandable bottom panels
- Touch-friendly modal interfaces
- **Current Usage**:
- Mobile navigation menu in BaseApp's responsive layout
- User profile settings panel in mobile view
- Filter options panel in mobile search interface
- Action menu in mobile dashboard

@joaosoutto joaosoutto force-pushed the BA-2000-missing-MDX-group1 branch 3 times, most recently from 0dfc1da to 3b8d304 Compare January 8, 2025 14:17
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx (1)

51-53: Remove redundant props in example.

The multiline and maxRows props are hardcoded in the component as mentioned in the props documentation, so they don't need to be specified in the example:

       value={value}
       onChange={(e) => setValue(e.target.value)}
-      multiline={true}
-      maxRows={3}
     />
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be15fec and 1611a2c.

📒 Files selected for processing (11)
  • packages/design-system/components/Logo/__storybook__/Logo.mdx (1 hunks)
  • packages/design-system/components/Popover/__storybook__/Popover.mdx (1 hunks)
  • packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx (1 hunks)
  • packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx (1 hunks)
  • packages/design-system/components/buttons/IconButton/__storybook__/IconButton.mdx (1 hunks)
  • packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx (1 hunks)
  • packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (1 hunks)
  • packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (1 hunks)
  • packages/design-system/components/inputs/TextField/__storybook__/TextField.mdx (1 hunks)
  • packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx (1 hunks)
  • packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/design-system/components/Popover/storybook/Popover.mdx
  • packages/design-system/components/avatars/AvatarWithPlaceholder/storybook/AvatarWithPlaceholder.mdx
  • packages/design-system/components/Logo/storybook/Logo.mdx
  • packages/design-system/components/buttons/IconButton/storybook/IconButton.mdx
  • packages/design-system/components/dialogs/ConfirmDialog/storybook/ConfirmDialog.mdx
  • packages/design-system/components/inputs/TextField/storybook/TextField.mdx
🧰 Additional context used
🪛 LanguageTool
packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx

[uncategorized] ~9-~9: Possible missing comma found.
Context: ...er. Disables swipe-to-open functionality but maintains swipe-to-close. ## Use Cases...

(AI_HYDRA_LEO_MISSING_COMMA)

packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx

[grammar] ~8-~8: Possible subject-verb agreement error.
Context: ...onent that adds click interactivity and hover animations using Framer Motion. Built o...

(IS_AND_ARE)

packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx

[grammar] ~36-~36: A word such as an article or a possessive pronoun before ‘reply’ seems to be missing.
Context: ...graphy/TypographyWithEllipsis: Used for reply text display - CommentReplyIcon/Close...

(FOR_REPLY)

packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx

[grammar] ~34-~34: Possible typo detected: Did you mean to write ‘from’ instead of ‘form’?
Context: ...ality - withController: HOC that adds form control capabilities - Textarea: Styl...

(TYPO_FORM_FROM)

packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx

[uncategorized] ~10-~10: Did you mean: “By default,”?
Context: ...Renders text with a max width of 300px. By default shows single line with ellipsis, but ca...

(BY_DEFAULT_COMMA)


[uncategorized] ~10-~10: Possible missing article found.
Context: ... a max width of 300px. By default shows single line with ellipsis, but can display mul...

(AI_HYDRA_LEO_MISSING_A)

🔇 Additional comments (15)
packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (2)

3-3: Update the title format.

Per PR comments, update the title to match the correct format:

-<Meta title="@baseapp-frontend | designSystem/Typographies/TypographyWithEllipsis" />
+<Meta title="Design System/Typographies/TypographyWithEllipsis" />

34-45: Add example with tooltip integration.

The example should demonstrate how to combine TypographyWithEllipsis with Tooltip for the full text display on hover:

 ```javascript
 import { TypographyWithEllipsis } from '@baseapp-frontend/design-system'
+import { Tooltip } from '@mui/material'
 
 const MyComponent = () => {
+  const text = 'This is a long text that should be truncated with an ellipsis.'
   return (
-    <TypographyWithEllipsis lineClamp={2}>
-      This is a long text that should be truncated with an ellipsis.
-    </TypographyWithEllipsis>
+    <Tooltip title={text}>
+      <TypographyWithEllipsis lineClamp={2}>
+        {text}
+      </TypographyWithEllipsis>
+    </Tooltip>
   )
 }
 export default MyComponent
packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx (3)

3-3: Update the title format.

Per PR comments, update the title to match the correct format:

-<Meta title="@baseapp-frontend | designSystem/Inputs/TextareaField" />
+<Meta title="Design System/Inputs/TextareaField" />

14-21: Add package-specific use cases.

Replace generic examples with actual use cases from the BaseApp Frontend packages. For each use case:

  • Reference the specific package/component where it's being used
  • Explain why TextareaField was chosen over alternatives
  • Include any relevant business context

43-43: Fix TypeScript syntax in example.

There's a syntax error in the useState generic type declaration:

-  const [value, setValue] = useState < string > ''
+  const [value, setValue] = useState<string>('')
packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (4)

3-3: Update the title format.

Per PR comments, update the title to match the correct format:

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

14-22: Add BaseApp-specific use cases and examples.

Per PR feedback, the documentation should contain details specific to BaseApp packages rather than generic information. Consider:

  1. Adding real examples from BaseApp implementation
  2. Describing specific integration points within the BaseApp ecosystem
  3. Including screenshots or links to live examples

25-29: Enhance props documentation with TypeScript types and required information.

Please improve the props documentation by adding:

  1. TypeScript interfaces/types for each prop
  2. Required vs optional status for each prop
  3. Default values where applicable
  4. Prop validation rules and constraints

Example format:

interface SocialTextFieldProps extends TextareaFieldProps {
  /** Content rendered below the textarea */
  children?: ReactNode;
  /** Controls visibility of reply interface */
  isReply: boolean;
  /** Name of the user being replied to */
  replyTargetName?: string;
  /** Callback for reply cancellation */
  onCancelReply?: () => void;
}

45-45: ⚠️ Potential issue

Fix TypeScript syntax in example.

There's a syntax error in the useState generic type declaration:

-  const [value, setValue] = useState < string > ''
+  const [value, setValue] = useState<string>('')

Likely invalid or redundant comment.

packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx (2)

3-3: Update the title format.

Per PR comments, update the title to match the correct format:

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

46-46: Replace hardcoded image URL with a placeholder.

The example uses a hardcoded DigitalOcean Spaces URL which may not be accessible and could become invalid:

       <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}
       />
packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (4)

3-3: Update the title format.

Per PR comments, update the title to match the correct format:

-<Meta title="@baseapp-frontend | designSystem/Drawers/SwipeableDrawer" />
+<Meta title="Design System/Drawers/SwipeableDrawer" />

13-17: Add package-specific use cases.

The current usage examples are too generic. Include specific examples from the BaseApp implementation:

 - **Current Usage**:
-  - Bottom sheet dialogs
-  - Mobile action sheets
-  - Expandable bottom panels
-  - Touch-friendly modal interfaces
+  - Mobile navigation menu in BaseApp's responsive layout
+  - User profile settings panel in mobile view
+  - Filter options panel in mobile search interface
+  - Action menu in mobile dashboard

62-62: Remove spread operator with unknown args.

Using the spread operator with unknown args ({...args}) can lead to security vulnerabilities and unexpected behavior:

-      <SwipeableDrawer {...args} open={open} onClose={handleClose} onOpen={handleOpen}>
+      <SwipeableDrawer
+        open={open}
+        onClose={handleClose}
+        onOpen={handleOpen}
+        anchor="left"
+      >

37-37: Add accessibility guidelines section.

Add a section for accessibility considerations:

## Accessibility

### ARIA Roles and Attributes
- The drawer should have `role="dialog"` and `aria-modal="true"`
- The trigger button should have `aria-controls` referencing the drawer's ID
- The trigger button should have `aria-expanded` to indicate the drawer's state

### Keyboard Navigation
- ESC key should close the drawer
- Focus should be trapped within the drawer when open
- Focus should return to the trigger element when closed

Comment on lines +14 to +18
- **Current Usage**:
- Single line text truncation
- Multi-line text clamping with ellipsis
- Fixed width containers where text may overflow
- Responsive layouts requiring text truncation
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add package-specific use cases.

Replace generic examples with actual use cases from the BaseApp Frontend packages. For example:

  • Truncating long titles in card components
  • Handling overflow in navigation items
  • Managing text in specific UI layouts unique to your application

Comment on lines +22 to +24
- Inherits all props from MUI Typography component
- **lineClamp** (number, optional): Number of lines to show before truncating with ellipsis. When not provided, defaults to single line truncation.
- **maxWidth** (number): Fixed at 300px by default
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance props documentation.

The props documentation needs more detail:

  1. Add TypeScript interfaces/types
  2. Specify whether props are required or optional
  3. Include default values
  4. Document constraints

Example format:

interface TypographyWithEllipsisProps extends TypographyProps {
  /** Number of lines before truncating with ellipsis */
  lineClamp?: number;
  /** Maximum width of the container in pixels */
  maxWidth?: number;
}

@joaosoutto joaosoutto force-pushed the BA-2000-missing-MDX-group1 branch from 1611a2c to fef09bc Compare January 8, 2025 15:23
@joaosoutto joaosoutto force-pushed the BA-2000-missing-MDX-group1 branch from fef09bc to be2dd27 Compare January 8, 2025 17:05
Copy link

sonarqubecloud bot commented Jan 8, 2025

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

♻️ Duplicate comments (8)
packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx (3)

3-3: 🛠️ Refactor suggestion

Update the title format

Per PR comments, update the title to match the correct format:

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

9-10: 🛠️ Refactor suggestion

Enhance placeholder behavior documentation

The documentation should specify:

  • What the default placeholder looks like
  • How the placeholder is generated (e.g., initials from text)
  • Customization options for the placeholder

14-24: 🛠️ 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.

packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (5)

3-3: 🛠️ Refactor suggestion

Update the title format

Per PR comments, update the title to match the correct format:

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

9-10: 🛠️ Refactor suggestion

Document validation rules and @ symbol handling

Please document:

  1. Exact validation rules for allowed characters
  2. How @ symbols are handled
  3. Any other special character handling

14-22: 🛠️ Refactor suggestion

Add BaseApp-specific use cases and examples

Replace generic use cases with specific BaseApp implementation examples:

  1. Add real examples from BaseApp implementation
  2. Describe specific integration points
  3. Include screenshots or links to live examples

41-62: 🛠️ Refactor suggestion

Enhance example with social features

The example should demonstrate social media specific functionality like mentions and replies. Consider adding:

  1. Mention handling
  2. Reply functionality
  3. Helper text showing mentioned users

31-31: 🛠️ Refactor suggestion

Add accessibility documentation

Please add an Accessibility section documenting:

  • ARIA labels and roles
  • Keyboard navigation
  • Screen reader considerations
  • Color contrast requirements
🧹 Nitpick comments (4)
packages/components/package.json (1)

Line range hint 32-34: Consider using catalog: version specifier consistently

Some dependencies use explicit versions while others use the catalog: version specifier:

    "framer-motion": "^11.5.4",
    "numbro": "^2.5.0",
    "slugify": "^1.6.6",

For consistency and better version management, consider using the catalog: version specifier for these dependencies as well, similar to how other dependencies are managed.

Also applies to: 44-45

packages/design-system/CHANGELOG.md (1)

3-8: Review version strategy across packages

The version changes across packages raise concerns about semantic versioning consistency:

  1. @baseapp-frontend/design-system: 0.0.27 → 1.0.0 (for documentation changes)
  2. @baseapp-frontend/wagtail: 1.0.12 → 2.0.0 (for updating a dependency)

These major version bumps could:

  • Mislead consumers about the presence of breaking changes
  • Cause unnecessary major version bumps in dependent packages
  • Make it harder to communicate actual breaking changes in the future

Consider establishing clear versioning guidelines that:

  1. Reserve major versions for breaking changes
  2. Use minor versions for backwards-compatible features
  3. Use patch versions for documentation and dependency updates
packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (1)

9-9: Fix grammar in expected behavior description

Add a missing comma for better readability.

-- **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.
+- **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.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~9-~9: Possible missing comma found.
Context: ...er. Disables swipe-to-open functionality but maintains swipe-to-close. ## Use Cases...

(AI_HYDRA_LEO_MISSING_COMMA)

packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx (1)

27-30: Enhance props documentation with TypeScript types

Add TypeScript interface definition and improve props documentation:

interface AvatarWithPlaceholderProps extends AvatarProps {
  /** Width of the avatar in pixels */
  width?: number;
  /** Height of the avatar in pixels */
  height?: number;
  /** Content to be displayed within the avatar */
  children?: ReactNode;
}
🧰 Tools
🪛 LanguageTool

[uncategorized] ~27-~27: A determiner appears to be missing. Consider inserting it.
Context: ...number): Width of the avatar in pixels. Default is 36. - height (number): Height of...

(AI_EN_LECTOR_MISSING_DETERMINER)


[uncategorized] ~28-~28: A determiner appears to be missing. Consider inserting it.
Context: ...umber): Height of the avatar in pixels. Default is 36. - children (ReactNode): Cont...

(AI_EN_LECTOR_MISSING_DETERMINER)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1611a2c and 031df5c.

📒 Files selected for processing (17)
  • packages/components/CHANGELOG.md (1 hunks)
  • packages/components/package.json (1 hunks)
  • packages/design-system/CHANGELOG.md (1 hunks)
  • packages/design-system/components/Logo/__storybook__/Logo.mdx (1 hunks)
  • packages/design-system/components/Popover/__storybook__/Popover.mdx (1 hunks)
  • packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx (1 hunks)
  • packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx (1 hunks)
  • packages/design-system/components/buttons/IconButton/__storybook__/IconButton.mdx (1 hunks)
  • packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx (1 hunks)
  • packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (1 hunks)
  • packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx (1 hunks)
  • packages/design-system/components/inputs/TextField/__storybook__/TextField.mdx (1 hunks)
  • packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx (1 hunks)
  • packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (1 hunks)
  • packages/design-system/package.json (1 hunks)
  • packages/wagtail/CHANGELOG.md (1 hunks)
  • packages/wagtail/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • packages/design-system/package.json
  • packages/components/CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/design-system/components/buttons/IconButton/storybook/IconButton.mdx
  • packages/design-system/components/Popover/storybook/Popover.mdx
  • packages/design-system/components/Logo/storybook/Logo.mdx
🧰 Additional context used
🪛 LanguageTool
packages/design-system/components/inputs/SocialTextField/__storybook__/SocialTextField.mdx

[grammar] ~36-~36: A word such as an article or a possessive pronoun before ‘reply’ seems to be missing.
Context: ...graphy/TypographyWithEllipsis: Used for reply text display - CommentReplyIcon/Close...

(FOR_REPLY)

packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/AvatarWithPlaceholder.mdx

[uncategorized] ~27-~27: A determiner appears to be missing. Consider inserting it.
Context: ...number): Width of the avatar in pixels. Default is 36. - height (number): Height of...

(AI_EN_LECTOR_MISSING_DETERMINER)


[uncategorized] ~28-~28: A determiner appears to be missing. Consider inserting it.
Context: ...umber): Height of the avatar in pixels. Default is 36. - children (ReactNode): Cont...

(AI_EN_LECTOR_MISSING_DETERMINER)

packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx

[uncategorized] ~9-~9: Possible missing comma found.
Context: ...er. Disables swipe-to-open functionality but maintains swipe-to-close. ## Use Cases...

(AI_HYDRA_LEO_MISSING_COMMA)

packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx

[grammar] ~8-~8: Possible subject-verb agreement error.
Context: ...onent that adds click interactivity and hover animations using Framer Motion. Built o...

(IS_AND_ARE)

packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx

[grammar] ~34-~34: Possible typo detected: Did you mean to write ‘from’ instead of ‘form’?
Context: ...ality - withController: HOC that adds form control capabilities - Textarea: Styl...

(TYPO_FORM_FROM)

packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx

[uncategorized] ~10-~10: Did you mean: “By default,”?
Context: ...Renders text with a max width of 300px. By default shows single line with ellipsis, but ca...

(BY_DEFAULT_COMMA)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Lint
  • GitHub Check: Component Test Applications and Packages
🔇 Additional comments (18)
packages/components/package.json (1)

4-4: Reconsider the major version bump to 1.0.0

The version change from 0.0.42 to 1.0.0 is a significant jump that typically indicates production readiness and API stability. However, the PR objectives only mention adding MDX documentation files, which usually wouldn't warrant a major version bump according to semver conventions.

Consider whether:

  1. The API is indeed stable and ready for 1.0.0
  2. There are breaking changes not mentioned in the PR objectives
  3. A minor version bump might be more appropriate for documentation changes

Let's check the changelog for any breaking changes:

packages/wagtail/CHANGELOG.md (1)

3-8: ⚠️ Potential issue

Version bump inconsistency with changes

The changelog indicates a major version bump (2.0.0) but only contains patch changes. According to semantic versioning:

  • Major version (2.0.0) should indicate breaking changes
  • Patch changes should only bump the patch version

Consider either:

  1. Documenting the breaking changes that justify the major version bump, or
  2. Using an appropriate version number that matches the nature of the changes
packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/TypographyWithEllipsis.mdx (4)

3-3: Update the title format

Per PR comments, update the title to match the correct format:

-<Meta title="@baseapp-frontend | designSystem/Typographies/TypographyWithEllipsis" />
+<Meta title="Design System/Typographies/TypographyWithEllipsis" />

9-10: Improve clarity in Expected Behavior section

The description needs grammatical fixes and clarity about tooltip functionality:

-- **Expected Behavior**: Renders text with a max width of 300px. By default shows single line with ellipsis, but can display multiple lines when lineClamp prop is provided.
+- **Expected Behavior**: Renders text with a max width of 300px. By default, it shows a single line with ellipsis, but can display multiple lines when the lineClamp prop is provided. For displaying the full text on hover, wrap this component with MUI's Tooltip component.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~10-~10: Did you mean: “By default,”?
Context: ...Renders text with a max width of 300px. By default shows single line with ellipsis, but ca...

(BY_DEFAULT_COMMA)


14-18: Add package-specific use cases

Replace generic examples with actual use cases from the BaseApp Frontend packages. For example:

  • Truncating navigation menu items
  • Handling long titles in card components
  • Managing text overflow in specific layouts

34-45: Add tooltip integration example

The example should demonstrate how to combine TypographyWithEllipsis with Tooltip:

 import { TypographyWithEllipsis } from '@baseapp-frontend/design-system'
+import { Tooltip } from '@mui/material'
 
 const MyComponent = () => {
+  const text = 'This is a long text that should be truncated with an ellipsis.'
   return (
-    <TypographyWithEllipsis lineClamp={2}>
-      This is a long text that should be truncated with an ellipsis.
-    </TypographyWithEllipsis>
+    <Tooltip title={text}>
+      <TypographyWithEllipsis lineClamp={2}>
+        {text}
+      </TypographyWithEllipsis>
+    </Tooltip>
   )
 }
packages/design-system/components/inputs/TextareaField/__storybook__/TextareaField.mdx (3)

3-3: Update the title format

Per PR comments, update the title to match the correct format:

-<Meta title="@baseapp-frontend | designSystem/Inputs/TextareaField" />
+<Meta title="Design System/Inputs/TextareaField" />

9-10: Add technical implementation details

The description should include:

  • How the form controller integration works
  • Whether the component is controlled or uncontrolled by default
  • Event handling specifics

43-43: Fix TypeScript syntax in example

There's a syntax error in the useState generic type declaration:

-  const [value, setValue] = useState < string > ''
+  const [value, setValue] = useState<string>('')
packages/design-system/components/avatars/ClickableAvatar/__storybook__/ClickableAvatar.mdx (2)

3-3: 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" />

44-51: Replace hardcoded image URL with a placeholder

The example uses a hardcoded DigitalOcean Spaces URL which may not be accessible and could become invalid.

      <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}
      />
packages/design-system/components/drawers/SwipeableDrawer/__storybook__/SwipeableDrawer.mdx (2)

3-3: Update the documentation title format

Per the PR comments, remove "@baseapp-frontend" from the title as it's incorrect for package documentation.

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

62-66: Remove spread operator with unknown args

Using the spread operator with unknown args ({...args}) can lead to security vulnerabilities and unexpected behavior.

-      <SwipeableDrawer {...args} open={open} onClose={handleClose} onOpen={handleOpen}>
+      <SwipeableDrawer
+        open={open}
+        onClose={handleClose}
+        onOpen={handleOpen}
+        anchor="bottom"
+      >
packages/design-system/components/dialogs/ConfirmDialog/__storybook__/ConfirmDialog.mdx (3)

3-3: Update the Storybook title according to the new convention

As per the PR comments, the title should not include "@baseapp-frontend".

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

14-23: Replace generic use cases with actual BaseApp implementations

Instead of listing generic use cases, document specific implementations within BaseApp.

For each use case:

  • Reference the actual component/page where it's being used
  • Describe the specific confirmation scenarios
  • Include any custom configurations used

67-73: 🛠️ Refactor suggestion

Add accessibility attributes to the dialog

The dialog example should include ARIA attributes for better accessibility.

       <ConfirmDialog
         open={open}
         title="Are you sure?"
         content="This action cannot be undone."
         onClose={handleClose}
+        aria-labelledby="confirm-dialog-title"
+        aria-describedby="confirm-dialog-description"
         action={<Button onClick={handleConfirm}>Confirm</Button>}
       />

Likely invalid or redundant comment.

packages/wagtail/package.json (2)

4-4: Verify the rationale for the major version bump.

The version has been updated from 1.0.12 to 2.0.0, indicating breaking changes. However, the PR objectives only mention adding MDX documentation files, which typically wouldn't warrant a major version bump. Please verify if there are breaking changes that justify this major version increment.

✅ Verification successful

Major version bump (2.0.0) is justified

The version bump reflects significant breaking changes across the ecosystem, including:

  • Architectural changes in provider handling and async operations
  • Breaking changes from React Query v5 integration
  • Removal of dependencies to prevent circular dependencies
  • New toast bar system implementation
  • Changes in token refresh flow and user management
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for breaking changes in the codebase and changelog

# Check for BREAKING CHANGE commits
git log --grep="BREAKING CHANGE" -i --since="1 month ago"

# Check for changelog entries
fd -g "CHANGELOG.md" -x cat {} | grep -A 5 "2.0.0"

Length of output: 1630


Line range hint 31-34: Verify peer dependency versions are in sync.

Since this package depends on @baseapp-frontend/design-system and other workspace packages, ensure that all dependency versions are properly synchronized to avoid potential compatibility issues.

Comment on lines +3 to +8
## 1.0.0

### Major Changes

- MDX documentation files added for several components

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Version and changelog details need improvement

  1. The major version bump (1.0.0) seems inconsistent with the nature of changes:

    • Documentation additions typically don't warrant a major version bump
    • Consider using a minor or patch version instead
  2. The changelog entry lacks specific details:

    • List the specific components that received MDX documentation
    • This helps track documentation coverage and makes the changelog more useful

Consider:

  1. Using an appropriate version number that matches the nature of the changes
  2. Expanding the changelog entry to list specific components:
 ### Major Changes
 
-MDX documentation files added for several components
+MDX documentation files added for the following components:
+- Popover
+- TextField
+- SocialTextField
+- TextareaField
+- Logo
+- IconButton
+- TypographyWithEllipsis
+- SwipeableDrawer
+- ClickableAvatar
+- AvatarWithPlaceholder
+- ConfirmDialog
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## 1.0.0
### Major Changes
- MDX documentation files added for several components
## 1.0.0
### Major Changes
MDX documentation files added for the following components:
- Popover
- TextField
- SocialTextField
- TextareaField
- Logo
- IconButton
- TypographyWithEllipsis
- SwipeableDrawer
- ClickableAvatar
- AvatarWithPlaceholder
- ConfirmDialog

Comment on lines +9 to +10
- **Purpose**: A customizable text input field component that wraps MUI's TextField with responsive sizing and form controller functionality.
- **Expected Behavior**: Renders a text input that automatically adjusts size based on screen width when responsive mode is enabled. The component is wrapped with form controller capabilities by default.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Document validation states and error handling

The purpose mentions form controller functionality, but validation states and error handling are not documented. Please add:

  1. Available validation states
  2. How to trigger each state
  3. Visual indicators for each state
  4. Associated props for validation handling

Comment on lines +14 to +24
- **Current Usage**:
- Login/Registration forms
- Search inputs
- Data entry forms
- Contact forms
- **Potential Usage**:
- Filtering interfaces
- In-line editing
- Dynamic form generation
- Auto-complete fields

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add BaseApp-specific use cases

Per PR feedback, replace generic use cases with specific examples from BaseApp implementation. Consider:

  1. Adding real examples from BaseApp implementation
  2. Describing specific integration points
  3. Including screenshots or links to live examples

@@ -0,0 +1,62 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="@baseapp-frontend | designSystem/Inputs/TextField" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update the title format

Per PR comments, update the title to match the correct format:

-<Meta title="@baseapp-frontend | designSystem/Inputs/TextField" />
+<Meta title="@baseapp-frontend-packages | designSystem/Inputs/TextField" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Meta title="@baseapp-frontend | designSystem/Inputs/TextField" />
<Meta title="@baseapp-frontend-packages | designSystem/Inputs/TextField" />

```javascript
import { TextField } from '@baseapp-frontend/design-system'
const MyComponent = () => {
const [value, setValue] = useState < string > ''
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix TypeScript syntax

Remove spaces around the type parameter:

-  const [value, setValue] = useState < string > ''
+  const [value, setValue] = useState<string>('')
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const [value, setValue] = useState < string > ''
const [value, setValue] = useState<string>('')

@joaosoutto joaosoutto merged commit ec64dcf into master Jan 8, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants