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AQO,SAAS,0CAAO,GAAmB,EAAE,GAAmB;IAC7D,OAAO,CAAC,OAAO,EAAE,yCAAmB,KAAK,EAAE,EAAE,yCAAmB,KAAK,CAAC,CAAC;AACzE;AAOO,SAAS,0CAAW,SAAyB;IAClD,OAAO,CAAC,YAAY,EAAE,yCAAmB,WAAW,CAAC,CAAC;AACxD;AAEA,SAAS,6CAAuB,KAAK;IACnC,OAAO,MAAM,GAAG,CAAC,CAAA,IAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC;AACvC;AAEA,SAAS,yCAAmB,KAAK;IAC/B,IAAI,kEAAkE,IAAI,CAAC,QACzE,OAAO;IAGT,OAAO,CAAA,GAAA,wCAAa,EAAE;AACxB;AAEA,SAAS,wCAAkB,KAAK;IAC9B,IAAI,MAAM,OAAO,CAAC,QAChB,OAAO,MAAM,GAAG,CAAC,0CAAoB,IAAI,CAAC;IAG5C,OAAO,yCAAmB;AAC5B","sources":["packages/@adobe/react-spectrum/src/layout/Grid.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n  baseStyleProps,\n  dimensionValue,\n  passthroughStyle,\n  StyleHandlers,\n  useStyleProps\n} from '../utils/styleProps';\n\nimport {DimensionValue, DOMProps, DOMRef, GridStyleProps} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport React, {forwardRef, ReactNode} from 'react';\nimport {useDOMRef} from '../utils/useDOMRef';\n\nexport interface GridProps extends DOMProps, GridStyleProps {\n  /** Children of the grid container. */\n  children: ReactNode\n}\n\nconst gridStyleProps: StyleHandlers = {\n  ...baseStyleProps,\n  autoFlow: ['gridAutoFlow', passthroughStyle],\n  autoColumns: ['gridAutoColumns', gridDimensionValue],\n  autoRows: ['gridAutoRows', gridDimensionValue],\n  areas: ['gridTemplateAreas', gridTemplateAreasValue],\n  columns: ['gridTemplateColumns', gridTemplateValue],\n  rows: ['gridTemplateRows', gridTemplateValue],\n  gap: ['gap', dimensionValue],\n  rowGap: ['rowGap', dimensionValue],\n  columnGap: ['columnGap', dimensionValue],\n  justifyItems: ['justifyItems', passthroughStyle],\n  justifyContent: ['justifyContent', passthroughStyle],\n  alignItems: ['alignItems', passthroughStyle],\n  alignContent: ['alignContent', passthroughStyle]\n};\n\n/**\n * A layout container using CSS grid. Supports Spectrum dimensions as values to\n * ensure consistent and adaptive sizing and spacing.\n */\nexport const Grid = forwardRef(function Grid(props: GridProps, ref: DOMRef<HTMLDivElement>) {\n  let {\n    children,\n    ...otherProps\n  } = props;\n  let {styleProps} = useStyleProps(otherProps, gridStyleProps);\n  if (styleProps.style) {\n    styleProps.style.display = 'grid'; // inline-grid?\n  }\n  let domRef = useDOMRef(ref);\n\n  return (\n    <div {...filterDOMProps(otherProps)} {...styleProps} ref={domRef}>\n      {children}\n    </div>\n  );\n});\n\n/**\n * Can be used to make a repeating fragment of the columns or rows list.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/repeat).\n * @param count - The number of times to repeat the fragment.\n * @param repeat - The fragment to repeat.\n */\nexport function repeat(count: number | 'auto-fill' | 'auto-fit', repeat: DimensionValue | DimensionValue[]): string {\n  return `repeat(${count}, ${gridTemplateValue(repeat)})`;\n}\n\n/**\n * Defines a size range greater than or equal to min and less than or equal to max.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/minmax).\n * @param min - The minimum size.\n * @param max - The maximum size.\n */\nexport function minmax(min: DimensionValue, max: DimensionValue): string {\n  return `minmax(${gridDimensionValue(min)}, ${gridDimensionValue(max)})`;\n}\n\n/**\n * Clamps a given size to an available size.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content).\n * @param dimension - The size to clamp.\n */\nexport function fitContent(dimension: DimensionValue): string {\n  return `fit-content(${gridDimensionValue(dimension)})`;\n}\n\nfunction gridTemplateAreasValue(value) {\n  return value.map(v => `\"${v}\"`).join('\\n');\n}\n\nfunction gridDimensionValue(value) {\n  if (/^max-content|min-content|minmax|auto|fit-content|repeat|subgrid/.test(value)) {\n    return value;\n  }\n\n  return dimensionValue(value);\n}\n\nfunction gridTemplateValue(value) {\n  if (Array.isArray(value)) {\n    return value.map(gridDimensionValue).join(' ');\n  }\n\n  return gridDimensionValue(value);\n}\n"],"names":[],"version":3,"file":"Grid.cjs.map"}