Skip to content

Conversation

@raymondanythings
Copy link
Contributor

docs: add props-table into button docs

Summary

  • add a reusable PropsTable MDX component that composes the shared table primitives and renders prop metadata with markdown-aware code blocks
  • migrate the Button API documentation to use the new component and wire it into the component detail page renderer
  • move table styling into the MDX table components, enhance the inline code block renderer, and expose the needed prop types from @devup-ui/react

@changeset-bot
Copy link

changeset-bot bot commented Oct 26, 2025

⚠️ No Changeset found

Latest commit: 505b593

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

@raymondanythings raymondanythings force-pushed the docs/button-api branch 2 times, most recently from 0257ed0 to dc76fd8 Compare October 26, 2025 15:03
Comment on lines 66 to 68
export function Table() {
return <></>
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove empty function

return <Box as="th" padding="0.5rem 1rem" textAlign="left" {...props} />
}

export { TableBody, TableCell, TableHead, TableHeaderCell, TableRoot, TableRow }
Copy link
Contributor

Choose a reason for hiding this comment

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

Add export with function declaration

return (
<Box
as="thead"
{...props}
Copy link
Contributor

Choose a reason for hiding this comment

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

Devup UI Works with static analysis.
So props for stying can not be applied...

@raymondanythings
Copy link
Contributor Author

raymondanythings commented Oct 27, 2025

@owjs3901
Thanks for your response

I've committed the changes to address the current issues. However, I'd like to raise a concern about the @devup/component lint rule that requires component names to match their file names.

The existing lint rule enforces that each file must export a component with the same name as the file. While I understand this rule was likely designed to prevent namespace component patterns (which devup-ui doesn't support), it's inadvertently blocking the compound component pattern, which devup-ui does support.
Impact
Due to this rule, I had to split what could have been a single compound component file into multiple separate files ㄴ

  • TableRoot.tsx
  • TableHead.tsx
  • TableBody.tsx
  • TableCell.tsx

This structure makes it difficult to use the compound component pattern.

I suggest that modify the @devup/component lint rule to allow compound component patterns. This would enable developers to export multiple related components from a single file while still maintaining code organization and leveraging devup-ui's capabilities.

@owjs3901
Copy link
Contributor

I agree with your point to some extent.
However, in actual production development, we found that when the exported component name doesn’t match the file name, it often takes more time during handovers or when searching for new components. That’s why we decided to establish this rule.

That said, since the design allows exporting other functions from the same file as long as the main exported function matches the file name, I believe the pattern you mentioned can still be fully implemented.

return (
<Box
as="code"
bg="var(--containerBackground)"
Copy link
Contributor

Choose a reason for hiding this comment

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

using $containerBackground

import { Box } from '@devup-ui/react'
import { ComponentPropsWithoutRef } from 'react'

export const TableRoot = ({ ...props }: ComponentPropsWithoutRef<'table'>) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I’m just curious why did you exclude the ref props?
Why aren’t you using ComponentProps?

Copy link
Contributor Author

@raymondanythings raymondanythings Oct 27, 2025

Choose a reason for hiding this comment

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

Thanks for pointing that out!
If your question about ref of React 19, I actually missed that — I was assuming a pre-React-19 environment when implementing this. I’ll update it accordingly.

Otherwise, the reason is that ref isn’t treated as a normal prop in React.
To pass it down to a child component, forwardRef must be used.
Since this component doesn’t need to handle a ref, I didn’t include it.

@@ -0,0 +1,10 @@
import { Box } from '@devup-ui/react'
import { ComponentPropsWithoutRef } from 'react'
Copy link
Contributor

Choose a reason for hiding this comment

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

Add type keyword plrease

@owjs3901
Copy link
Contributor

@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@owjs3901 owjs3901 merged commit 7872547 into dev-five-git:main Oct 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants