{"version":3,"file":"TagList.cjs","names":["_react","require","_TagListContext","_jsxRuntime","_interopRequireDefault","e","__esModule","default","TagList","ariaLabel","children","testId","providerValue","useMemo","chipElementType","jsx","_Stack2","component","direction","flexWrap","spacing","useFlexGap","TagListContext","Provider","value","MemoizedTagList","exports","memo","displayName"],"sources":["../../src/TagList.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Stack } from \"@mui/material\";\nimport { memo, ReactElement, useMemo } from \"react\";\n\nimport { HtmlProps } from \"./HtmlProps.js\";\nimport { Tag } from \"./Tag.js\";\nimport { ChipElementType, TagListContext } from \"./TagListContext.js\";\n\nexport type TagListProps = {\n  /**\n   * The Tag or array of Tags within the TagList\n   */\n  children: ReactElement<typeof Tag> | Array<ReactElement<typeof Tag>>;\n} & Pick<HtmlProps, \"ariaLabel\" | \"testId\">;\n\n/**\n * A horizontal, wrapping list of Tag elements rendered as a semantic `<ul>`. Use to display a collection of tags associated with an item or entity.\n */\nconst TagList = ({ ariaLabel, children, testId }: TagListProps) => {\n  const providerValue = useMemo<{\n    chipElementType: ChipElementType;\n  }>(\n    () => ({\n      chipElementType: \"li\",\n    }),\n    [],\n  );\n\n  return (\n    <Stack\n      aria-label={ariaLabel}\n      component=\"ul\"\n      data-se={testId}\n      direction=\"row\"\n      flexWrap=\"wrap\"\n      spacing={2}\n      useFlexGap\n    >\n      <TagListContext.Provider value={providerValue}>\n        {children}\n      </TagListContext.Provider>\n    </Stack>\n  );\n};\n\nconst MemoizedTagList = memo(TagList);\nMemoizedTagList.displayName = \"TagList\";\n\nexport { MemoizedTagList as TagList };\n"],"mappings":";;;;;;;AAaA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,eAAA,GAAAD,OAAA;AAAsE,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAjBtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAmBA,MAAMG,OAAO,GAAGA,CAAC;EAAEC,SAAS;EAAEC,QAAQ;EAAEC;AAAqB,CAAC,KAAK;EACjE,MAAMC,aAAa,GAAG,IAAAC,cAAO,EAG3B,OAAO;IACLC,eAAe,EAAE;EACnB,CAAC,CAAC,EACF,EACF,CAAC;EAED,OACE,IAAAX,WAAA,CAAAY,GAAA,EAAAC,OAAA,CAAAT,OAAA;IACE,cAAYE,SAAU;IACtBQ,SAAS,EAAC,IAAI;IACd,WAASN,MAAO;IAChBO,SAAS,EAAC,KAAK;IACfC,QAAQ,EAAC,MAAM;IACfC,OAAO,EAAE,CAAE;IACXC,UAAU;IAAAX,QAAA,EAEV,IAAAP,WAAA,CAAAY,GAAA,EAACb,eAAA,CAAAoB,cAAc,CAACC,QAAQ;MAACC,KAAK,EAAEZ,aAAc;MAAAF,QAAA,EAC3CA;IAAQ,CACc;EAAC,CACrB,CAAC;AAEZ,CAAC;AAED,MAAMe,eAAe,GAAAC,OAAA,CAAAlB,OAAA,GAAG,IAAAmB,WAAI,EAACnB,OAAO,CAAC;AACrCiB,eAAe,CAACG,WAAW,yCAAY","ignoreList":[]}