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

Link Component #5502

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Link Component #5502

wants to merge 23 commits into from

Conversation

Zystix
Copy link
Contributor

@Zystix Zystix commented Feb 4, 2025

Why

Creating a new Link component.

https://cultureamp.atlassian.net/browse/KZN-2593

What

Adds the Link component, storybook tests, sticker sheets, API spec and usage guidelines.

Copy link

changeset-bot bot commented Feb 4, 2025

🦋 Changeset detected

Latest commit: 0e52fc5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@kaizen/components Minor
@docs/storybook Minor

Not sure what this means? Click here to learn what changesets are.

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

@Zystix Zystix marked this pull request as ready for review February 4, 2025 22:52
@Zystix Zystix requested a review from a team as a code owner February 4, 2025 22:52
Copy link
Contributor

github-actions bot commented Feb 4, 2025

✨ Here is your branch preview! ✨

Last updated for commit 0e52fc5: PR Feedback

@Zystix Zystix marked this pull request as draft February 4, 2025 23:12
@Zystix Zystix marked this pull request as ready for review February 5, 2025 23:36
return (
<FrontendServices {...config}>
{/* application code */}
<RacRouterProvider navigate={(href, opts) => router.push(href, undefined, opts)}>
Copy link
Contributor

Choose a reason for hiding this comment

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

can we make this provider part of next-services so it works for the consuming teams out of the box and without extra config?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @jakubriedl did you mean before this release goes out?

I certainly think that makes sense as a future / subsequent goal, but don't think it should block this specific release since the component is agnostic to the routing solution and standard hrefs will work out of the box.

Potentially a good opportunity for @Zystix once this is done (noting we only have him till the end of Feb), but will also raise with the team to see when we can prioritize the work

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah totally agree this shouldn't be blocker. But I'd add it there at the same time as it's just small change and write the documentation in the expects it to be there. It'll save you a lot of explaining to teams what they have to do, just say in the docs "have up-to-date next-services" and you can skip this whole section. Easier for you, and for the consumer as well

Comment on lines +23 to +27
<Controls
of={Link.Playground}
include={['href', 'variant', 'size', 'isDisabled', 'icon', 'iconPosition']}
className="mb-64"
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're exposing the storybook controls for something like icon, which needs a JSX element we're going to need to create a mapping in the argsTypes to provide a could of options for anyone landing on this page :)

In our Link.docs.stories.tsx what we'll want to do is something like this:

const meta = {
  // ...other meta properties
  argTypes: {
// creates a mapping for the icon property
    icon: {
// provide 3 options they can select
      options: ['delete', 'arrow', 'add'],
      mapping: {
// maps each of these keys to the options (needs to exactly match)
        delete: <Icon isPresentational name="delete" />,
        arrow: <Icon isPresentational name="arrow_forward" />,
        add: <Icon isPresentational name="add" />,
      },
    },
  },

isUnderlined: true,
isReversed: false,
size: 'body',
},
Copy link
Contributor

Choose a reason for hiding this comment

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

This is where we want to add those mappings for icon, otherwise folks will get this error if they try to update the icon property on this page 😉
Screenshot 2025-02-06 at 2 56 30 pm

docs/pages/client-side-routing.mdx Show resolved Hide resolved
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.

3 participants