Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds `iconVariant` (`bare` | `error` | `inverse` | `warning`) to match `icon-variant` on `lightning-helptext`. It styles the info icon that Tooltip renders when no children are passed, including field-level help: - `inverse`: `slds-button_icon-bare slds-button_icon-inverse`, the same classes LWC emits for `bare-inverse` - `warning` / `error`: `slds-icon-text-warning` / `slds-icon-text-error` on the icon Defaults to `bare`, which renders the same markup as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additional description
Adds an
iconVariantprop toTooltip, matchingicon-variantonlightning-helptext. It styles the info icon that Tooltip renders when no children are passed. Field-level help (fieldLevelHelpTooltipon Input, Combobox, and so on) uses that trigger too, so it gets the prop. I checked the class logic against thehelptextandbuttonIconsource inlightning-base-componentsand thelightning-helptextreference.iconVariantonClickTriggerlink triggerbare(default)inverseslds-button_icon-bare slds-button_icon-inverse(same classes as LWC'sbare-inverse)Iconwithinversewarningslds-icon-text-warningon the iconIconwithcolorVariant="warning"errorslds-icon-text-erroron the iconIconwithcolorVariant="error"For
inverse, Tooltip passesiconVariant="bare"along withinversetoButton. Withinversealone,Buttondropsslds-button_iconfrom an icon button, and the markup would no longer match LWC's.Buttonitself is unchanged.iconVarianthas no effect when children are passed; a custom trigger keeps its own styling.Not a breaking change: the prop is new and optional, and the
baredefault renders the same markup as before. The only snapshot change is the new story.Commits:
style(tooltip)is formatting only. The pre-commit hook formats whole files, and these three weren't formatted on master. It changes only whitespace and punctuation. Thefeatcommit has the functional diff.Tests and stories
tooltip.test.jsx): classes for each variant on the button trigger and theonClickTriggerlink trigger, the unchanged default, and custom children being left alone.IconVariantsstory shows all four values (inverseon aslds-theme_inversebackground), plus aniconVariantStorybook control.rgb(117,117,117)for default,rgb(130,81,1)for warning,rgb(186,5,23)for error, andrgb(255,255,255)for inverse, on both trigger types. This was a one-off script, not a committed test.CONTRIBUTOR checklist (do not remove)
Please complete for every pull request.
Green gate — all of these must pass locally (CI runs the same):
npm run lintpasses with 0 errors (npm run lint:fixto auto-fix). Warnings are the tracked gradual-migration backlog; do not add new errors.npm run typecheckis clean (tsc --noEmit).npm test -- --runpasses — this runs both Vitest projects (jsdomunit+ real-browserbrowser) and the story HTML snapshots. If you changed rendered markup on purpose, update snapshots withnpm test -- --run -uand review the diff.npm run buildsucceeds (type-check + Vite library build +.d.ts+ entry shims).Behavior & docs:
components/button/__tests__). New props and bug fixes should get a regression test. Tests that genuinely need a real browser (focus traversal, layout/measurement, canvas) go in a*.browser.test.jsxfile (thebrowserproject); everything else is jsdom.npm run storybook→ http://localhost:6007/. Confirm the story actually renders and behaves (deprecated Storyshots/Karma are gone; there is no separate browser-tests server).onRenderContent/onRenderVisualPicker,iconprops,events), not assumptions — a common source of "component looks broken" reports has been stories authored against the wrong API. Cross-check againstcomponents/<name>/__examples__..d.ts(they're generated by the build); JS consumers rely on them via editor type-acquisition.REVIEWER checklist (do not remove)
CIworkflow: lint, typecheck, test, build). Chromatic visual review, if configured, has been checked.components/__tests__/__snapshots__/story-snapshots.test.jsx.snap).@salesforce/design-system-react/components/<name>and nested paths resolve for ESM, CJS, and types). Removing/renaming a public component or export is a breaking change →feat!:/BREAKING CHANGE:and a major version bump.