-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Add Button #23
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
feat: Add Button #23
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new Button component to the Vue component library with primary and secondary variants, outlined styles, color options, and support for both button and link functionality.
- Implements a flexible Button component with TypeScript support and comprehensive styling
- Creates Button.stories.js with multiple story variants for Storybook documentation
- Adds SCSS styling with hover states, disabled states, and color variants
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| button.types.ts | Defines TypeScript interfaces and enums for button component props |
| _button.scss | Implements comprehensive styling for button variants, states, and hover effects |
| Button.stories.js | Creates Storybook stories showcasing all button variants and configurations |
| Button.vue | Main button component implementation with conditional rendering for links vs buttons |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| type: "button", | ||
| isDisabled: false, | ||
| isOutlined: false, | ||
| isGrey: false, |
Copilot
AI
Aug 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prop isGrey is defined in the defaults but doesn't exist in the ButtonProps interface. This will cause a TypeScript error and the prop is unused in the component.
| isGrey: false, |
| text: "Secondary Button", | ||
| variant: ButtonVariant.Secondary, | ||
| onClick: () => { | ||
| alert("Secondray Button Clicked!") |
Copilot
AI
Aug 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in alert message: "Secondray" should be "Secondary".
| alert("Secondray Button Clicked!") | |
| alert("Secondary Button Clicked!") |
| variant: ButtonVariant.Secondary, | ||
| isOutlined: true, | ||
| onClick: () => { | ||
| alert("Secondray Button Clicked!") |
Copilot
AI
Aug 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in alert message: "Secondray" should be "Secondary".
| alert("Secondray Button Clicked!") | |
| alert("Secondary Button Clicked!") |
| variant: ButtonVariant.Secondary, | ||
| color: ButtonColor.Grey, | ||
| onClick: () => { | ||
| alert("Secondray Button Clicked!") |
Copilot
AI
Aug 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in alert message: "Secondray" should be "Secondary".
| alert("Secondray Button Clicked!") | |
| alert("Secondary Button Clicked!") |
| isOutlined: true, | ||
| color: ButtonColor.Grey, | ||
| onClick: () => { | ||
| alert("Secondray Button Clicked!") |
Copilot
AI
Aug 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in alert message: "Secondray" should be "Secondary".
| alert("Secondray Button Clicked!") | |
| alert("Secondary Button Clicked!") |
| variant: ButtonVariant.Secondary, | ||
| isDisabled: true, | ||
| onClick: () => { | ||
| alert("Secondray Button Clicked!") |
Copilot
AI
Aug 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in alert message: "Secondray" should be "Secondary".
| alert("Secondray Button Clicked!") | |
| alert("Secondary Button Clicked!") |
| &.secondary { | ||
| padding: 9px 20px; | ||
| border-radius: 5px; | ||
| background-color: $accent-blue; |
Copilot
AI
Aug 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent use of SCSS variables vs CSS custom properties. Line 37 uses $accent-blue while other lines use CSS custom properties like var(--color-secondary-blue-01). Consider using CSS custom properties consistently for better maintainability.
| background-color: $accent-blue; | |
| background-color: var(--color-secondary-blue-01); |
| &.is-outlined { | ||
| background-color: transparent; | ||
| border: 1px solid $subtitle-grey; | ||
| color: $subtitle-grey; |
Copilot
AI
Aug 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent use of SCSS variables vs CSS custom properties. Line 61 uses $subtitle-grey while other lines use CSS custom properties. Consider using CSS custom properties consistently.
| color: $subtitle-grey; | |
| background-color: var(--color-subtitle-grey); | |
| color: var(--color-white); | |
| &.is-outlined { | |
| background-color: transparent; | |
| border: 1px solid var(--color-subtitle-grey); | |
| color: var(--color-subtitle-grey); |
❌ Deploy Preview for ucla-components-storybook failed. Why did it fail? →
|
Component Created: Button.vue
Stories: ~/stories/Button.stories.js
Notes:
Added Button.vue with Primary and Secondary variants.
Checklist:
library-website-nuxt dev server