"use strict";const e=require("react/jsx-runtime"),d=require("react"),j=require("./heading-DLCdW6gx.js"),_=require("./bind-DeUYJ6m9.js"),k=require("./close.es-VL3lKi1O.js"),b={"purpur-dismissable-chip-group":"_purpur-dismissable-chip-group_17jk4_1","purpur-dismissable-chip-group__container":"_purpur-dismissable-chip-group__container_17jk4_7","purpur-dismissable-chip-group__container--full-width":"_purpur-dismissable-chip-group__container--full-width_17jk4_14","purpur-dismissable-chip-group-item-wrapper":"_purpur-dismissable-chip-group-item-wrapper_17jk4_17","purpur-dismissable-chip-group-item":"_purpur-dismissable-chip-group-item_17jk4_17","purpur-dismissable-chip-group-item--disabled":"_purpur-dismissable-chip-group-item--disabled_17jk4_43"},n=_.c.bind(b),c="purpur-dismissable-chip-group-item",h=({children:r,id:i,onDismiss:p,disabled:s,...a})=>{const u=l=>{s?l.preventDefault():p?.(i)};return e.jsx("li",{className:n(`${c}-wrapper`),children:d.createElement("button",{...a,className:n(`${c}`,{[`${c}--disabled`]:s}),key:i,disabled:s,"aria-disabled":s,onClick:u},r,e.jsx(k.r,{size:"sm"}))},i)};h.displayName="DismissableChipGroupItem";const m=_.c.bind(b),o="purpur-dismissable-chip-group",t=({children:r,className:i,fullWidth:p=!1,title:s,titleTag:a,...u})=>{const l=d.useId(),g=m([o,i]);return e.jsxs("div",{...u,"aria-labelledby":s?`${l}-label`:void 0,className:g,role:"group",children:[s&&e.jsx(j.Heading,{tag:a??"h2",variant:"subsection-100",children:s}),e.jsx("ul",{"data-testid":"dismissable-chip-group-container",className:m(`${o}__container`,{[`${o}__container--full-width`]:p}),"aria-live":"polite","aria-relevant":"additions removals",children:r})]})};t.Item=h;t.displayName="DismissableChipGroup";exports.DismissableChipGroup=t;
//# sourceMappingURL=dismissable-chip-group-DsO2cZaF.js.map
