Skip to content

Conversation

ddouglasz
Copy link
Contributor

@ddouglasz ddouglasz commented Sep 10, 2025

This PR provides a sample template or what we can call an initial draft to building a workflow for our Nimbus component developer docs / Engineering guideline. It should serve as a base where as much feedback as possible is provided until we arrive at a satisfactory template that other components can build upon.

Copy link

changeset-bot bot commented Sep 10, 2025

⚠️ No Changeset found

Latest commit: 27715fe

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

Copy link

vercel bot commented Sep 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
nimbus-documentation Ready Ready Preview Comment Sep 19, 2025 1:00pm
nimbus-storybook Ready Ready Preview Comment Sep 19, 2025 1:00pm

export const LiveCodeEditor = (props: LiveCodeEditorProps) => {
const [code, setCode] = useState(props.children);
const [activeTab, setActiveTab] = useState<"preview" | "editor">("preview");
const [activeTab, setActiveTab] = useState<"preview" | "editor">(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to introduce this change since we agreed that for the engineering guideline, the code editor should be the default view.


Component Anatomy here - image with parts and description as can be seen on [combobox](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?node-id=5311-13804&p=f&m=dev) for example

![](/images/tooltip/tooltip.png)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is likely not relevant to this component but since this is almost like a Poc, I added it. The idea is the component anatomy image might not be necessary for simple components so it is optional.

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 very valuable conceptually, especially for consumers who prefer to learn visually. I think it'd be worth including in every guideline

)
```

```....Add example snippets for each relevant component prop```
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In react aria, the docs showcases a good number of the relevant props use cases with code snippets. Should we consider doing the same thing?


### API Reference

<PropsTable id="Tooltip" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We still need a different topic to discuss how we would manually add props. The exposed props listing on the props table does not capture a lot of the important props.

Comment on lines +91 to +97
| UI Kit Component | Nimbus Component | Notes |
|------------------|------------------|-------|
| `<Tooltip>` | `<Tooltip.Root>` + `<Tooltip.Content>` | Now uses compound component pattern |
| `title` prop | `<Tooltip.Content>` children | Text content now goes as children |
| `isOpen` prop | `isOpen` prop | ✅ Same API |
| `onClose` | `onOpenChange` | ⚠️ Renamed, now receives boolean parameter |
| `horizontalConstraint` | Not supported | ❌ Removed - use CSS or container sizing |
Copy link
Contributor

Choose a reason for hiding this comment

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

Beautiful. I cried. 10/10

- **Testing**: Include both providers in test wrapper
- **Accessibility**: Built-in ARIA support, keyboard navigation included

### Migration Checklist
Copy link
Contributor

Choose a reason for hiding this comment

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

This should calm some nerves - it may not ever be totally complete for every instance but that's a lovely idea.


Use the [Nimbus storybook Tooltip component story](https://nimbus-storybook-6l4m4g78g-commercetools.vercel.app/?path=/docs/components-tooltip-tooltip--docs) as a playground for visual testing of the component.

#### 3. Regression tests
Copy link
Contributor

Choose a reason for hiding this comment

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

Anything in here?

Copy link
Contributor Author

@ddouglasz ddouglasz Sep 19, 2025

Choose a reason for hiding this comment

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

Its kind of a placeholder for now since we have not fully come up with a regression test strategy yet.

- `delay` and `closeDelay`: More granular control over timing
- `horizontalConstraint`: Use CSS width constraints on content instead
- `tone`: Styling is now handled through design tokens

Copy link
Contributor

Choose a reason for hiding this comment

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

For discussion: should there be a pitfalls/don'ts section for devs?

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have any examples? Do the design guidelines suffice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes the design guideline does that already, but good point, I think we can have a note somewhere that states something like "for design guidelines, see [link]".

Copy link
Contributor

@tylermorrisford tylermorrisford left a comment

Choose a reason for hiding this comment

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

This is absolutely what I would want. I know it will be a big lift to provide this for every component but this should make life so much easier 🙏

Copy link
Contributor

@stephsprinkle stephsprinkle left a comment

Choose a reason for hiding this comment

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

I think this is a great place to start. Are we going to look into tabs (one for design, dev, and migration) for the final product?


```....Add example snippets for each relevant component prop```

### API Changes
Copy link
Contributor

Choose a reason for hiding this comment

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

This section feels like it belongs in the migration guide

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes, I added it there too. I can take it out from here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are we going to look into tabs (one for design, dev, and migration) for the final product?

Yes, I thinks we discussed exploring that possibility.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, this belongs in the migration guide

- `delay` and `closeDelay`: More granular control over timing
- `horizontalConstraint`: Use CSS width constraints on content instead
- `tone`: Styling is now handled through design tokens

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have any examples? Do the design guidelines suffice?

Comment on lines +116 to +123
// Test wrapper with required providers
const TestWrapper = ({ children }: { children: React.ReactNode }) => (
<IntlProvider locale="en" messages={{}} defaultLocale="en">
<NimbusProvider>
{children}
</NimbusProvider>
</IntlProvider>
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't we going to put NimbusProvider into App Kit? One of Tobi's biggest complaints was this here pattern in tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we are doing that, then that would be great!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you have any examples? Do the design guidelines suffice?

Yes, I think we can point to the guidelines here

```tsx
<Tooltip.Root>
<Button>Button</Button>
<Tooltip.Content style={{ maxWidth: '200px' }}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Forgive my ignorance, isn't one of the main benefits of Nimbus that we can put styles directly on our components like maxWidth="200px"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, forgive my ignorance actually 😅
You are correct!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made some updates here to handle most of the feedback 27715fe
Thank you.

…mentation

- Adjusted JSX formatting in tooltip examples for consistency.
- Updated migration guide to clarify usage of `maxWidth` property in Tooltip.Content.
- Added caution note regarding provider availability in testing setups.
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.

4 participants