Skip to content

feat(Table): Add basic table component#103

Merged
tchock merged 3 commits into
mainfrom
feat/table
May 26, 2025
Merged

feat(Table): Add basic table component#103
tchock merged 3 commits into
mainfrom
feat/table

Conversation

@tchock
Copy link
Copy Markdown
Member

@tchock tchock commented May 26, 2025

No description provided.

@tchock tchock requested a review from Copilot May 26, 2025 16:50
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 26, 2025

size-limit report 📦

Path Size
Common JS 22.64 KB (+2.9% 🔺)
Button direct import (Common JS) 4.99 KB (0%)
Button Treeshaking 6.76 KB (+0.88% 🔺)
Input Treeshaking 3.9 KB (0%)
Tooltip Treeshaking 6.43 KB (0%)
ES Module 19.62 KB (+2.92% 🔺)

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@tchock tchock requested a review from Copilot May 26, 2025 20:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a basic Table component with its related styles, stories, and tests to support a new table feature.

  • Added tableStyles in the theme and updated the default component styles mapping.
  • Created the Table component along with its styles, stories, and tests.
  • Updated component primitive helper to support an extended template literal for styled components.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/theme/defaultComponentStyles.ts Added import and mapping for tableStyles.
src/styleHelpers/componentPrimitive.tsx Updated transformFn type and added extendedTemplate for styled components.
src/index.ts Exported the new Table component.
src/Table/styles.ts Defined Table styles following theme conventions.
src/Table/index.ts Re-exported Table module.
src/Table/Table.tsx Implemented the basic Table component with header, body, and cell primitives.
src/Table/Table.stories.tsx Provided story examples for the Table component.
src/Table/Table.spec.tsx Added unit tests to verify Table component rendering.

Comment on lines 17 to +19
<P extends object, I extends ComponentPrimitiveProps<P>>(
property: string | string[],
transformFn?: (value: unknown) => string | number
transformFn?: (value: unknown) => string | number | any
Copy link

Copilot AI May 26, 2025

Choose a reason for hiding this comment

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

Consider specifying a more precise return type instead of 'any' to maintain type safety.

Copilot uses AI. Check for mistakes.
{ tag = 'div' as any }: CreateComponentPrimitiveOptions<T> = {}
) =>
(template: TemplateStringsArray, ...styles: Array<Interpolation<ComponentPrimitiveProps<P>>>) => {
const extendedTemplate = Object.assign([...template, ''], { raw: [...template.raw, ''] });
Copy link

Copilot AI May 26, 2025

Choose a reason for hiding this comment

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

[nitpick] Adding a comment to explain the purpose of extending the template literal would improve maintainability.

Copilot uses AI. Check for mistakes.
@tchock tchock merged commit a2951cc into main May 26, 2025
4 checks passed
@tchock tchock deleted the feat/table branch May 26, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants