feat(label-group): create pf-label-group element#2949
feat(label-group): create pf-label-group element#2949saraDahanCode wants to merge 37 commits intopatternfly:mainfrom
Conversation
🦋 Changeset detectedLatest commit: e465aa7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
…verflow, and basic label groups
|
@bennypowers When running the dev server, three TypeScript type errors occur in tools/pfe-tools/dev-server/config.ts: cors, cacheBusterMiddleware, liveReloadTsChangesMiddleware middlewares fail due to incompatible Koa types. The errors indicate Property 'back' is missing and type conflicts between different @types/koa versions. This prevents the dev server from starting and causes the tests to fail. Example snippet: 127 cors, // TS2322: Type '(ctx: Context, next: Next) => Promise' is not assignable to type 'Middleware' It seems related to multiple @types/koa versions being used in the project. |
|
@markcaron @bennypowers @zeroedin Hi, |
420bb96 to
bc5f6c9
Compare
elements/pf-label-group/demo/label-group-with-a-very-long-name.html
Outdated
Show resolved
Hide resolved
✅ Deploy Preview for patternfly-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
elements/pf-label-group/demo/label-group-add-label-custom-form.html
Outdated
Show resolved
Hide resolved
feat(label-group): change demo
elements/pf-label-group/demo/label-group-add-label-custom-form.html
Outdated
Show resolved
Hide resolved
elements/pf-label-group/demo/label-group-add-label-custom-form.html
Outdated
Show resolved
Hide resolved
- Remove add-label-mode concept; adding labels is external code's job - Remove add-label demos (auto, from-list, custom-form) - Align component with pf-chip-group patterns: - Use `@queryAssignedNodes` instead of manual slot querying - Use `?hidden` binding instead of conditional rendering (SSR-friendly) - Compute overflow text inline in template via `#remaining` getter - Handle removal via event listener pattern (cancelable) - Export proper Event subclasses - Fix CSS: - Replace hardcoded colors with PF global token fallbacks - Use CSS logical properties throughout - Add `::slotted([hidden])` rule (pf-label lacks `:host([hidden])`) - Remove `.add-label` styles - Add CSS custom property declarations on `:host` - Remove superfluous `type: String` from `@property` decorators - Add `@summary` JSDoc tag - Rewrite tests following pf-chip-group patterns: - Use `a11ySnapshot` assertions - Use `function()` instead of arrow functions - Add tests for overflow, closeable, num-labels, category, a11y - Clean up demos with minimal imports - Update changeset and README to match project conventions Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pf-label now dispatches a bubbling `ssr:label` event from connectedCallback during SSR. pf-label-group listens for this event and increments an internal label count, so the overflow template renders correctly on the server without querySelectorAll. Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Partially addresses #2935
What I did
<pf-label-group>element.<pf-label>elements with support for removable and overflow states.overflowbehavior that collapses extra labels into a "+N more" indicator.LabelGroupCloseEventwhen the whole group is closed./demo/pf-label-group/showing various configurations (horizontal, vertical, removable, overflow, and closable examples)..changesetfile with typeminorto trigger a release.Testing Instructions
npm startand openhttp://localhost:8000/elements/pf-label-group/demo/.LabelCloseEventis fired.npm run lintandnpm testto ensure all checks pass successfully.Notes to Reviewers
.changesetfile is set to minor, since this PR introduces a new element.