{"version":3,"file":"FullscreenButton.cjs","names":["_react","require","_Button","_i18n","_index","_index2","_useFullscreen","_jsxRuntime","FullscreenButton","ariaLabel","fullscreenId","isDisabled","size","variant","t","useTranslation","isInFullscreenStack","toggleFullscreen","useFullscreen","jsx","Button","ariaControls","getFullscreenElementId","ariaPressed","onClick","startIcon","FullscreenExitIcon","FullscreenEnterIcon","MemoizedFullscreenButton","exports","memo","displayName"],"sources":["../../../src/fullscreen/FullscreenButton.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2026-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 { memo } from \"react\";\n\nimport { Button, type ButtonProps } from \"../Buttons/Button.js\";\nimport { useTranslation } from \"../i18n.generated/i18n.js\";\nimport {\n  FullscreenEnterIcon,\n  FullscreenExitIcon,\n} from \"../icons.generated/index.js\";\nimport { getFullscreenElementId } from \"../message-bus/index.js\";\nimport { useFullscreen } from \"./useFullscreen.js\";\n\nexport type FullscreenButtonProps = {\n  /**\n   * Accessible name for the button. It stays the same whether the region is in fullscreen or not, because the toggle's state is conveyed through `aria-pressed`. Override it when a page has more than one region, so screen reader users can tell the buttons apart (e.g. \"Enable fullscreen for the activity chart\").\n   * @default \"Enable fullscreen\"\n   */\n  ariaLabel?: string;\n  /**\n   * The id of the `FullscreenRegion` this button controls, from `useFullscreenId`. The button can sit anywhere on the page, inside or outside the region.\n   */\n  fullscreenId: string;\n} & Partial<Pick<ButtonProps, \"isDisabled\" | \"size\" | \"variant\">>;\n\n/**\n * An icon button that puts a `FullscreenRegion` in fullscreen, or takes it out. Its arrows point outward to enter and inward to exit.\n *\n * It's a toggle button: its name stays the same and `aria-pressed` says whether the region is in fullscreen, the same pattern `PasswordField` uses for showing a password. `aria-controls` points at the region.\n *\n * @experimental The fullscreen API is in alpha and may change in a future release.\n */\nconst FullscreenButton = ({\n  ariaLabel,\n  fullscreenId,\n  isDisabled,\n  size,\n  variant = \"secondary\",\n}: FullscreenButtonProps) => {\n  const { t } = useTranslation();\n  const { isInFullscreenStack, toggleFullscreen } = useFullscreen({\n    fullscreenId,\n  });\n\n  return (\n    <Button\n      ariaControls={getFullscreenElementId({ fullscreenId })}\n      ariaLabel={ariaLabel ?? t(\"fullscreen.button.label\")}\n      ariaPressed={isInFullscreenStack}\n      isDisabled={isDisabled}\n      onClick={toggleFullscreen}\n      size={size}\n      startIcon={\n        isInFullscreenStack ? <FullscreenExitIcon /> : <FullscreenEnterIcon />\n      }\n      variant={variant}\n    />\n  );\n};\n\nconst MemoizedFullscreenButton = memo(FullscreenButton);\nMemoizedFullscreenButton.displayName = \"FullscreenButton\";\n\nexport { MemoizedFullscreenButton as FullscreenButton };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAIA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AAAmD,IAAAM,WAAA,GAAAN,OAAA;AArBnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAgCA,MAAMO,gBAAgB,GAAGA,CAAC;EACxBC,SAAS;EACTC,YAAY;EACZC,UAAU;EACVC,IAAI;EACJC,OAAO,GAAG;AACW,CAAC,KAAK;EAC3B,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,oBAAc,EAAC,CAAC;EAC9B,MAAM;IAAEC,mBAAmB;IAAEC;EAAiB,CAAC,GAAG,IAAAC,4BAAa,EAAC;IAC9DR;EACF,CAA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