Conversation
🦋 Changeset detectedLatest commit: 473855c The changes in this PR will be included in the next version bump. 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 💥 An error occurred when fetching the changed packages and changesets in this PR |
🕸 Website previewYou can view a preview here (commit |
🕸 Storybook previewYou can view a preview here (commit |
There was a problem hiding this comment.
Pull request overview
This PR adds a new @sl-design-system/infotip web component package to the components monorepo and wires it into the TypeScript project references/build, along with the expected workspace dependency/lockfile updates.
Changes:
- Introduce new
sl-infotipcomponent (Lit + scoped elements) with Storybook stories, styles, and Vitest specs. - Register the new component package in
tsconfig.all.jsonand add its per-packagetsconfig.json. - Update
yarn.lockto include the new workspace package and various dependency resolution updates.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
yarn.lock |
Adds the new @sl-design-system/infotip workspace entry and updates multiple dependency resolutions. |
tsconfig.all.json |
Adds the packages/components/infotip TS project reference. |
packages/components/infotip/tsconfig.json |
New TS composite project config for the infotip package. |
packages/components/infotip/package.json |
New package manifest for publishing and dependency declarations. |
packages/components/infotip/index.ts |
Barrel export for the component implementation. |
packages/components/infotip/register.ts |
Defines the sl-infotip custom element. |
packages/components/infotip/src/infotip.ts |
Implements the infotip trigger + popover behavior and public API. |
packages/components/infotip/src/infotip.scss |
Minimal host layout styling. |
packages/components/infotip/src/infotip.stories.ts |
Storybook stories demonstrating usage. |
packages/components/infotip/src/infotip.spec.ts |
Vitest specs for defaults, toggle behavior, slot content, and icon prop passing. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 40 out of 41 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
packages/components/form/src/label.scss:16
color: var(--sl-color-foreground-bold)was moved from:hostto::slotted([slot='label']). As a result, the.optional/.requiredindicator text no longer inherits the bold foreground color and will render with the parent’s default text color.
If the intent is for the optional/required indicator to visually match the label, explicitly set its color (or keep the host color and override only the infotip slot styling).
:host {
align-items: center;
display: inline-flex;
gap: var(--sl-size-050);
}
::slotted([slot='label']) {
color: var(--sl-color-foreground-bold);
font-weight: var(--sl-text-new-typeset-fontWeight-semiBold);
}
.optional,
.required {
font-weight: var(--sl-text-new-typeset-fontWeight-regular);
margin-inline-start: var(--sl-size-050);
}
| this.#infotip = infotip; | ||
|
|
||
| if (this.control && infotip.contentId) { | ||
| const describedby = this.control.formControlElement.getAttribute('aria-describedby'), |
There was a problem hiding this comment.
issue: I think there is a stale aria-describedby issue in the sl-form-field integration
#onLabelSlotchange() only appends the infotip contentId to the control, but it never removes the previous ID again. It also only reacts to slotchange on the label slot, so removing or replacing <sl-infotip> inside the same <sl-label> does not trigger any cleanup
That means the input can keep an old aria-describedby value that points to a node that no longer exists, because sl-infotip removes its copied content on disconnect
Summary
Adds the new
sl-infotipcomponent — an info icon button that triggers a popover showing contextual content. It is designed to be placed in theinfotipslot of<sl-label>inside a<sl-form-field>.Closes #2111
Changes
@sl-design-system/infotip(new package)sl-infotiprenders a ghost icon button (default:circle-info) that toggles ansl-popoveron click or keyboard activationiconslotslotAssignment: 'manual'and aMutationObserverto keep a light DOM<div>content copy in sync with the original slotted contentsl-infotip-content-<n>id exposed via thecontentIdproperty — this is what other components use foraria-describedby@sl-design-system/form<sl-label>gains aninfotipslot sosl-infotipcan be placed alongside the label text<sl-form-field>detects ansl-infotipin the label slot and adds itscontentIdtoaria-describedbyon the associated form control's native input, ensuring screen readers announce the infotip content when the input receives focusOther
aria-describedbyaccessibility wiringinfotipandformUsage