@elliemae/ds-grid 3.31.4 → 3.32.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { alignItemsPlacement, justifyPlacement, wrap, boxShadow } from './utils/constants.js';\n\nexport declare namespace DSGridT {\n interface RowColBreakpoints {\n small?: string | number | (string | number)[];\n medium?: string | number | (string | number)[];\n large?: string | number | (string | number)[];\n }\n\n interface SpanBreakpoints {\n small?: number;\n medium?: number;\n large?: number;\n }\n\n type JustifyPlacement = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';\n type AlignItemsPlacement = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';\n type Wrap = 'wrap' | 'nowrap' | 'wrap-reverse';\n type BoxShadow = 'xs' | 's' | 'm' | 'l' | 'xl';\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n rows: string[] | string | number[] | RowColBreakpoints;\n cols: string[] | string | number[] | RowColBreakpoints;\n className: string;\n justify: JustifyPlacement;\n wrap: Wrap;\n span: number | SpanBreakpoints;\n justifyItems: string;\n }\n\n export interface OptionalProps {\n height?: string | number;\n width?: string | number;\n justifyContent?: JustifyPlacement;\n alignItems?: AlignItemsPlacement;\n alignContent?: AlignItemsPlacement;\n children?: React.ReactNode;\n withMaxWidthBreakpoints?: boolean;\n rowGap?: string | number;\n gutter?: string | number;\n innerRef?: React.MutableRefObject<HTMLDivElement | null> | React.RefCallback<HTMLDivElement>;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps {}\n\n export interface ItemProps {\n rows: string[] | string | number[] | RowColBreakpoints;\n cols: string[] | string | number[] | RowColBreakpoints;\n alignItems?: AlignItemsPlacement;\n alignContent?: AlignItemsPlacement;\n children: React.ReactNode;\n className?: string;\n justify: JustifyPlacement;\n gutter?: string | number;\n wrap: Wrap;\n childNumber: number;\n isSpanParent: boolean;\n span?: number | SpanBreakpoints;\n withMaxWidthBreakpoints?: boolean;\n }\n}\n\nexport const defaultProps: DSGridT.DefaultProps = {\n rows: [],\n cols: [],\n className: '',\n justify: 'flex-start',\n wrap: 'wrap',\n span: 1,\n justifyItems: 'normal',\n};\n\n// =============================================================================\n// PropTypes\n// =============================================================================\nconst rowColBreakpoints = PropTypes.shape({\n small: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n medium: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n large: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n});\n\nconst spanBreakpoints = PropTypes.shape({\n small: PropTypes.number,\n medium: PropTypes.number,\n large: PropTypes.number,\n});\n\nexport const DSGridPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n rows: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n PropTypes.number,\n rowColBreakpoints,\n ])\n .description('Row layout cells')\n .defaultValue([]),\n cols: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n PropTypes.number,\n rowColBreakpoints,\n ])\n .description('Column layout cells')\n .defaultValue([]),\n span: PropTypes.oneOfType([PropTypes.number, spanBreakpoints]).description(\n 'Expands the grid element within columns.',\n ),\n alignItems: PropTypes.oneOf(alignItemsPlacement).description('flex-like align items prop'),\n children: PropTypes.node.description('Children node inside grid cell'),\n className: PropTypes.string.description('CSS class').defaultValue(''),\n justifyContent: PropTypes.oneOf(justifyPlacement)\n .description('flex-like justify prop')\n .defaultValue(justifyPlacement[0]),\n gutter: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('Space between cells prop')\n .defaultValue(0),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Ref to the grid'),\n wrap: PropTypes.oneOf(wrap).description('Wrap type').defaultValue(wrap[0]),\n withMaxWidthBreakpoints: PropTypes.bool.description('weather use max width').defaultValue(undefined),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid height.'),\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid width.'),\n backgroundColor: PropTypes.string.description('Sets background color.'),\n bg: PropTypes.string.description('Sets background color.'),\n boxShadow: PropTypes.oneOf(boxShadow).description('Sets background color.'),\n border: PropTypes.string.description('Sets border.'),\n borderRadius: PropTypes.string.description('Sets border radius.'),\n borderWidth: PropTypes.string.description('Sets border width.'),\n borderStyle: PropTypes.string.description('Sets border style.'),\n borderColor: PropTypes.string.description('Sets border color.'),\n borderTop: PropTypes.string.description('Sets top border.'),\n borderBottom: PropTypes.string.description('Sets bottom border.'),\n borderLeft: PropTypes.string.description('Sets left border.'),\n borderRight: PropTypes.string.description('Sets right border.'),\n borderTopWidth: PropTypes.string.description('Sets border top width.'),\n borderTopStyle: PropTypes.string.description('Sets border top style.'),\n borderTopColor: PropTypes.string.description('Sets border top color.'),\n borderBottomWidth: PropTypes.string.description('Sets border bottom width.'),\n borderBottomStyle: PropTypes.string.description('Sets border bottom style.'),\n borderBottomColor: PropTypes.string.description('Sets border bottom color.'),\n borderRightWidth: PropTypes.string.description('Sets border right width.'),\n borderRightStyle: PropTypes.string.description('Sets border right style.'),\n borderRightColor: PropTypes.string.description('Sets border right color.'),\n borderLeftWidth: PropTypes.string.description('Sets border left width.'),\n borderLeftStyle: PropTypes.string.description('Sets border left style.'),\n borderLeftColor: PropTypes.string.description('Sets border left color.'),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,8BAAuE;AACvE,uBAAuE;AA0EhE,MAAM,eAAqC;AAAA,EAChD,MAAM,CAAC;AAAA,EACP,MAAM,CAAC;AAAA,EACP,WAAW;AAAA,EACX,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,cAAc;AAChB;AAKA,MAAM,oBAAoB,kCAAU,MAAM;AAAA,EACxC,OAAO,kCAAU,QAAQ,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,CAAC;AAAA,EAClF,QAAQ,kCAAU,QAAQ,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,CAAC;AAAA,EACnF,OAAO,kCAAU,QAAQ,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,CAAC;AACpF,CAAC;AAED,MAAM,kBAAkB,kCAAU,MAAM;AAAA,EACtC,OAAO,kCAAU;AAAA,EACjB,QAAQ,kCAAU;AAAA,EAClB,OAAO,kCAAU;AACnB,CAAC;AAEM,MAAM,kBAAkB;AAAA,EAC7B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,kCAAU,UAAU;AAAA,IACxB,kCAAU,QAAQ,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,CAAC;AAAA,IAC3E,kCAAU;AAAA,IACV;AAAA,EACF,CAAC,EACE,YAAY,kBAAkB,EAC9B,aAAa,CAAC,CAAC;AAAA,EAClB,MAAM,kCAAU,UAA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,EAC1E,QAAQ,kCAAU,OAAO,YAAY,cAAc;AAAA,EACnD,cAAc,kCAAU,OAAO,YAAY,qBAAqB;AAAA,EAChE,aAAa,kCAAU,OAAO,YAAY,oBAAoB;AAAA,EAC9D,aAAa,kCAAU,OAAO,YAAY,oBAAoB;AAAA,EAC9D,aAAa,kCAAU,OAAO,YAAY,oBAAoB;AAAA,EAC9D,WAAW,kCAAU,OAAO,YAAY,kBAAkB;AAAA,EAC1D,cAAc,kCAAU,OAAO,YAAY,qBAAqB;AAAA,EAChE,YAAY,kCAAU,OAAO,YAAY,mBAAmB;AAAA,EAC5D,aAAa,kCAAU,OAAO,YAAY,oBAAoB;AAAA,EAC9D,gBAAgB,kCAAU,OAAO,YAAY,wBAAwB;AAAA,EACrE,gBAAgB,kCAAU,OAAO,YAAY,wBAAwB;AAAA,EACrE,gBAAgB,kCAAU,OAAO,YAAY,wBAAwB;AAAA,EACrE,mBAAmB,kCAAU,OAAO,YAAY,2BAA2B;AAAA,EAC3E,mBAAmB,kCAAU,OAAO,YAAY,2BAA2B;AAAA,EAC3E,mBAAmB,kCAAU,OAAO,YAAY,2BAA2B;AAAA,EAC3E,kBAAkB,kCAAU,OAAO,YAAY,0BAA0B;AAAA,EACzE,kBAAkB,kCAAU,OAAO,YAAY,0BAA0B;AAAA,EACzE,kBAAkB,kCAAU,OAAO,YAAY,0BAA0B;AAAA,EACzE,iBAAiB,kCAAU,OAAO,YAAY,yBAAyB;AAAA,EACvE,iBAAiB,kCAAU,OAAO,YAAY,yBAAyB;AAAA,EACvE,iBAAiB,kCAAU,OAAO,YAAY,yBAAyB;AACzE;",
4
+ "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { alignItemsPlacement, justifyPlacement, wrap, boxShadow } from './utils/constants.js';\n\nexport declare namespace DSGridT {\n export type RowOrColsSyntaxSugar = string | number | (string | number)[];\n\n export interface RowColBreakpoints {\n small?: RowOrColsSyntaxSugar[];\n medium?: RowOrColsSyntaxSugar[];\n large?: RowOrColsSyntaxSugar[];\n }\n\n export type RowOrColsValidValues = RowOrColsSyntaxSugar | RowColBreakpoints;\n\n export interface SpanBreakpoints {\n small?: number;\n medium?: number;\n large?: number;\n }\n\n export type JustifyPlacement =\n | 'flex-start'\n | 'center'\n | 'flex-end'\n | 'space-between'\n | 'space-around'\n | 'space-evenly';\n export type AlignItemsPlacement = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';\n export type Wrap = 'wrap' | 'nowrap' | 'wrap-reverse';\n export type BoxShadow = 'xs' | 's' | 'm' | 'l' | 'xl';\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n rows: RowOrColsValidValues;\n cols: RowOrColsValidValues;\n className: string;\n justify: JustifyPlacement;\n wrap: Wrap;\n span: number | SpanBreakpoints;\n justifyItems: string;\n }\n\n export interface OptionalProps {\n height?: string | number;\n width?: string | number;\n justifyContent?: JustifyPlacement;\n alignItems?: AlignItemsPlacement;\n alignContent?: AlignItemsPlacement;\n children?: React.ReactNode;\n withMaxWidthBreakpoints?: boolean;\n rowGap?: string | number;\n gutter?: string | number;\n innerRef?: React.MutableRefObject<HTMLDivElement | null> | React.RefCallback<HTMLDivElement>;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps {}\n\n export interface ItemProps {\n rows: RowOrColsValidValues;\n cols: RowOrColsValidValues;\n alignItems?: AlignItemsPlacement;\n alignContent?: AlignItemsPlacement;\n children: React.ReactNode;\n className?: string;\n justify: JustifyPlacement;\n gutter?: string | number;\n wrap: Wrap;\n childNumber: number;\n isSpanParent: boolean;\n span?: number | SpanBreakpoints;\n withMaxWidthBreakpoints?: boolean;\n }\n}\n\nexport const defaultProps: DSGridT.DefaultProps = {\n rows: [],\n cols: [],\n className: '',\n justify: 'flex-start',\n wrap: 'wrap',\n span: 1,\n justifyItems: 'normal',\n};\n\n// =============================================================================\n// PropTypes\n// =============================================================================\nconst rowColBreakpoints = PropTypes.shape({\n small: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n medium: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n large: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n});\n\nconst spanBreakpoints = PropTypes.shape({\n small: PropTypes.number,\n medium: PropTypes.number,\n large: PropTypes.number,\n});\n\nexport const DSGridPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n rows: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n PropTypes.number,\n rowColBreakpoints,\n ])\n .description('Row layout cells')\n .defaultValue([]),\n cols: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n PropTypes.number,\n rowColBreakpoints,\n ])\n .description('Column layout cells')\n .defaultValue([]),\n span: PropTypes.oneOfType([PropTypes.number, spanBreakpoints]).description(\n 'Expands the grid element within columns.',\n ),\n alignItems: PropTypes.oneOf(alignItemsPlacement).description('flex-like align items prop'),\n children: PropTypes.node.description('Children node inside grid cell'),\n className: PropTypes.string.description('CSS class').defaultValue(''),\n justifyContent: PropTypes.oneOf(justifyPlacement)\n .description('flex-like justify prop')\n .defaultValue(justifyPlacement[0]),\n gutter: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('Space between cells prop')\n .defaultValue(0),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Ref to the grid'),\n wrap: PropTypes.oneOf(wrap).description('Wrap type').defaultValue(wrap[0]),\n withMaxWidthBreakpoints: PropTypes.bool.description('weather use max width').defaultValue(undefined),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid height.'),\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid width.'),\n backgroundColor: PropTypes.string.description('Sets background color.'),\n bg: PropTypes.string.description('Sets background color.'),\n boxShadow: PropTypes.oneOf(boxShadow).description('Sets background color.'),\n border: PropTypes.string.description('Sets border.'),\n borderRadius: PropTypes.string.description('Sets border radius.'),\n borderWidth: PropTypes.string.description('Sets border width.'),\n borderStyle: PropTypes.string.description('Sets border style.'),\n borderColor: PropTypes.string.description('Sets border color.'),\n borderTop: PropTypes.string.description('Sets top border.'),\n borderBottom: PropTypes.string.description('Sets bottom border.'),\n borderLeft: PropTypes.string.description('Sets left border.'),\n borderRight: PropTypes.string.description('Sets right border.'),\n borderTopWidth: PropTypes.string.description('Sets border top width.'),\n borderTopStyle: PropTypes.string.description('Sets border top style.'),\n borderTopColor: PropTypes.string.description('Sets border top color.'),\n borderBottomWidth: PropTypes.string.description('Sets border bottom width.'),\n borderBottomStyle: PropTypes.string.description('Sets border bottom style.'),\n borderBottomColor: PropTypes.string.description('Sets border bottom color.'),\n borderRightWidth: PropTypes.string.description('Sets border right width.'),\n borderRightStyle: PropTypes.string.description('Sets border right style.'),\n borderRightColor: PropTypes.string.description('Sets border right color.'),\n borderLeftWidth: PropTypes.string.description('Sets border left width.'),\n borderLeftStyle: PropTypes.string.description('Sets border left style.'),\n borderLeftColor: PropTypes.string.description('Sets border left color.'),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,8BAAuE;AACvE,uBAAuE;AAoFhE,MAAM,eAAqC;AAAA,EA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AAA,EAC5D,aAAa,kCAAU,OAAO,YAAY,oBAAoB;AAAA,EAC9D,gBAAgB,kCAAU,OAAO,YAAY,wBAAwB;AAAA,EACrE,gBAAgB,kCAAU,OAAO,YAAY,wBAAwB;AAAA,EACrE,gBAAgB,kCAAU,OAAO,YAAY,wBAAwB;AAAA,EACrE,mBAAmB,kCAAU,OAAO,YAAY,2BAA2B;AAAA,EAC3E,mBAAmB,kCAAU,OAAO,YAAY,2BAA2B;AAAA,EAC3E,mBAAmB,kCAAU,OAAO,YAAY,2BAA2B;AAAA,EAC3E,kBAAkB,kCAAU,OAAO,YAAY,0BAA0B;AAAA,EACzE,kBAAkB,kCAAU,OAAO,YAAY,0BAA0B;AAAA,EACzE,kBAAkB,kCAAU,OAAO,YAAY,0BAA0B;AAAA,EACzE,iBAAiB,kCAAU,OAAO,YAAY,yBAAyB;AAAA,EACvE,iBAAiB,kCAAU,OAAO,YAAY,yBAAyB;AAAA,EACvE,iBAAiB,kCAAU,OAAO,YAAY,yBAAyB;AACzE;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/utils/manageCols.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport type { DSGridT } from '../react-desc-prop-types.js';\nimport type { Theme } from '@elliemae/pui-theme';\n\ntype BreakPointObject = {\n large?: string | number | (string | number)[];\n medium?: string | number | (string | number)[];\n small?: string | number | (string | number)[];\n};\n// this typeguard is not extremely accurate but it has historically been like this and we need to avoid breaking changes\nconst colsIsBreakpointDefinition = (cols: unknown): cols is BreakPointObject =>\n typeof cols === 'object' && !Array.isArray(cols);\ntype InterpolatedFunctionProps = {\n theme: Theme;\n} & DSGridT.ItemProps;\n\nconst generateColsCssStringForArray = (colsVal: (string | number)[]): string => {\n // mtg and mtgs are used to support mapping different ways of defining the cols\n // when mtg produces valid css, mtgs will produce invalid css and vice-versa\n // only one of them will be effectively applied by the browser\n const mtg = (mapTemplateGrid(colsVal) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(colsVal) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};\n `;\n};\nconst generateColsCssStringForBootstrapLikeishScenario = (colsVal: string | number): string => `\n -ms-grid-columns: repeat(${colsVal}, 1fr);\n grid-template-columns: repeat(${colsVal}, 1fr);\n `;\nconst generateColsWithMediaQueries = (\n cols: BreakPointObject,\n theme: Theme,\n isSpanParent: boolean,\n): ReturnType<typeof css>[] => {\n const finalMediaDeclaration: ReturnType<typeof css>[] = [];\n // we conditionally push into the array the media queries because grid cols definitions supports partial definitions\n // meaning that you can define cols only for small and medium and not for large\n // in such case we want to avoid generating media queries for large\n // we also need to make sure that the largest definition is used as the default one\n if (cols.large) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(cols.large)) {\n cssString = generateColsCssStringForArray(cols.large);\n } else if (isSpanParent) {\n cssString = generateColsCssStringForBootstrapLikeishScenario(cols.large);\n }\n finalMediaDeclaration.push(theme.media.large`${cssString}`);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n }\n if (cols.medium) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(cols.medium)) {\n cssString = generateColsCssStringForArray(cols.medium);\n } else if (isSpanParent) {\n cssString = generateColsCssStringForBootstrapLikeishScenario(cols.medium);\n }\n finalMediaDeclaration.push(theme.media.medium`${cssString}`);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n }\n if (cols.small) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(cols.small)) {\n cssString = generateColsCssStringForArray(cols.small);\n } else if (isSpanParent) {\n cssString = generateColsCssStringForBootstrapLikeishScenario(cols.small);\n }\n finalMediaDeclaration.push(theme.media.small`${cssString}`);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n }\n return finalMediaDeclaration;\n};\n\nexport const manageColsV2 = ({ cols, theme, isSpanParent }: InterpolatedFunctionProps): ReturnType<typeof css>[] => {\n // we want to be extremely explicit with how we handle the different use-cases\n // the component is quite old and has been tailored to fit the needs of the different use-cases\n // even ones that should have not been supported in the first place (isSpanParent to simulate bootstrap, different kind of cols definitions, etc)\n // support for\n // cols:{small: 1, medium: 2, large: 3}\n // AND\n // cols: {small: ['1fr'], medium: ['160px'], large: ['400px'] }\n if (colsIsBreakpointDefinition(cols)) {\n // there is no way to guarantee dynamic co-relation between pui-theme and the grid component\n // any change in the theme will break the co-relation and we would need to update the component\n // for such reason we are optimizing for maintainability and not scalability\n return generateColsWithMediaQueries(cols, theme, isSpanParent);\n }\n\n // support for cols: ['1fr', '1fr', '1fr'] && cols: [1, 1, 1]\n if (Array.isArray(cols)) {\n const cssString = generateColsCssStringForArray(cols);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // support for parent is span and is like cols: 3\n if (isSpanParent) {\n const cssString = generateColsCssStringForBootstrapLikeishScenario(cols);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // fallback is not doing anything\n return [css``];\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA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K,KAAK,GAAG;AAC7B,kBAAY,8BAA8B,KAAK,KAAK;AAAA,IACtD,WAAW,cAAc;AACvB,kBAAY,iDAAiD,KAAK,KAAK;AAAA,IACzE;AACA,0BAAsB,KAAK,MAAM,MAAM,QAAQ,WAAW;AAC1D,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB;AAAA,OACH;AAAA,EACL;AACA,SAAO;AACT;AAEO,MAAM,eAAe,CAAC,EAAE,MAAM,OAAO,aAAa,MAA2D;AAQlH,MAAI,2BAA2B,IAAI,GAAG;AAIpC,WAAO,6BAA6B,MAAM,OAAO,YAAY;AAAA,EAC/D;AAGA,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,UAAM,YAAY,8BAA8B,IAAI;AACpD,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,MAAI,cAAc;AAChB,UAAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,SAAO,CAAC,sBAAK;AACf;",
4
+ "sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport type { DSGridT } from '../react-desc-prop-types.js';\nimport type { Theme } from '@elliemae/pui-theme';\n\n// this typeguard is not extremely accurate but it has historically been like this and we need to avoid breaking changes\nconst colsIsBreakpointDefinition = (cols: unknown): cols is DSGridT.RowColBreakpoints =>\n typeof cols === 'object' && !Array.isArray(cols);\ntype InterpolatedFunctionProps = {\n theme: Theme;\n} & DSGridT.ItemProps;\n\nconst generateColsCssStringForArray = (colsVal: DSGridT.RowOrColsSyntaxSugar[]): string => {\n // mtg and mtgs are used to support mapping different ways of defining the cols\n // when mtg produces valid css, mtgs will produce invalid css and vice-versa\n // only one of them will be effectively applied by the browser\n const mtg = (mapTemplateGrid(colsVal as DSGridT.RowOrColsSyntaxSugar) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(colsVal as DSGridT.RowOrColsSyntaxSugar) as string[])\n .map((c) => `minmax(0, ${c})`)\n .join(' ');\n return `\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};\n `;\n};\nconst generateColsCssStringForBootstrapLikeishScenario = (colsVal: string | number): string => `\n -ms-grid-columns: repeat(${colsVal}, 1fr);\n grid-template-columns: repeat(${colsVal}, 1fr);\n `;\nconst generateColsWithMediaQueries = (\n cols: DSGridT.RowColBreakpoints,\n theme: Theme,\n isSpanParent: boolean,\n): ReturnType<typeof css>[] => {\n const finalMediaDeclaration: ReturnType<typeof css>[] = [];\n // we conditionally push into the array the media queries because grid cols definitions supports partial definitions\n // meaning that you can define cols only for small and medium and not for large\n // in such case we want to avoid generating media queries for large\n // we also need to make sure that the largest definition is used as the default one\n if (cols.large) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(cols.large)) {\n cssString = generateColsCssStringForArray(cols.large);\n } else if (isSpanParent) {\n cssString = generateColsCssStringForBootstrapLikeishScenario(cols.large);\n }\n finalMediaDeclaration.push(theme.media.large`${cssString}`);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n }\n if (cols.medium) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(cols.medium)) {\n cssString = generateColsCssStringForArray(cols.medium);\n } else if (isSpanParent) {\n cssString = generateColsCssStringForBootstrapLikeishScenario(cols.medium);\n }\n finalMediaDeclaration.push(theme.media.medium`${cssString}`);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n }\n if (cols.small) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(cols.small)) {\n cssString = generateColsCssStringForArray(cols.small);\n } else if (isSpanParent) {\n cssString = generateColsCssStringForBootstrapLikeishScenario(cols.small);\n }\n finalMediaDeclaration.push(theme.media.small`${cssString}`);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n }\n return finalMediaDeclaration;\n};\n\nexport const manageColsV2 = ({ cols, theme, isSpanParent }: InterpolatedFunctionProps): ReturnType<typeof css>[] => {\n // we want to be extremely explicit with how we handle the different use-cases\n // the component is quite old and has been tailored to fit the needs of the different use-cases\n // even ones that should have not been supported in the first place (isSpanParent to simulate bootstrap, different kind of cols definitions, etc)\n // support for\n // cols:{small: 1, medium: 2, large: 3}\n // AND\n // cols: {small: ['1fr'], medium: ['160px'], large: ['400px'] }\n if (colsIsBreakpointDefinition(cols)) {\n // there is no way to guarantee dynamic co-relation between pui-theme and the grid component\n // any change in the theme will break the co-relation and we would need to update the component\n // for such reason we are optimizing for maintainability and not scalability\n return generateColsWithMediaQueries(cols, theme, isSpanParent);\n }\n\n // support for cols: ['1fr', '1fr', '1fr'] && cols: [1, 1, 1]\n if (Array.isArray(cols)) {\n const cssString = generateColsCssStringForArray(cols);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // support for parent is span and is like cols: 3\n if (isSpanParent) {\n const cssString = generateColsCssStringForBootstrapLikeishScenario(cols);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // fallback is not doing anything\n return [css``];\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,uBAAqC;AAKrC,MAAM,6BAA6B,CAAC,S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AW,cAAc;AACvB,kBAAY,iDAAiD,KAAK,KAAK;AAAA,IACzE;AACA,0BAAsB,KAAK,MAAM,MAAM,QAAQ,WAAW;AAC1D,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB;AAAA,OACH;AAAA,EACL;AACA,SAAO;AACT;AAEO,MAAM,eAAe,CAAC,EAAE,MAAM,OAAO,aAAa,MAA2D;AAQlH,MAAI,2BAA2B,IAAI,GAAG;AAIpC,WAAO,6BAA6B,MAAM,OAAO,YAAY;AAAA,EAC/D;AAGA,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,UAAM,YAAY,8BAA8B,IAAI;AACpD,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,MAAI,cAAc;AAChB,UAAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,SAAO,CAAC,sBAAK;AACf;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/utils/manageRows.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport type { DSGridT } from '../react-desc-prop-types.js';\nimport type { Theme } from '@elliemae/pui-theme';\n\ntype BreakPointObject = {\n large?: string | number | (string | number)[];\n medium?: string | number | (string | number)[];\n small?: string | number | (string | number)[];\n};\n// this typeguard is not extremely accurate but it has historically been like this and we need to avoid breaking changes\nconst rowsIsBreakpointDefinition = (rows: unknown): rows is BreakPointObject =>\n typeof rows === 'object' && !Array.isArray(rows);\ntype InterpolatedFunctionProps = {\n theme: Theme;\n} & DSGridT.ItemProps;\n\nconst generateRowsCssStringForArray = (rowsVal: (string | number)[]): string => {\n // mtg and mtgs are used to support mapping different ways of defining the rows\n // when mtg produces valid css, mtgs will produce invalid css and vice-versa\n // only one of them will be effectively applied by the browser\n const mtg = (mapTemplateGrid(rowsVal) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rowsVal) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n `;\n};\nconst generateRowsCssStringForBootstrapLikeishScenario = (rowsVal: string | number): string => `\n -ms-grid-rows: repeat(${rowsVal}, 1fr);\n grid-template-rows: repeat(${rowsVal}, 1fr);\n `;\nconst generateRowsWithMediaQueries = (\n rows: BreakPointObject,\n theme: Theme,\n isSpanParent: boolean,\n): ReturnType<typeof css>[] => {\n const finalMediaDeclaration: ReturnType<typeof css>[] = [];\n // we conditionally push into the array the media queries because grid rows definitions supports partial definitions\n // meaning that you can define rows only for small and medium and not for large\n // in such case we want to avoid generating media queries for large\n // we also need to make sure that the largest definition is used as the default one\n if (rows.large) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(rows.large)) {\n cssString = generateRowsCssStringForArray(rows.large);\n } else if (isSpanParent) {\n cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.large);\n }\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.large`${cssString}`);\n }\n if (rows.medium) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(rows.medium)) {\n cssString = generateRowsCssStringForArray(rows.medium);\n } else if (isSpanParent) {\n cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.medium);\n }\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.medium`${cssString}`);\n }\n if (rows.small) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(rows.small)) {\n cssString = generateRowsCssStringForArray(rows.small);\n } else if (isSpanParent) {\n cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.small);\n }\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.small`${cssString}`);\n }\n return finalMediaDeclaration;\n};\n\nexport const manageRowsV2 = ({ rows, theme, isSpanParent }: InterpolatedFunctionProps): ReturnType<typeof css>[] => {\n // we want to be extremely explicit with how we handle the different use-cases\n // the component is quite old and has been tailored to fit the needs of the different use-cases\n // even ones that should have not been supported in the first place (isSpanParent to simulate bootstrap, different kind of rows definitions, etc)\n // support for\n // rows:{small: 1, medium: 2, large: 3}\n // AND\n // rows: {small: ['1fr'], medium: ['160px'], large: ['400px'] }\n if (rowsIsBreakpointDefinition(rows)) {\n // there is no way to guarantee dynamic co-relation between pui-theme and the grid component\n // any change in the theme will break the co-relation and we would need to update the component\n // for such reason we are optimizing for maintainability and not scalability\n return generateRowsWithMediaQueries(rows, theme, isSpanParent);\n }\n\n // support for rows: ['1fr', '1fr', '1fr'] && rows: [1, 1, 1]\n if (Array.isArray(rows)) {\n const cssString = generateRowsCssStringForArray(rows);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // support for parent is span and is like rows: 3\n if (isSpanParent) {\n const cssString = generateRowsCssStringForBootstrapLikeishScenario(rows);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // fallback is not doing anything\n return [css``];\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA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KAAK,KAAK,GAAG;AAC7B,kBAAY,8BAA8B,KAAK,KAAK;AAAA,IACtD,WAAW,cAAc;AACvB,kBAAY,iDAAiD,KAAK,KAAK;AAAA,IACzE;AACA,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB;AAAA,OACH;AACH,0BAAsB,KAAK,MAAM,MAAM,QAAQ,WAAW;AAAA,EAC5D;AACA,SAAO;AACT;AAEO,MAAM,eAAe,CAAC,EAAE,MAAM,OAAO,aAAa,MAA2D;AAQlH,MAAI,2BAA2B,IAAI,GAAG;AAIpC,WAAO,6BAA6B,MAAM,OAAO,YAAY;AAAA,EAC/D;AAGA,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,UAAM,YAAY,8BAA8B,IAAI;AACpD,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,MAAI,cAAc;AAChB,UAAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,SAAO,CAAC,sBAAK;AACf;",
4
+ "sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport type { DSGridT } from '../react-desc-prop-types.js';\nimport type { Theme } from '@elliemae/pui-theme';\n\n// this typeguard is not extremely accurate but it has historically been like this and we need to avoid breaking changes\nconst rowsIsBreakpointDefinition = (rows: unknown): rows is DSGridT.RowColBreakpoints =>\n typeof rows === 'object' && !Array.isArray(rows);\ntype InterpolatedFunctionProps = {\n theme: Theme;\n} & DSGridT.ItemProps;\n\nconst generateRowsCssStringForArray = (rowsVal: DSGridT.RowOrColsSyntaxSugar[]): string => {\n // mtg and mtgs are used to support mapping different ways of defining the rows\n // when mtg produces valid css, mtgs will produce invalid css and vice-versa\n // only one of them will be effectively applied by the browser\n const mtg = (mapTemplateGrid(rowsVal as DSGridT.RowOrColsSyntaxSugar) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rowsVal as DSGridT.RowOrColsSyntaxSugar) as string[])\n .map((c) => `minmax(0, ${c})`)\n .join(' ');\n return `\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n `;\n};\nconst generateRowsCssStringForBootstrapLikeishScenario = (rowsVal: string | number): string => `\n -ms-grid-rows: repeat(${rowsVal}, 1fr);\n grid-template-rows: repeat(${rowsVal}, 1fr);\n `;\nconst generateRowsWithMediaQueries = (\n rows: DSGridT.RowColBreakpoints,\n theme: Theme,\n isSpanParent: boolean,\n): ReturnType<typeof css>[] => {\n const finalMediaDeclaration: ReturnType<typeof css>[] = [];\n // we conditionally push into the array the media queries because grid rows definitions supports partial definitions\n // meaning that you can define rows only for small and medium and not for large\n // in such case we want to avoid generating media queries for large\n // we also need to make sure that the largest definition is used as the default one\n if (rows.large) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(rows.large)) {\n cssString = generateRowsCssStringForArray(rows.large);\n } else if (isSpanParent) {\n cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.large);\n }\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.large`${cssString}`);\n }\n if (rows.medium) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(rows.medium)) {\n cssString = generateRowsCssStringForArray(rows.medium);\n } else if (isSpanParent) {\n cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.medium);\n }\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.medium`${cssString}`);\n }\n if (rows.small) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(rows.small)) {\n cssString = generateRowsCssStringForArray(rows.small);\n } else if (isSpanParent) {\n cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.small);\n }\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.small`${cssString}`);\n }\n return finalMediaDeclaration;\n};\n\nexport const manageRowsV2 = ({ rows, theme, isSpanParent }: InterpolatedFunctionProps): ReturnType<typeof css>[] => {\n // we want to be extremely explicit with how we handle the different use-cases\n // the component is quite old and has been tailored to fit the needs of the different use-cases\n // even ones that should have not been supported in the first place (isSpanParent to simulate bootstrap, different kind of rows definitions, etc)\n // support for\n // rows:{small: 1, medium: 2, large: 3}\n // AND\n // rows: {small: ['1fr'], medium: ['160px'], large: ['400px'] }\n if (rowsIsBreakpointDefinition(rows)) {\n // there is no way to guarantee dynamic co-relation between pui-theme and the grid component\n // any change in the theme will break the co-relation and we would need to update the component\n // for such reason we are optimizing for maintainability and not scalability\n return generateRowsWithMediaQueries(rows, theme, isSpanParent);\n }\n\n // support for rows: ['1fr', '1fr', '1fr'] && rows: [1, 1, 1]\n if (Array.isArray(rows)) {\n const cssString = generateRowsCssStringForArray(rows);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // support for parent is span and is like rows: 3\n if (isSpanParent) {\n const cssString = generateRowsCssStringForBootstrapLikeishScenario(rows);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // fallback is not doing anything\n return [css``];\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,uBAAqC;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KAAK,KAAK;AAAA,IACtD,WAAW,cAAc;AACvB,kBAAY,iDAAiD,KAAK,KAAK;AAAA,IACzE;AACA,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB;AAAA,OACH;AACH,0BAAsB,KAAK,MAAM,MAAM,QAAQ,WAAW;AAAA,EAC5D;AACA,SAAO;AACT;AAEO,MAAM,eAAe,CAAC,EAAE,MAAM,OAAO,aAAa,MAA2D;AAQlH,MAAI,2BAA2B,IAAI,GAAG;AAIpC,WAAO,6BAA6B,MAAM,OAAO,YAAY;AAAA,EAC/D;AAGA,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,UAAM,YAAY,8BAA8B,IAAI;AACpD,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,MAAI,cAAc;AAChB,UAAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,SAAO,CAAC,sBAAK;AACf;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/utils/styles.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport type { DSGridT } from '../react-desc-prop-types.js';\n\nexport const manageSpan = css<DSGridT.ItemProps>`\n ${({ isSpanParent, span, theme }) => {\n if (!isSpanParent) return '';\n\n if (typeof span === 'number') {\n return `\n -ms-grid-column: auto / span ${span};\n grid-column: auto / span ${span};`;\n }\n\n if (typeof span !== 'object') return ``;\n\n // Span object\n\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n // Type castings\n const theKey = key as keyof typeof span & keyof typeof theme.breakpoints;\n const spanValue = span[theKey];\n\n if (!!spanValue && theme.breakpoints[theKey]) {\n if (theKey === 'small') {\n data += `\n -ms-grid-column: auto / span ${spanValue};\n grid-column: auto / span ${spanValue};\n `;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-column: auto / span ${spanValue};\n grid-column: auto / span ${spanValue};\n }`;\n }\n }\n });\n return data;\n }}\n`;\n\nexport const manageCols = css<DSGridT.ItemProps>`\n ${({ cols, theme, isSpanParent }) => {\n if (typeof cols === 'object' && !Array.isArray(cols)) {\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n const theKey = key as keyof typeof cols;\n const colValue = cols[theKey];\n if (!!colValue && Array.isArray(colValue)) {\n const mtg = (mapTemplateGrid(colValue) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(colValue) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n if (theKey === 'small') {\n data += `-ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};\n }`;\n }\n } else if (!!colValue && isSpanParent) {\n if (theKey === 'small') {\n data += `-ms-grid-columns: repeat(${colValue}, 1fr);\n grid-template-columns: repeat(${colValue}, 1fr);`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-columns: repeat(${colValue}, 1fr);\n grid-template-columns: repeat(${colValue}, 1fr);\n }`;\n }\n }\n });\n return data;\n }\n if (Array.isArray(cols)) {\n const mtg = (mapTemplateGrid(cols) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(cols) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};`;\n }\n if (isSpanParent) {\n return `\n -ms-grid-columns: repeat(${cols}, 1fr);\n grid-template-columns: repeat(${cols}, 1fr);`;\n }\n return '';\n }}\n`;\n\nexport const manageRows = css<DSGridT.ItemProps>`\n ${({ rows, theme, isSpanParent }) => {\n if (typeof rows === 'object' && !Array.isArray(rows)) {\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n const theKey = key as keyof typeof rows & keyof typeof theme.breakpoints;\n const rowValue = rows[theKey];\n if (rowValue && Array.isArray(rowValue)) {\n const mtg = (mapTemplateGrid(rowValue) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rowValue) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n if (key === 'small') {\n data += `-ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n }`;\n }\n } else if (!!rowValue && isSpanParent) {\n if (theKey === 'small') {\n data += `-ms-grid-rows: repeat(${rowValue}, 1fr);\n grid-template-rows: repeat(${rowValue}, 1fr);`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-rows: repeat(${rowValue}, 1fr);\n grid-template-rows: repeat(${rowValue}, 1fr);\n }`;\n }\n }\n });\n return data;\n }\n if (Array.isArray(rows)) {\n const mtg = (mapTemplateGrid(rows) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rows) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n `;\n }\n if (isSpanParent) {\n return `\n -ms-grid-rows: repeat(${rows}, 1fr);\n grid-template-rows: repeat(${rows}, 1fr);`;\n }\n return '';\n }}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,uBAAqC;AAG9B,MAAM,aAAa;AAAA,IACtB,CAAC,EAAE,cAAc,MAAM,MAAM,MAAM;AACnC,MAAI,CAAC;AAAc,WAAO;AAE1B,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO;AAAA,uCAC0B;AAAA,mCACJ;AAAA,EAC/B;AAEA,MAAI,OAAO,SAAS;AAAU,WAAO;AAIrC,MAAI,OAAO;AACX,SAAO,KAAK,MAAM,KAAK,EAAE,QAAQ,CAAC,QAAQ;AAExC,UAAM,SAAS;AACf,UAAM,YAAY,KAAK,MAAM;AAE7B,QAAI,CAAC,CAAC,aAAa,MAAM,YAAY,MAAM,GAAG;AAC5C,UAAI,WAAW,SAAS;AACtB,gBAAQ;AAAA,2CACyB;AAAA,uCACJ;AAAA;AAAA,MAE/B,OAAO;AACL,gBAAQ,sBAAsB,MAAM,YAAY,MAAM;AAAA,mDACb;AAAA,+CACJ;AAAA;AAAA,MAEvC;AAAA,IACF;AAAA,EACF,CAAC;AACD,SAAO;AACT;AAAA;AAGK,MAAM,aAAa;AAAA,IACtB,CAAC,EAAE,MAAM,OAAO,aAAa,MAAM;AACnC,MAAI,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI,GAAG;AACpD,QAAI,OAAO;AACX,WAAO,KAAK,MAAM,KAAK,EAAE,QAAQ,CAAC,QAAQ;AACxC,YAAM,SAAS;AACf,YAAM,WAAW,KAAK,MAA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* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport type { DSGridT } from '../react-desc-prop-types.js';\n\nexport const manageSpan = css<DSGridT.ItemProps>`\n ${({ isSpanParent, span, theme }) => {\n if (!isSpanParent) return '';\n\n if (typeof span === 'number') {\n return `\n -ms-grid-column: auto / span ${span};\n grid-column: auto / span ${span};`;\n }\n\n if (typeof span !== 'object') return ``;\n\n // Span object\n\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n // Type castings\n const theKey = key as keyof typeof span & keyof typeof theme.breakpoints;\n const spanValue = span[theKey];\n\n if (!!spanValue && theme.breakpoints[theKey]) {\n if (theKey === 'small') {\n data += `\n -ms-grid-column: auto / span ${spanValue};\n grid-column: auto / span ${spanValue};\n `;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-column: auto / span ${spanValue};\n grid-column: auto / span ${spanValue};\n }`;\n }\n }\n });\n return data;\n }}\n`;\n\nexport const manageCols = css<DSGridT.ItemProps>`\n ${({ cols, theme, isSpanParent }) => {\n if (typeof cols === 'object' && !Array.isArray(cols)) {\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n const theKey = key as keyof typeof cols;\n const colValue = cols[theKey];\n if (!!colValue && Array.isArray(colValue)) {\n const mtg = (mapTemplateGrid(colValue as DSGridT.RowOrColsSyntaxSugar) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(colValue as DSGridT.RowOrColsSyntaxSugar) as string[])\n .map((c) => `minmax(0, ${c})`)\n .join(' ');\n if (theKey === 'small') {\n data += `-ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};\n }`;\n }\n } else if (!!colValue && isSpanParent) {\n if (theKey === 'small') {\n data += `-ms-grid-columns: repeat(${colValue}, 1fr);\n grid-template-columns: repeat(${colValue}, 1fr);`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-columns: repeat(${colValue}, 1fr);\n grid-template-columns: repeat(${colValue}, 1fr);\n }`;\n }\n }\n });\n return data;\n }\n if (Array.isArray(cols)) {\n const mtg = (mapTemplateGrid(cols) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(cols) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};`;\n }\n if (isSpanParent) {\n return `\n -ms-grid-columns: repeat(${cols}, 1fr);\n grid-template-columns: repeat(${cols}, 1fr);`;\n }\n return '';\n }}\n`;\n\nexport const manageRows = css<DSGridT.ItemProps>`\n ${({ rows, theme, isSpanParent }) => {\n if (typeof rows === 'object' && !Array.isArray(rows)) {\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n const theKey = key as keyof typeof rows & keyof typeof theme.breakpoints;\n const rowValue = rows[theKey];\n if (rowValue && Array.isArray(rowValue)) {\n const mtg = (mapTemplateGrid(rowValue as DSGridT.RowOrColsSyntaxSugar) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rowValue as DSGridT.RowOrColsSyntaxSugar) as string[])\n .map((c) => `minmax(0, ${c})`)\n .join(' ');\n if (key === 'small') {\n data += `-ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n }`;\n }\n } else if (!!rowValue && isSpanParent) {\n if (theKey === 'small') {\n data += `-ms-grid-rows: repeat(${rowValue}, 1fr);\n grid-template-rows: repeat(${rowValue}, 1fr);`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-rows: repeat(${rowValue}, 1fr);\n grid-template-rows: repeat(${rowValue}, 1fr);\n }`;\n }\n }\n });\n return data;\n }\n if (Array.isArray(rows)) {\n const mtg = (mapTemplateGrid(rows) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rows) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n `;\n }\n if (isSpanParent) {\n return `\n -ms-grid-rows: repeat(${rows}, 1fr);\n grid-template-rows: repeat(${rows}, 1fr);`;\n }\n return '';\n }}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,uBAAqC;AAG9B,MAAM,aAAa;AAAA,IACtB,CAAC,EAAE,cAAc,MAAM,MAAM,MAAM;AACnC,MAAI,CAAC;AAAc,WAAO;AAE1B,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO;AAAA,uCAC0B;AAAA,mCACJ;AAAA,EAC/B;AAEA,MAAI,OAAO,SAAS;AAAU,WAAO;AAIrC,MAAI,OAAO;AACX,SAAO,KAAK,MAAM,KAAK,EAAE,QAAQ,CAAC,QAAQ;AAExC,UAAM,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;AACL,kBAAQ,sBAAsB,MAAM,YAAY,MAAM;AAAA,8CACpB;AAAA,mDACK;AAAA;AAAA,QAEzC;AAAA,MACF;AAAA,IACF,CAAC;AACD,WAAO;AAAA,EACT;AACA,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,UAAM,UAAO,kCAAgB,IAAI,EAAe,KAAK,GAAG;AACxD,UAAM,WAAQ,kCAAgB,IAAI,EAAe,IAAI,CAAC,MAAM,aAAa,IAAI,EAAE,KAAK,GAAG;AACvF,WAAO;AAAA,yBACY,OAAO;AAAA,8BACF,OAAO;AAAA,yBACZ,QAAQ;AAAA,8BACH,QAAQ;AAAA;AAAA,EAElC;AACA,MAAI,cAAc;AAChB,WAAO;AAAA,gCACmB;AAAA,qCACK;AAAA,EACjC;AACA,SAAO;AACT;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { alignItemsPlacement, justifyPlacement, wrap, boxShadow } from './utils/constants.js';\n\nexport declare namespace DSGridT {\n interface RowColBreakpoints {\n small?: string | number | (string | number)[];\n medium?: string | number | (string | number)[];\n large?: string | number | (string | number)[];\n }\n\n interface SpanBreakpoints {\n small?: number;\n medium?: number;\n large?: number;\n }\n\n type JustifyPlacement = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';\n type AlignItemsPlacement = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';\n type Wrap = 'wrap' | 'nowrap' | 'wrap-reverse';\n type BoxShadow = 'xs' | 's' | 'm' | 'l' | 'xl';\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n rows: string[] | string | number[] | RowColBreakpoints;\n cols: string[] | string | number[] | RowColBreakpoints;\n className: string;\n justify: JustifyPlacement;\n wrap: Wrap;\n span: number | SpanBreakpoints;\n justifyItems: string;\n }\n\n export interface OptionalProps {\n height?: string | number;\n width?: string | number;\n justifyContent?: JustifyPlacement;\n alignItems?: AlignItemsPlacement;\n alignContent?: AlignItemsPlacement;\n children?: React.ReactNode;\n withMaxWidthBreakpoints?: boolean;\n rowGap?: string | number;\n gutter?: string | number;\n innerRef?: React.MutableRefObject<HTMLDivElement | null> | React.RefCallback<HTMLDivElement>;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps {}\n\n export interface ItemProps {\n rows: string[] | string | number[] | RowColBreakpoints;\n cols: string[] | string | number[] | RowColBreakpoints;\n alignItems?: AlignItemsPlacement;\n alignContent?: AlignItemsPlacement;\n children: React.ReactNode;\n className?: string;\n justify: JustifyPlacement;\n gutter?: string | number;\n wrap: Wrap;\n childNumber: number;\n isSpanParent: boolean;\n span?: number | SpanBreakpoints;\n withMaxWidthBreakpoints?: boolean;\n }\n}\n\nexport const defaultProps: DSGridT.DefaultProps = {\n rows: [],\n cols: [],\n className: '',\n justify: 'flex-start',\n wrap: 'wrap',\n span: 1,\n justifyItems: 'normal',\n};\n\n// =============================================================================\n// PropTypes\n// =============================================================================\nconst rowColBreakpoints = PropTypes.shape({\n small: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n medium: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n large: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n});\n\nconst spanBreakpoints = PropTypes.shape({\n small: PropTypes.number,\n medium: PropTypes.number,\n large: PropTypes.number,\n});\n\nexport const DSGridPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n rows: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n PropTypes.number,\n rowColBreakpoints,\n ])\n .description('Row layout cells')\n .defaultValue([]),\n cols: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n PropTypes.number,\n rowColBreakpoints,\n ])\n .description('Column layout cells')\n .defaultValue([]),\n span: PropTypes.oneOfType([PropTypes.number, spanBreakpoints]).description(\n 'Expands the grid element within columns.',\n ),\n alignItems: PropTypes.oneOf(alignItemsPlacement).description('flex-like align items prop'),\n children: PropTypes.node.description('Children node inside grid cell'),\n className: PropTypes.string.description('CSS class').defaultValue(''),\n justifyContent: PropTypes.oneOf(justifyPlacement)\n .description('flex-like justify prop')\n .defaultValue(justifyPlacement[0]),\n gutter: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('Space between cells prop')\n .defaultValue(0),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Ref to the grid'),\n wrap: PropTypes.oneOf(wrap).description('Wrap type').defaultValue(wrap[0]),\n withMaxWidthBreakpoints: PropTypes.bool.description('weather use max width').defaultValue(undefined),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid height.'),\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid width.'),\n backgroundColor: PropTypes.string.description('Sets background color.'),\n bg: PropTypes.string.description('Sets background color.'),\n boxShadow: PropTypes.oneOf(boxShadow).description('Sets background color.'),\n border: PropTypes.string.description('Sets border.'),\n borderRadius: PropTypes.string.description('Sets border radius.'),\n borderWidth: PropTypes.string.description('Sets border width.'),\n borderStyle: PropTypes.string.description('Sets border style.'),\n borderColor: PropTypes.string.description('Sets border color.'),\n borderTop: PropTypes.string.description('Sets top border.'),\n borderBottom: PropTypes.string.description('Sets bottom border.'),\n borderLeft: PropTypes.string.description('Sets left border.'),\n borderRight: PropTypes.string.description('Sets right border.'),\n borderTopWidth: PropTypes.string.description('Sets border top width.'),\n borderTopStyle: PropTypes.string.description('Sets border top style.'),\n borderTopColor: PropTypes.string.description('Sets border top color.'),\n borderBottomWidth: PropTypes.string.description('Sets border bottom width.'),\n borderBottomStyle: PropTypes.string.description('Sets border bottom style.'),\n borderBottomColor: PropTypes.string.description('Sets border bottom color.'),\n borderRightWidth: PropTypes.string.description('Sets border right width.'),\n borderRightStyle: PropTypes.string.description('Sets border right style.'),\n borderRightColor: PropTypes.string.description('Sets border right color.'),\n borderLeftWidth: PropTypes.string.description('Sets border left width.'),\n borderLeftStyle: PropTypes.string.description('Sets border left style.'),\n borderLeftColor: PropTypes.string.description('Sets border left color.'),\n} as WeakValidationMap<unknown>;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE,SAAS,qBAAqB,kBAAkB,MAAM,iBAAiB;AA0EhE,MAAM,eAAqC;AAAA,EAChD,MAAM,CAAC;AAAA,EACP,MAAM,CAAC;AAAA,EACP,WAAW;AAAA,EACX,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,cAAc;AAChB;AAKA,MAAM,oBAAoB,UAAU,MAAM;AAAA,EACxC,OAAO,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC;AAAA,EAClF,QAAQ,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC;AAAA,EACnF,OAAO,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC;AACpF,CAAC;AAED,MAAM,kBAAkB,UAAU,MAAM;AAAA,EACt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YAAY,yBAAyB;AAAA,EACvE,iBAAiB,UAAU,OAAO,YAAY,yBAAyB;AACzE;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { alignItemsPlacement, justifyPlacement, wrap, boxShadow } from './utils/constants.js';\n\nexport declare namespace DSGridT {\n export type RowOrColsSyntaxSugar = string | number | (string | number)[];\n\n export interface RowColBreakpoints {\n small?: RowOrColsSyntaxSugar[];\n medium?: RowOrColsSyntaxSugar[];\n large?: RowOrColsSyntaxSugar[];\n }\n\n export type RowOrColsValidValues = RowOrColsSyntaxSugar | RowColBreakpoints;\n\n export interface SpanBreakpoints {\n small?: number;\n medium?: number;\n large?: number;\n }\n\n export type JustifyPlacement =\n | 'flex-start'\n | 'center'\n | 'flex-end'\n | 'space-between'\n | 'space-around'\n | 'space-evenly';\n export type AlignItemsPlacement = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';\n export type Wrap = 'wrap' | 'nowrap' | 'wrap-reverse';\n export type BoxShadow = 'xs' | 's' | 'm' | 'l' | 'xl';\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n rows: RowOrColsValidValues;\n cols: RowOrColsValidValues;\n className: string;\n justify: JustifyPlacement;\n wrap: Wrap;\n span: number | SpanBreakpoints;\n justifyItems: string;\n }\n\n export interface OptionalProps {\n height?: string | number;\n width?: string | number;\n justifyContent?: JustifyPlacement;\n alignItems?: AlignItemsPlacement;\n alignContent?: AlignItemsPlacement;\n children?: React.ReactNode;\n withMaxWidthBreakpoints?: boolean;\n rowGap?: string | number;\n gutter?: string | number;\n innerRef?: React.MutableRefObject<HTMLDivElement | null> | React.RefCallback<HTMLDivElement>;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps {}\n\n export interface ItemProps {\n rows: RowOrColsValidValues;\n cols: RowOrColsValidValues;\n alignItems?: AlignItemsPlacement;\n alignContent?: AlignItemsPlacement;\n children: React.ReactNode;\n className?: string;\n justify: JustifyPlacement;\n gutter?: string | number;\n wrap: Wrap;\n childNumber: number;\n isSpanParent: boolean;\n span?: number | SpanBreakpoints;\n withMaxWidthBreakpoints?: boolean;\n }\n}\n\nexport const defaultProps: DSGridT.DefaultProps = {\n rows: [],\n cols: [],\n className: '',\n justify: 'flex-start',\n wrap: 'wrap',\n span: 1,\n justifyItems: 'normal',\n};\n\n// =============================================================================\n// PropTypes\n// =============================================================================\nconst rowColBreakpoints = PropTypes.shape({\n small: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n medium: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n large: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n});\n\nconst spanBreakpoints = PropTypes.shape({\n small: PropTypes.number,\n medium: PropTypes.number,\n large: PropTypes.number,\n});\n\nexport const DSGridPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n rows: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n PropTypes.number,\n rowColBreakpoints,\n ])\n .description('Row layout cells')\n .defaultValue([]),\n cols: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n PropTypes.number,\n rowColBreakpoints,\n ])\n .description('Column layout cells')\n .defaultValue([]),\n span: PropTypes.oneOfType([PropTypes.number, spanBreakpoints]).description(\n 'Expands the grid element within columns.',\n ),\n alignItems: PropTypes.oneOf(alignItemsPlacement).description('flex-like align items prop'),\n children: PropTypes.node.description('Children node inside grid cell'),\n className: PropTypes.string.description('CSS class').defaultValue(''),\n justifyContent: PropTypes.oneOf(justifyPlacement)\n .description('flex-like justify prop')\n .defaultValue(justifyPlacement[0]),\n gutter: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('Space between cells prop')\n .defaultValue(0),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Ref to the grid'),\n wrap: PropTypes.oneOf(wrap).description('Wrap type').defaultValue(wrap[0]),\n withMaxWidthBreakpoints: PropTypes.bool.description('weather use max width').defaultValue(undefined),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid height.'),\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid width.'),\n backgroundColor: PropTypes.string.description('Sets background color.'),\n bg: PropTypes.string.description('Sets background color.'),\n boxShadow: PropTypes.oneOf(boxShadow).description('Sets background color.'),\n border: PropTypes.string.description('Sets border.'),\n borderRadius: PropTypes.string.description('Sets border radius.'),\n borderWidth: PropTypes.string.description('Sets border width.'),\n borderStyle: PropTypes.string.description('Sets border style.'),\n borderColor: PropTypes.string.description('Sets border color.'),\n borderTop: PropTypes.string.description('Sets top border.'),\n borderBottom: PropTypes.string.description('Sets bottom border.'),\n borderLeft: PropTypes.string.description('Sets left border.'),\n borderRight: PropTypes.string.description('Sets right border.'),\n borderTopWidth: PropTypes.string.description('Sets border top width.'),\n borderTopStyle: PropTypes.string.description('Sets border top style.'),\n borderTopColor: PropTypes.string.description('Sets border top color.'),\n borderBottomWidth: PropTypes.string.description('Sets border bottom width.'),\n borderBottomStyle: PropTypes.string.description('Sets border bottom style.'),\n borderBottomColor: PropTypes.string.description('Sets border bottom color.'),\n borderRightWidth: PropTypes.string.description('Sets border right width.'),\n borderRightStyle: PropTypes.string.description('Sets border right style.'),\n borderRightColor: PropTypes.string.description('Sets border right color.'),\n borderLeftWidth: PropTypes.string.description('Sets border left width.'),\n borderLeftStyle: PropTypes.string.description('Sets border left style.'),\n borderLeftColor: PropTypes.string.description('Sets border left color.'),\n} as WeakValidationMap<unknown>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE,SAAS,qBAAqB,kBAAkB,MAAM,iBAAiB;AAoFhE,MAAM,eAAqC;AAAA,EAChD,MAAM,CAAC;AAAA,EACP,MAAM,CAAC;AAAA,EACP,WAAW;AAAA,EACX,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,cAAc;AAChB;AAKA,MAAM,oBAAoB,UAAU,MAAM;AAAA,EACxC,OAAO,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC;AAAA,EAClF,QAAQ,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC;AAAA,EACnF,OAAO,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC;AACpF,CAAC;AAED,MAAM,kBAAkB,UAAU,MAAM;AAAA,EACtC,OAAO,UAAU;AAAA,EACjB,QAAQ,UAAU;AAAA,EAClB,OAAO,UAAU;AACnB,CAAC;AAEM,MAAM,kBAAkB;AAAA,EAC7B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,UAAU,UAAU;AAAA,IACxB,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC;AAAA,IAC3E,UAAU;AAAA,IACV;AAAA,EACF,CAAC,EACE,YAAY,kBAAkB,EAC9B,aAAa,CAAC,CAAC;AAAA,EAClB,MAAM,UAAU,UAAU;AAAA,IACxB,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC;AAAA,IAC3E,UAAU;AAAA,IACV;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AU,OAAO,YAAY,oBAAoB;AAAA,EAC9D,aAAa,UAAU,OAAO,YAAY,oBAAoB;AAAA,EAC9D,WAAW,UAAU,OAAO,YAAY,kBAAkB;AAAA,EAC1D,cAAc,UAAU,OAAO,YAAY,qBAAqB;AAAA,EAChE,YAAY,UAAU,OAAO,YAAY,mBAAmB;AAAA,EAC5D,aAAa,UAAU,OAAO,YAAY,oBAAoB;AAAA,EAC9D,gBAAgB,UAAU,OAAO,YAAY,wBAAwB;AAAA,EACrE,gBAAgB,UAAU,OAAO,YAAY,wBAAwB;AAAA,EACrE,gBAAgB,UAAU,OAAO,YAAY,wBAAwB;AAAA,EACrE,mBAAmB,UAAU,OAAO,YAAY,2BAA2B;AAAA,EAC3E,mBAAmB,UAAU,OAAO,YAAY,2BAA2B;AAAA,EAC3E,mBAAmB,UAAU,OAAO,YAAY,2BAA2B;AAAA,EAC3E,kBAAkB,UAAU,OAAO,YAAY,0BAA0B;AAAA,EACzE,kBAAkB,UAAU,OAAO,YAAY,0BAA0B;AAAA,EACzE,kBAAkB,UAAU,OAAO,YAAY,0BAA0B;AAAA,EACzE,iBAAiB,UAAU,OAAO,YAAY,yBAAyB;AAAA,EACvE,iBAAiB,UAAU,OAAO,YAAY,yBAAyB;AAAA,EACvE,iBAAiB,UAAU,OAAO,YAAY,yBAAyB;AACzE;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/manageCols.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport type { DSGridT } from '../react-desc-prop-types.js';\nimport type { Theme } from '@elliemae/pui-theme';\n\ntype BreakPointObject = {\n large?: string | number | (string | number)[];\n medium?: string | number | (string | number)[];\n small?: string | number | (string | number)[];\n};\n// this typeguard is not extremely accurate but it has historically been like this and we need to avoid breaking changes\nconst colsIsBreakpointDefinition = (cols: unknown): cols is BreakPointObject =>\n typeof cols === 'object' && !Array.isArray(cols);\ntype InterpolatedFunctionProps = {\n theme: Theme;\n} & DSGridT.ItemProps;\n\nconst generateColsCssStringForArray = (colsVal: (string | number)[]): string => {\n // mtg and mtgs are used to support mapping different ways of defining the cols\n // when mtg produces valid css, mtgs will produce invalid css and vice-versa\n // only one of them will be effectively applied by the browser\n const mtg = (mapTemplateGrid(colsVal) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(colsVal) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};\n `;\n};\nconst generateColsCssStringForBootstrapLikeishScenario = (colsVal: string | number): string => `\n -ms-grid-columns: repeat(${colsVal}, 1fr);\n grid-template-columns: repeat(${colsVal}, 1fr);\n `;\nconst generateColsWithMediaQueries = (\n cols: BreakPointObject,\n theme: Theme,\n isSpanParent: boolean,\n): ReturnType<typeof css>[] => {\n const finalMediaDeclaration: ReturnType<typeof css>[] = [];\n // we conditionally push into the array the media queries because grid cols definitions supports partial definitions\n // meaning that you can define cols only for small and medium and not for large\n // in such case we want to avoid generating media queries for large\n // we also need to make sure that the largest definition is used as the default one\n if (cols.large) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(cols.large)) {\n cssString = generateColsCssStringForArray(cols.large);\n } else if (isSpanParent) {\n cssString = generateColsCssStringForBootstrapLikeishScenario(cols.large);\n }\n finalMediaDeclaration.push(theme.media.large`${cssString}`);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n }\n if (cols.medium) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(cols.medium)) {\n cssString = generateColsCssStringForArray(cols.medium);\n } else if (isSpanParent) {\n cssString = generateColsCssStringForBootstrapLikeishScenario(cols.medium);\n }\n finalMediaDeclaration.push(theme.media.medium`${cssString}`);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n }\n if (cols.small) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(cols.small)) {\n cssString = generateColsCssStringForArray(cols.small);\n } else if (isSpanParent) {\n cssString = generateColsCssStringForBootstrapLikeishScenario(cols.small);\n }\n finalMediaDeclaration.push(theme.media.small`${cssString}`);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n }\n return finalMediaDeclaration;\n};\n\nexport const manageColsV2 = ({ cols, theme, isSpanParent }: InterpolatedFunctionProps): ReturnType<typeof css>[] => {\n // we want to be extremely explicit with how we handle the different use-cases\n // the component is quite old and has been tailored to fit the needs of the different use-cases\n // even ones that should have not been supported in the first place (isSpanParent to simulate bootstrap, different kind of cols definitions, etc)\n // support for\n // cols:{small: 1, medium: 2, large: 3}\n // AND\n // cols: {small: ['1fr'], medium: ['160px'], large: ['400px'] }\n if (colsIsBreakpointDefinition(cols)) {\n // there is no way to guarantee dynamic co-relation between pui-theme and the grid component\n // any change in the theme will break the co-relation and we would need to update the component\n // for such reason we are optimizing for maintainability and not scalability\n return generateColsWithMediaQueries(cols, theme, isSpanParent);\n }\n\n // support for cols: ['1fr', '1fr', '1fr'] && cols: [1, 1, 1]\n if (Array.isArray(cols)) {\n const cssString = generateColsCssStringForArray(cols);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // support for parent is span and is like cols: 3\n if (isSpanParent) {\n const cssString = generateColsCssStringForBootstrapLikeishScenario(cols);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // fallback is not doing anything\n return [css``];\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,KAAK,uBAAuB;AAUrC,MAAM,6BAA6B,CAAC,SAClC,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI;AAKjD,MAAM,gCAAgC,CAAC,YAAyC;AAI9E,QAAM,MAAO,gBAAgB,OAAO,EAAe,KAAK,GAAG;AAC3D,QAAM,OAAQ,gBAAgB,OAAO,EAAe,IAAI,CAAC,MAAM,aAAa,IAAI,EAAE,KAAK,GAAG;AAC1F,SAAO;AAAA,0BACiB,OAAO;AAAA,+BACF,OAAO;AAAA,0BACZ,QAAQ;AAAA,+BACH,QAAQ;AAAA;AAEvC;AACA,MAAM,mDAAmD,CAAC,YAAqC;AAAA,iCAC9D;AAAA,sCACK;AAAA;AAEtC,MAAM,+BAA+B,CACnC,MACA,OACA,iBAC6B;AAC7B,QAAM,wBAAkD,CAAC;AAKzD,MAAI,KAAK,OAAO;AAId,QAAI,YAAY;AAChB,QAAI,MAAM,QAAQ,KAAK,KAAK,GAAG;AAC7B,kBAAY,8BAA8B,KAAK,KAAK;AAAA,IACtD,WAAW,cAAc;AACvB,kBAAY,iDAAiD,KAAK,KAAK;AAAA,IACzE;AACA,0BAAsB,KAAK,MAAM,MAAM,QAAQ,WAAW;AAC1D,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB;AAAA,OACH;AAAA,EACL;AACA,MAAI,KAAK,QAAQ;AAIf,QAAI,YAAY;AAChB,QAAI,MAAM,QAAQ,KAAK,MAAM,GAAG;AAC9B,kBAAY,8BAA8B,KAAK,MAAM;AAAA,IACvD,WAAW,cAAc;AACvB,kBAAY,iDAAiD,KAAK,MAAM;AAAA,IAC1E;AACA,0BAAsB,KAAK,MAAM,MAAM,SAAS,WAAW;AAC3D,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB;AAAA,OACH;AAAA,EACL;AACA,MAAI,KAAK,OAAO;AAId,QAAI,YAAY;AAChB,QAAI,MAAM,QAAQ,KAAK,KAAK,GAAG;AAC7B,kBAAY,8BAA8B,KAAK,KAAK;AAAA,IACtD,WAAW,cAAc;AACvB,kBAAY,iDAAiD,KAAK,KAAK;AAAA,IACzE;AACA,0BAAsB,KAAK,MAAM,MAAM,QAAQ,WAAW;AAC1D,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB;AAAA,OACH;AAAA,EACL;AACA,SAAO;AACT;AAEO,MAAM,eAAe,CAAC,EAAE,MAAM,OAAO,aAAa,MAA2D;AAQlH,MAAI,2BAA2B,IAAI,GAAG;AAIpC,WAAO,6BAA6B,MAAM,OAAO,YAAY;AAAA,EAC/D;AAGA,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,UAAM,YAAY,8BAA8B,IAAI;AACpD,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,MAAI,cAAc;AAChB,UAAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,SAAO,CAAC,KAAK;AACf;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport type { DSGridT } from '../react-desc-prop-types.js';\nimport type { Theme } from '@elliemae/pui-theme';\n\n// this typeguard is not extremely accurate but it has historically been like this and we need to avoid breaking changes\nconst colsIsBreakpointDefinition = (cols: unknown): cols is DSGridT.RowColBreakpoints =>\n typeof cols === 'object' && !Array.isArray(cols);\ntype InterpolatedFunctionProps = {\n theme: Theme;\n} & DSGridT.ItemProps;\n\nconst generateColsCssStringForArray = (colsVal: DSGridT.RowOrColsSyntaxSugar[]): string => {\n // mtg and mtgs are used to support mapping different ways of defining the cols\n // when mtg produces valid css, mtgs will produce invalid css and vice-versa\n // only one of them will be effectively applied by the browser\n const mtg = (mapTemplateGrid(colsVal as DSGridT.RowOrColsSyntaxSugar) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(colsVal as DSGridT.RowOrColsSyntaxSugar) as string[])\n .map((c) => `minmax(0, ${c})`)\n .join(' ');\n return `\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};\n `;\n};\nconst generateColsCssStringForBootstrapLikeishScenario = (colsVal: string | number): string => `\n -ms-grid-columns: repeat(${colsVal}, 1fr);\n grid-template-columns: repeat(${colsVal}, 1fr);\n `;\nconst generateColsWithMediaQueries = (\n cols: DSGridT.RowColBreakpoints,\n theme: Theme,\n isSpanParent: boolean,\n): ReturnType<typeof css>[] => {\n const finalMediaDeclaration: ReturnType<typeof css>[] = [];\n // we conditionally push into the array the media queries because grid cols definitions supports partial definitions\n // meaning that you can define cols only for small and medium and not for large\n // in such case we want to avoid generating media queries for large\n // we also need to make sure that the largest definition is used as the default one\n if (cols.large) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(cols.large)) {\n cssString = generateColsCssStringForArray(cols.large);\n } else if (isSpanParent) {\n cssString = generateColsCssStringForBootstrapLikeishScenario(cols.large);\n }\n finalMediaDeclaration.push(theme.media.large`${cssString}`);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n }\n if (cols.medium) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(cols.medium)) {\n cssString = generateColsCssStringForArray(cols.medium);\n } else if (isSpanParent) {\n cssString = generateColsCssStringForBootstrapLikeishScenario(cols.medium);\n }\n finalMediaDeclaration.push(theme.media.medium`${cssString}`);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n }\n if (cols.small) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(cols.small)) {\n cssString = generateColsCssStringForArray(cols.small);\n } else if (isSpanParent) {\n cssString = generateColsCssStringForBootstrapLikeishScenario(cols.small);\n }\n finalMediaDeclaration.push(theme.media.small`${cssString}`);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n }\n return finalMediaDeclaration;\n};\n\nexport const manageColsV2 = ({ cols, theme, isSpanParent }: InterpolatedFunctionProps): ReturnType<typeof css>[] => {\n // we want to be extremely explicit with how we handle the different use-cases\n // the component is quite old and has been tailored to fit the needs of the different use-cases\n // even ones that should have not been supported in the first place (isSpanParent to simulate bootstrap, different kind of cols definitions, etc)\n // support for\n // cols:{small: 1, medium: 2, large: 3}\n // AND\n // cols: {small: ['1fr'], medium: ['160px'], large: ['400px'] }\n if (colsIsBreakpointDefinition(cols)) {\n // there is no way to guarantee dynamic co-relation between pui-theme and the grid component\n // any change in the theme will break the co-relation and we would need to update the component\n // for such reason we are optimizing for maintainability and not scalability\n return generateColsWithMediaQueries(cols, theme, isSpanParent);\n }\n\n // support for cols: ['1fr', '1fr', '1fr'] && cols: [1, 1, 1]\n if (Array.isArray(cols)) {\n const cssString = generateColsCssStringForArray(cols);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // support for parent is span and is like cols: 3\n if (isSpanParent) {\n const cssString = generateColsCssStringForBootstrapLikeishScenario(cols);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // fallback is not doing anything\n return [css``];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AY;AAChB,QAAI,MAAM,QAAQ,KAAK,KAAK,GAAG;AAC7B,kBAAY,8BAA8B,KAAK,KAAK;AAAA,IACtD,WAAW,cAAc;AACvB,kBAAY,iDAAiD,KAAK,KAAK;AAAA,IACzE;AACA,0BAAsB,KAAK,MAAM,MAAM,QAAQ,WAAW;AAC1D,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB;AAAA,OACH;AAAA,EACL;AACA,SAAO;AACT;AAEO,MAAM,eAAe,CAAC,EAAE,MAAM,OAAO,aAAa,MAA2D;AAQlH,MAAI,2BAA2B,IAAI,GAAG;AAIpC,WAAO,6BAA6B,MAAM,OAAO,YAAY;AAAA,EAC/D;AAGA,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,UAAM,YAAY,8BAA8B,IAAI;AACpD,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,MAAI,cAAc;AAChB,UAAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,SAAO,CAAC,KAAK;AACf;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/manageRows.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport type { DSGridT } from '../react-desc-prop-types.js';\nimport type { Theme } from '@elliemae/pui-theme';\n\ntype BreakPointObject = {\n large?: string | number | (string | number)[];\n medium?: string | number | (string | number)[];\n small?: string | number | (string | number)[];\n};\n// this typeguard is not extremely accurate but it has historically been like this and we need to avoid breaking changes\nconst rowsIsBreakpointDefinition = (rows: unknown): rows is BreakPointObject =>\n typeof rows === 'object' && !Array.isArray(rows);\ntype InterpolatedFunctionProps = {\n theme: Theme;\n} & DSGridT.ItemProps;\n\nconst generateRowsCssStringForArray = (rowsVal: (string | number)[]): string => {\n // mtg and mtgs are used to support mapping different ways of defining the rows\n // when mtg produces valid css, mtgs will produce invalid css and vice-versa\n // only one of them will be effectively applied by the browser\n const mtg = (mapTemplateGrid(rowsVal) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rowsVal) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n `;\n};\nconst generateRowsCssStringForBootstrapLikeishScenario = (rowsVal: string | number): string => `\n -ms-grid-rows: repeat(${rowsVal}, 1fr);\n grid-template-rows: repeat(${rowsVal}, 1fr);\n `;\nconst generateRowsWithMediaQueries = (\n rows: BreakPointObject,\n theme: Theme,\n isSpanParent: boolean,\n): ReturnType<typeof css>[] => {\n const finalMediaDeclaration: ReturnType<typeof css>[] = [];\n // we conditionally push into the array the media queries because grid rows definitions supports partial definitions\n // meaning that you can define rows only for small and medium and not for large\n // in such case we want to avoid generating media queries for large\n // we also need to make sure that the largest definition is used as the default one\n if (rows.large) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(rows.large)) {\n cssString = generateRowsCssStringForArray(rows.large);\n } else if (isSpanParent) {\n cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.large);\n }\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.large`${cssString}`);\n }\n if (rows.medium) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(rows.medium)) {\n cssString = generateRowsCssStringForArray(rows.medium);\n } else if (isSpanParent) {\n cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.medium);\n }\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.medium`${cssString}`);\n }\n if (rows.small) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(rows.small)) {\n cssString = generateRowsCssStringForArray(rows.small);\n } else if (isSpanParent) {\n cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.small);\n }\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.small`${cssString}`);\n }\n return finalMediaDeclaration;\n};\n\nexport const manageRowsV2 = ({ rows, theme, isSpanParent }: InterpolatedFunctionProps): ReturnType<typeof css>[] => {\n // we want to be extremely explicit with how we handle the different use-cases\n // the component is quite old and has been tailored to fit the needs of the different use-cases\n // even ones that should have not been supported in the first place (isSpanParent to simulate bootstrap, different kind of rows definitions, etc)\n // support for\n // rows:{small: 1, medium: 2, large: 3}\n // AND\n // rows: {small: ['1fr'], medium: ['160px'], large: ['400px'] }\n if (rowsIsBreakpointDefinition(rows)) {\n // there is no way to guarantee dynamic co-relation between pui-theme and the grid component\n // any change in the theme will break the co-relation and we would need to update the component\n // for such reason we are optimizing for maintainability and not scalability\n return generateRowsWithMediaQueries(rows, theme, isSpanParent);\n }\n\n // support for rows: ['1fr', '1fr', '1fr'] && rows: [1, 1, 1]\n if (Array.isArray(rows)) {\n const cssString = generateRowsCssStringForArray(rows);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // support for parent is span and is like rows: 3\n if (isSpanParent) {\n const cssString = generateRowsCssStringForBootstrapLikeishScenario(rows);\n return [\n css`\n ${cssString}\n `,\n ];\n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OAAO;AAId,QAAI,YAAY;AAChB,QAAI,MAAM,QAAQ,KAAK,KAAK,GAAG;AAC7B,kBAAY,8BAA8B,KAAK,KAAK;AAAA,IACtD,WAAW,cAAc;AACvB,kBAAY,iDAAiD,KAAK,KAAK;AAAA,IACzE;AACA,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB;AAAA,OACH;AACH,0BAAsB,KAAK,MAAM,MAAM,QAAQ,WAAW;AAAA,EAC5D;AACA,SAAO;AACT;AAEO,MAAM,eAAe,CAAC,EAAE,MAAM,OAAO,aAAa,MAA2D;AAQlH,MAAI,2BAA2B,IAAI,GAAG;AAIpC,WAAO,6BAA6B,MAAM,OAAO,YAAY;AAAA,EAC/D;AAGA,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,UAAM,YAAY,8BAA8B,IAAI;AACpD,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,MAAI,cAAc;AAChB,UAAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,SAAO,CAAC,KAAK;AACf;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport type { DSGridT } from '../react-desc-prop-types.js';\nimport type { Theme } from '@elliemae/pui-theme';\n\n// this typeguard is not extremely accurate but it has historically been like this and we need to avoid breaking changes\nconst rowsIsBreakpointDefinition = (rows: unknown): rows is DSGridT.RowColBreakpoints =>\n typeof rows === 'object' && !Array.isArray(rows);\ntype InterpolatedFunctionProps = {\n theme: Theme;\n} & DSGridT.ItemProps;\n\nconst generateRowsCssStringForArray = (rowsVal: DSGridT.RowOrColsSyntaxSugar[]): string => {\n // mtg and mtgs are used to support mapping different ways of defining the rows\n // when mtg produces valid css, mtgs will produce invalid css and vice-versa\n // only one of them will be effectively applied by the browser\n const mtg = (mapTemplateGrid(rowsVal as DSGridT.RowOrColsSyntaxSugar) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rowsVal as DSGridT.RowOrColsSyntaxSugar) as string[])\n .map((c) => `minmax(0, ${c})`)\n .join(' ');\n return `\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n `;\n};\nconst generateRowsCssStringForBootstrapLikeishScenario = (rowsVal: string | number): string => `\n -ms-grid-rows: repeat(${rowsVal}, 1fr);\n grid-template-rows: repeat(${rowsVal}, 1fr);\n `;\nconst generateRowsWithMediaQueries = (\n rows: DSGridT.RowColBreakpoints,\n theme: Theme,\n isSpanParent: boolean,\n): ReturnType<typeof css>[] => {\n const finalMediaDeclaration: ReturnType<typeof css>[] = [];\n // we conditionally push into the array the media queries because grid rows definitions supports partial definitions\n // meaning that you can define rows only for small and medium and not for large\n // in such case we want to avoid generating media queries for large\n // we also need to make sure that the largest definition is used as the default one\n if (rows.large) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(rows.large)) {\n cssString = generateRowsCssStringForArray(rows.large);\n } else if (isSpanParent) {\n cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.large);\n }\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.large`${cssString}`);\n }\n if (rows.medium) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(rows.medium)) {\n cssString = generateRowsCssStringForArray(rows.medium);\n } else if (isSpanParent) {\n cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.medium);\n }\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.medium`${cssString}`);\n }\n if (rows.small) {\n // we apply different styles for defintions that are arrays and definitions that are not\n // specifically when the definition are NOT arrays we check if the parent is a span tag\n // if it is we try to copy bootstrap's behavior and use repeat css grid function\n let cssString = '';\n if (Array.isArray(rows.small)) {\n cssString = generateRowsCssStringForArray(rows.small);\n } else if (isSpanParent) {\n cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.small);\n }\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.small`${cssString}`);\n }\n return finalMediaDeclaration;\n};\n\nexport const manageRowsV2 = ({ rows, theme, isSpanParent }: InterpolatedFunctionProps): ReturnType<typeof css>[] => {\n // we want to be extremely explicit with how we handle the different use-cases\n // the component is quite old and has been tailored to fit the needs of the different use-cases\n // even ones that should have not been supported in the first place (isSpanParent to simulate bootstrap, different kind of rows definitions, etc)\n // support for\n // rows:{small: 1, medium: 2, large: 3}\n // AND\n // rows: {small: ['1fr'], medium: ['160px'], large: ['400px'] }\n if (rowsIsBreakpointDefinition(rows)) {\n // there is no way to guarantee dynamic co-relation between pui-theme and the grid component\n // any change in the theme will break the co-relation and we would need to update the component\n // for such reason we are optimizing for maintainability and not scalability\n return generateRowsWithMediaQueries(rows, theme, isSpanParent);\n }\n\n // support for rows: ['1fr', '1fr', '1fr'] && rows: [1, 1, 1]\n if (Array.isArray(rows)) {\n const cssString = generateRowsCssStringForArray(rows);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // support for parent is span and is like rows: 3\n if (isSpanParent) {\n const cssString = generateRowsCssStringForBootstrapLikeishScenario(rows);\n return [\n css`\n ${cssString}\n `,\n ];\n }\n // fallback is not doing anything\n return [css``];\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,KAAK,uBAAuB;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KAAK,KAAK;AAAA,IACtD,WAAW,cAAc;AACvB,kBAAY,iDAAiD,KAAK,KAAK;AAAA,IACzE;AACA,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB;AAAA,OACH;AACH,0BAAsB,KAAK,MAAM,MAAM,QAAQ,WAAW;AAAA,EAC5D;AACA,SAAO;AACT;AAEO,MAAM,eAAe,CAAC,EAAE,MAAM,OAAO,aAAa,MAA2D;AAQlH,MAAI,2BAA2B,IAAI,GAAG;AAIpC,WAAO,6BAA6B,MAAM,OAAO,YAAY;AAAA,EAC/D;AAGA,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,UAAM,YAAY,8BAA8B,IAAI;AACpD,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,MAAI,cAAc;AAChB,UAAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI;AAAA;AAAA,IAEN;AAAA,EACF;AAEA,SAAO,CAAC,KAAK;AACf;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/styles.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport type { DSGridT } from '../react-desc-prop-types.js';\n\nexport const manageSpan = css<DSGridT.ItemProps>`\n ${({ isSpanParent, span, theme }) => {\n if (!isSpanParent) return '';\n\n if (typeof span === 'number') {\n return `\n -ms-grid-column: auto / span ${span};\n grid-column: auto / span ${span};`;\n }\n\n if (typeof span !== 'object') return ``;\n\n // Span object\n\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n // Type castings\n const theKey = key as keyof typeof span & keyof typeof theme.breakpoints;\n const spanValue = span[theKey];\n\n if (!!spanValue && theme.breakpoints[theKey]) {\n if (theKey === 'small') {\n data += `\n -ms-grid-column: auto / span ${spanValue};\n grid-column: auto / span ${spanValue};\n `;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-column: auto / span ${spanValue};\n grid-column: auto / span ${spanValue};\n }`;\n }\n }\n });\n return data;\n }}\n`;\n\nexport const manageCols = css<DSGridT.ItemProps>`\n ${({ cols, theme, isSpanParent }) => {\n if (typeof cols === 'object' && !Array.isArray(cols)) {\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n const theKey = key as keyof typeof cols;\n const colValue = cols[theKey];\n if (!!colValue && Array.isArray(colValue)) {\n const mtg = (mapTemplateGrid(colValue) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(colValue) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n if (theKey === 'small') {\n data += `-ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};\n }`;\n }\n } else if (!!colValue && isSpanParent) {\n if (theKey === 'small') {\n data += `-ms-grid-columns: repeat(${colValue}, 1fr);\n grid-template-columns: repeat(${colValue}, 1fr);`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-columns: repeat(${colValue}, 1fr);\n grid-template-columns: repeat(${colValue}, 1fr);\n }`;\n }\n }\n });\n return data;\n }\n if (Array.isArray(cols)) {\n const mtg = (mapTemplateGrid(cols) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(cols) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};`;\n }\n if (isSpanParent) {\n return `\n -ms-grid-columns: repeat(${cols}, 1fr);\n grid-template-columns: repeat(${cols}, 1fr);`;\n }\n return '';\n }}\n`;\n\nexport const manageRows = css<DSGridT.ItemProps>`\n ${({ rows, theme, isSpanParent }) => {\n if (typeof rows === 'object' && !Array.isArray(rows)) {\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n const theKey = key as keyof typeof rows & keyof typeof theme.breakpoints;\n const rowValue = rows[theKey];\n if (rowValue && Array.isArray(rowValue)) {\n const mtg = (mapTemplateGrid(rowValue) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rowValue) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n if (key === 'small') {\n data += `-ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n }`;\n }\n } else if (!!rowValue && isSpanParent) {\n if (theKey === 'small') {\n data += `-ms-grid-rows: repeat(${rowValue}, 1fr);\n grid-template-rows: repeat(${rowValue}, 1fr);`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-rows: repeat(${rowValue}, 1fr);\n grid-template-rows: repeat(${rowValue}, 1fr);\n }`;\n }\n }\n });\n return data;\n }\n if (Array.isArray(rows)) {\n const mtg = (mapTemplateGrid(rows) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rows) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n `;\n }\n if (isSpanParent) {\n return `\n -ms-grid-rows: repeat(${rows}, 1fr);\n grid-template-rows: repeat(${rows}, 1fr);`;\n }\n return '';\n }}\n`;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,KAAK,uBAAuB;AAG9B,MAAM,aAAa;AAAA,IACtB,CAAC,EAAE,cAAc,MAAM,MAAM,MAAM;AACnC,MAAI,CAAC;AAAc,WAAO;AAE1B,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO;AAAA,uCAC0B;AAAA,mCACJ;AAAA,EAC/B;AAEA,MAAI,OAAO,SAAS;AAAU,WAAO;AAIrC,MAAI,OAAO;AACX,SAAO,KAAK,MAAM,KAAK,EAAE,QAAQ,CAAC,QAAQ;AAExC,UAAM,SAAS;AACf,UAAM,YAAY,KAAK,MAAM;AAE7B,QAAI,CAAC,CAAC,aAAa,MAAM,YAAY,MAAM,GAAG;AAC5C,UAAI,WAAW,SAAS;AACtB,gBAAQ;AAAA,2CACyB;AAAA,uCACJ;AAAA;AAAA,MAE/B,OAAO;AACL,gBAAQ,sBAAsB,MAAM,YAAY,MAAM;AAAA,mDACb;AAAA,+CACJ;AAAA;AAAA,MAEvC;AAAA,IACF;AAAA,EACF,CAAC;AACD,SAAO;AACT;AAAA;AAGK,MAAM,aAAa;AAAA,IACtB,CAAC,EAAE,MAAM,OAAO,aAAa,MAAM;AACnC,MAAI,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI,GAAG;AACpD,QAAI,OAAO;AACX,WAAO,KAAK,MAAM,KAAK,EAAE,QAAQ,CAAC,QAAQ;AACxC,YAAM,SAAS;AACf,YAAM,WAAW,KAAK,MAAM;AAC5B,UAAI,CAAC,CAAC,YAAY,MAAM,QAAQ,QAAQ,GAAG;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AAM,SAAS;AACf,YAAM,WAAW,KAAK,MAAM;AAC5B,UAAI,YAAY,MAAM,QAAQ,QAAQ,GAAG;AACvC,cAAM,MAAO,gBAAgB,QAAQ,EAAe,KAAK,GAAG;AAC5D,cAAM,OAAQ,gBAAgB,QAAQ,EAAe,IAAI,CAAC,MAAM,aAAa,IAAI,EAAE,KAAK,GAAG;AAC3F,YAAI,QAAQ,SAAS;AACnB,kBAAQ,kBAAkB,OAAO;AAAA,4CACD,OAAO;AAAA,uCACZ,QAAQ;AAAA,4CACH,QAAQ;AAAA,QAC1C,OAAO;AACL,kBAAQ,sBAAsB,MAAM,YAAY,MAAM;AAAA,uCAC3B,OAAO;AAAA,4CACF,OAAO;AAAA,uCACZ,QAAQ;AAAA,4CACH,QAAQ;AAAA;AAAA,QAE1C;AAAA,MACF,WAAW,CAAC,CAAC,YAAY,cAAc;AACrC,YAAI,WAAW,SAAS;AACtB,kBAAQ,yBAAyB;AAAA,kDACK;AAAA,QACxC,OAAO;AACL,kBAAQ,sBAAsB,MAAM,YAAY,MAAM;AAAA,8CACpB;AAAA,mDACK;AAAA;AAAA,QAEzC;AAAA,MACF;AAAA,IACF,CAAC;AACD,WAAO;AAAA,EACT;AACA,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,UAAM,MAAO,gBAAgB,IAAI,EAAe,KAAK,GAAG;AACxD,UAAM,OAAQ,gBAAgB,IAAI,EAAe,IAAI,CAAC,MAAM,aAAa,IAAI,EAAE,KAAK,GAAG;AACvF,WAAO;AAAA,yBACY,OAAO;AAAA,8BACF,OAAO;AAAA,yBACZ,QAAQ;AAAA,8BACH,QAAQ;AAAA;AAAA,EAElC;AACA,MAAI,cAAc;AAChB,WAAO;AAAA,gCACmB;AAAA,qCACK;AAAA,EACjC;AACA,SAAO;AACT;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/restrict-template-expressions */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport type { DSGridT } from '../react-desc-prop-types.js';\n\nexport const manageSpan = css<DSGridT.ItemProps>`\n ${({ isSpanParent, span, theme }) => {\n if (!isSpanParent) return '';\n\n if (typeof span === 'number') {\n return `\n -ms-grid-column: auto / span ${span};\n grid-column: auto / span ${span};`;\n }\n\n if (typeof span !== 'object') return ``;\n\n // Span object\n\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n // Type castings\n const theKey = key as keyof typeof span & keyof typeof theme.breakpoints;\n const spanValue = span[theKey];\n\n if (!!spanValue && theme.breakpoints[theKey]) {\n if (theKey === 'small') {\n data += `\n -ms-grid-column: auto / span ${spanValue};\n grid-column: auto / span ${spanValue};\n `;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-column: auto / span ${spanValue};\n grid-column: auto / span ${spanValue};\n }`;\n }\n }\n });\n return data;\n }}\n`;\n\nexport const manageCols = css<DSGridT.ItemProps>`\n ${({ cols, theme, isSpanParent }) => {\n if (typeof cols === 'object' && !Array.isArray(cols)) {\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n const theKey = key as keyof typeof cols;\n const colValue = cols[theKey];\n if (!!colValue && Array.isArray(colValue)) {\n const mtg = (mapTemplateGrid(colValue as DSGridT.RowOrColsSyntaxSugar) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(colValue as DSGridT.RowOrColsSyntaxSugar) as string[])\n .map((c) => `minmax(0, ${c})`)\n .join(' ');\n if (theKey === 'small') {\n data += `-ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};\n }`;\n }\n } else if (!!colValue && isSpanParent) {\n if (theKey === 'small') {\n data += `-ms-grid-columns: repeat(${colValue}, 1fr);\n grid-template-columns: repeat(${colValue}, 1fr);`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-columns: repeat(${colValue}, 1fr);\n grid-template-columns: repeat(${colValue}, 1fr);\n }`;\n }\n }\n });\n return data;\n }\n if (Array.isArray(cols)) {\n const mtg = (mapTemplateGrid(cols) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(cols) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};`;\n }\n if (isSpanParent) {\n return `\n -ms-grid-columns: repeat(${cols}, 1fr);\n grid-template-columns: repeat(${cols}, 1fr);`;\n }\n return '';\n }}\n`;\n\nexport const manageRows = css<DSGridT.ItemProps>`\n ${({ rows, theme, isSpanParent }) => {\n if (typeof rows === 'object' && !Array.isArray(rows)) {\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n const theKey = key as keyof typeof rows & keyof typeof theme.breakpoints;\n const rowValue = rows[theKey];\n if (rowValue && Array.isArray(rowValue)) {\n const mtg = (mapTemplateGrid(rowValue as DSGridT.RowOrColsSyntaxSugar) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rowValue as DSGridT.RowOrColsSyntaxSugar) as string[])\n .map((c) => `minmax(0, ${c})`)\n .join(' ');\n if (key === 'small') {\n data += `-ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n }`;\n }\n } else if (!!rowValue && isSpanParent) {\n if (theKey === 'small') {\n data += `-ms-grid-rows: repeat(${rowValue}, 1fr);\n grid-template-rows: repeat(${rowValue}, 1fr);`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-rows: repeat(${rowValue}, 1fr);\n grid-template-rows: repeat(${rowValue}, 1fr);\n }`;\n }\n }\n });\n return data;\n }\n if (Array.isArray(rows)) {\n const mtg = (mapTemplateGrid(rows) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rows) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n `;\n }\n if (isSpanParent) {\n return `\n -ms-grid-rows: repeat(${rows}, 1fr);\n grid-template-rows: repeat(${rows}, 1fr);`;\n }\n return '';\n }}\n`;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,KAAK,uBAAuB;AAG9B,MAAM,aAAa;AAAA,IACtB,CAAC,EAAE,cAAc,MAAM,MAAM,MAAM;AACnC,MAAI,CAAC;AAAc,WAAO;AAE1B,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO;AAAA,uCAC0B;AAAA,mCACJ;AAAA,EAC/B;AAEA,MAAI,OAAO,SAAS;AAAU,WAAO;AAIrC,MAAI,OAAO;AACX,SAAO,KAAK,MAAM,KAAK,EAAE,QAAQ,CAAC,QAAQ;AAExC,UAAM,SAAS;AACf,UAAM,YAAY,KAAK,MAAM;AAE7B,QAAI,CAAC,CAAC,aAAa,MAAM,YAAY,MAAM,GAAG;AAC5C,UAAI,WAAW,SAAS;AACt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AAO;AAAA,EACT;AACA,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,UAAM,MAAO,gBAAgB,IAAI,EAAe,KAAK,GAAG;AACxD,UAAM,OAAQ,gBAAgB,IAAI,EAAe,IAAI,CAAC,MAAM,aAAa,IAAI,EAAE,KAAK,GAAG;AACvF,WAAO;AAAA,yBACY,OAAO;AAAA,8BACF,OAAO;AAAA,yBACZ,QAAQ;AAAA,8BACH,QAAQ;AAAA;AAAA,EAElC;AACA,MAAI,cAAc;AAChB,WAAO;AAAA,gCACmB;AAAA,qCACK;AAAA,EACjC;AACA,SAAO;AACT;AAAA;",
6
6
  "names": []
7
7
  }
@@ -2,11 +2,13 @@ import type { WeakValidationMap } from 'react';
2
2
  import type React from 'react';
3
3
  import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';
4
4
  export declare namespace DSGridT {
5
+ type RowOrColsSyntaxSugar = string | number | (string | number)[];
5
6
  interface RowColBreakpoints {
6
- small?: string | number | (string | number)[];
7
- medium?: string | number | (string | number)[];
8
- large?: string | number | (string | number)[];
7
+ small?: RowOrColsSyntaxSugar[];
8
+ medium?: RowOrColsSyntaxSugar[];
9
+ large?: RowOrColsSyntaxSugar[];
9
10
  }
11
+ type RowOrColsValidValues = RowOrColsSyntaxSugar | RowColBreakpoints;
10
12
  interface SpanBreakpoints {
11
13
  small?: number;
12
14
  medium?: number;
@@ -19,8 +21,8 @@ export declare namespace DSGridT {
19
21
  interface RequiredProps {
20
22
  }
21
23
  interface DefaultProps {
22
- rows: string[] | string | number[] | RowColBreakpoints;
23
- cols: string[] | string | number[] | RowColBreakpoints;
24
+ rows: RowOrColsValidValues;
25
+ cols: RowOrColsValidValues;
24
26
  className: string;
25
27
  justify: JustifyPlacement;
26
28
  wrap: Wrap;
@@ -44,8 +46,8 @@ export declare namespace DSGridT {
44
46
  interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>, XstyledProps {
45
47
  }
46
48
  interface ItemProps {
47
- rows: string[] | string | number[] | RowColBreakpoints;
48
- cols: string[] | string | number[] | RowColBreakpoints;
49
+ rows: RowOrColsValidValues;
50
+ cols: RowOrColsValidValues;
49
51
  alignItems?: AlignItemsPlacement;
50
52
  alignContent?: AlignItemsPlacement;
51
53
  children: React.ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-grid",
3
- "version": "3.31.4",
3
+ "version": "3.32.0-rc.2",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Grid",
6
6
  "files": [
@@ -64,16 +64,16 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "@xstyled/system": "~3.7.3",
67
- "@elliemae/ds-props-helpers": "3.31.4",
68
- "@elliemae/ds-system": "3.31.4",
69
- "@elliemae/ds-utilities": "3.31.4"
67
+ "@elliemae/ds-props-helpers": "3.32.0-rc.2",
68
+ "@elliemae/ds-system": "3.32.0-rc.2",
69
+ "@elliemae/ds-utilities": "3.32.0-rc.2"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@elliemae/pui-cli": "~9.0.0-next.31",
73
73
  "@elliemae/pui-theme": "~2.7.0",
74
74
  "react-test-renderer": "~17.0.2",
75
75
  "styled-components": "~5.3.9",
76
- "@elliemae/ds-monorepo-devops": "3.31.4"
76
+ "@elliemae/ds-monorepo-devops": "3.32.0-rc.2"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "@elliemae/pui-theme": "^2.6.0",