-
Notifications
You must be signed in to change notification settings - Fork 173
Added Link Component to Svelte | Cursor Rules for Effecient React to Svelte Migration #3020
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
base: feat/svelte-impl
Are you sure you want to change the base?
Conversation
|
|
❌ PR title doesn't follow Conventional Commits specification. Details: |
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.
nice
packages/blade-svelte/src/components/Link/BaseLink/baseLink.css
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,43 @@ | |||
| .base-link { | |||
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.
is font-family not defined in our react BaseLink? can you check how fonts are working in react and if we can get that implemented in svelte as well?
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.
we can do it in separate PR
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.
Ideally fonts come via Typography components. I will replace those as well once I start working on Typegraphy
packages/blade-svelte/src/components/Link/BaseLink/BaseLink.svelte
Outdated
Show resolved
Hide resolved
packages/blade-svelte/src/components/Link/BaseLink/BaseLink.svelte
Outdated
Show resolved
Hide resolved
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.
no need to define this file right?
also maybe having directory structure defined in cursor rule would avoid the naming inconsistencies Link.css vs baseLink.css
| "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch" | ||
| }, | ||
| "dependencies": { | ||
| "@razorpay/blade-core": "0.0.1" |
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.
nice
| // TODO: Replace with actual Icon component when available | ||
| type IconComponent = any; | ||
| interface BaseLinkProps { |
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.
TODO: Once we have few more components, figure out if we want to move types to a common place. Types can act as contracts to help avoid API drift and React vs Svelte. // @saurabhdaware
| if (color && color !== 'primary') { | ||
| if (color !== 'white') { | ||
| return `var(--interactive-${element}-${color}-${stateKey})`; |
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.
Maybe we can create a svelte equivalent of getIn function to make variable interpolation typesafe.
Instead of returning the value, it can construct the var string internally.
| }, | ||
| }); | ||
| // Accessibility attributes |
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.
redundant comments
| // Accessibility attributes |
Description
Added Initial Changes for Blade Svelte Migration
Changes
Additional Information
Component Checklist