{"version":3,"file":"Accordion.cjs","names":["_react","require","_index","_Typography","_useUniqueId","_jsxRuntime","_interopRequireDefault","e","__esModule","default","accordionVariantValues","exports","Accordion","children","label","id","idOverride","isDefaultExpanded","isDisabled","isExpanded","onChange","testId","translate","variant","useUniqueId","headerId","contentId","jsxs","_Accordion2","defaultExpanded","disabled","disableGutters","expanded","jsx","_AccordionSummary2","expandIcon","ChevronDownIcon","Support","component","_AccordionDetails2","MemoizedAccordion","memo","displayName"],"sources":["../../src/Accordion.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-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 {\n  Accordion as MuiAccordion,\n  AccordionDetails as MuiAccordionDetails,\n  AccordionProps as MuiAccordionProps,\n  AccordionSummary as MuiAccordionSummary,\n} from \"@mui/material\";\nimport { memo, ReactNode } from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nimport { ChevronDownIcon } from \"./icons.generated/index.js\";\nimport { Support } from \"./Typography.js\";\nimport { useUniqueId } from \"./useUniqueId.js\";\n\nexport const accordionVariantValues = [\"default\", \"borderless\"] as const;\n\nexport type AccordionProps = {\n  /**\n   * The content of the Accordion itself\n   */\n  children: ReactNode;\n  /**\n   * Defines IDs for the header and the content of the Accordion\n   */\n  id?: string;\n  /**\n   * If `true`, the accordion item is expanded on initial render.\n   */\n  isDefaultExpanded?: boolean;\n  /**\n   * If `true`, the accordion item is disabled and cannot be expanded or collapsed.\n   */\n  isDisabled?: boolean;\n  /**\n   * If `true`, the accordion item is expanded (controlled).\n   */\n  isExpanded?: boolean;\n  /**\n   * The label text for the AccordionSummary\n   */\n  label: string;\n  /**\n   * Called when the expansion state of the accordion changes.\n   */\n  onChange?: MuiAccordionProps[\"onChange\"];\n  /**\n   * Controls the visual border style of the accordion.\n   * - If `'default'`, renders with a visible outline border.\n   * - If `'borderless'`, renders without a border, suitable for use on patterned or colored backgrounds.\n   * @default \"default\"\n   */\n  variant?: (typeof accordionVariantValues)[number];\n} & (\n  | {\n      isDefaultExpanded?: never;\n      isExpanded: boolean;\n    }\n  | {\n      isDefaultExpanded?: boolean;\n      isExpanded?: never;\n    }\n) &\n  Pick<HtmlProps, \"testId\" | \"translate\">;\n\n/**\n * A collapsible content section with a clickable header. Use to progressively disclose information and reduce visual complexity on content-heavy pages.\n */\nconst Accordion = ({\n  children,\n  label,\n  id: idOverride,\n  isDefaultExpanded,\n  isDisabled,\n  isExpanded,\n  onChange,\n  testId,\n  translate,\n  variant = \"default\",\n}: AccordionProps) => {\n  const id = useUniqueId(idOverride);\n  const headerId = `${id}-header`;\n  const contentId = `${id}-content`;\n\n  return (\n    <MuiAccordion\n      data-ods-variant={variant}\n      data-se={testId}\n      defaultExpanded={isDefaultExpanded}\n      disabled={isDisabled}\n      disableGutters\n      expanded={isExpanded}\n      onChange={onChange}\n    >\n      <MuiAccordionSummary\n        aria-controls={contentId}\n        expandIcon={<ChevronDownIcon />}\n        id={headerId}\n      >\n        <Support component=\"div\" translate={translate}>\n          {label}\n        </Support>\n      </MuiAccordionSummary>\n      <MuiAccordionDetails aria-labelledby={headerId}>\n        {children}\n      </MuiAccordionDetails>\n    </MuiAccordion>\n  );\n};\n\nconst MemoizedAccordion = memo(Accordion);\nMemoizedAccordion.displayName = \"Accordion\";\n\nexport { MemoizedAccordion as Accordion };\n"],"mappings":";;;;;;;;;AAkBA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAA+C,IAAAI,W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