@elliemae/ds-grid 3.51.0-rc.8 → 3.51.1

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.
package/dist/cjs/Grid.js CHANGED
@@ -55,6 +55,7 @@ const Grid = import_react.default.forwardRef((props, ref) => {
55
55
  width,
56
56
  height,
57
57
  innerRef,
58
+ span,
58
59
  ...rest
59
60
  },
60
61
  globalProps,
@@ -62,18 +63,37 @@ const Grid = import_react.default.forwardRef((props, ref) => {
62
63
  isSpanParent,
63
64
  renderChildren
64
65
  } = (0, import_useGrid.useGrid)(props);
66
+ const correctSpan = (0, import_react.useMemo)(() => {
67
+ if (span && typeof span !== "number" && span.small && !span.xsmall) {
68
+ return { ...span, xsmall: span.small };
69
+ }
70
+ return span;
71
+ }, [span]);
72
+ const correctCols = (0, import_react.useMemo)(() => {
73
+ if (typeof cols === "object" && !Array.isArray(cols) && cols.small && !cols.xsmall) {
74
+ return { ...cols, xsmall: cols.small };
75
+ }
76
+ return cols;
77
+ }, [cols]);
78
+ const correctRows = (0, import_react.useMemo)(() => {
79
+ if (typeof rows === "object" && !Array.isArray(rows) && rows.small && !rows.xsmall) {
80
+ return { ...rows, xsmall: rows.small };
81
+ }
82
+ return rows;
83
+ }, [rows]);
65
84
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
66
85
  import_GridItem.GridItem,
67
86
  {
68
87
  ...rest,
69
88
  ...globalProps,
70
89
  ...xstyledProps,
90
+ span: correctSpan,
71
91
  alignItems,
72
- cols,
92
+ cols: correctCols,
73
93
  gutter,
74
94
  isSpanParent,
75
95
  justify,
76
- rows,
96
+ rows: correctRows,
77
97
  wrap,
78
98
  childNumber: import_react.default.Children.count(children),
79
99
  innerRef: innerRef ?? ref,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Grid.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport type { DSGridT } from './react-desc-prop-types.js';\nimport { DSCardHeaderPropTypesSchema } from './react-desc-prop-types.js';\nimport { GridItem } from './GridItem.js';\nimport { useGrid } from './config/useGrid.js';\nimport { DSGridName } from './DSGridDefinitions.js';\n\nconst Grid = React.forwardRef<HTMLDivElement, DSGridT.Props>((props, ref) => {\n const {\n propsWithDefaults: {\n withMaxWidthBreakpoints,\n alignItems,\n cols,\n children,\n rows,\n gutter,\n justify,\n wrap,\n width,\n height,\n innerRef,\n ...rest\n },\n globalProps,\n xstyledProps,\n isSpanParent,\n renderChildren,\n } = useGrid(props);\n\n return (\n <GridItem\n {...rest}\n {...globalProps}\n {...xstyledProps}\n alignItems={alignItems}\n cols={cols}\n gutter={gutter}\n isSpanParent={isSpanParent}\n justify={justify}\n rows={rows}\n wrap={wrap}\n childNumber={React.Children.count(children)}\n innerRef={innerRef ?? ref}\n w={width}\n h={height}\n withMaxWidthBreakpoints={withMaxWidthBreakpoints}\n >\n {renderChildren}\n </GridItem>\n );\n});\n\n// Since this component is using ForwardRef, we must provide a displayName to avoid 'undefined' name in propsTable.\nGrid.displayName = DSGridName;\nconst DSGridWithSchema = describe(Grid);\nDSGridWithSchema.propTypes = DSCardHeaderPropTypesSchema;\n\nexport default Grid;\nexport { DSGridWithSchema, Grid };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+BnB;AA/BJ,mBAAkB;AAClB,8BAAyB;AAEzB,mCAA4C;AAC5C,sBAAyB;AACzB,qBAAwB;AACxB,+BAA2B;AAE3B,MAAM,OAAO,aAAAA,QAAM,WAA0C,CAAC,OAAO,QAAQ;AAC3E,QAAM;AAAA,IACJ,mBAAmB;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,wBAAQ,KAAK;AAEjB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,aAAAA,QAAM,SAAS,MAAM,QAAQ;AAAA,MAC1C,UAAU,YAAY;AAAA,MACtB,GAAG;AAAA,MACH,GAAG;AAAA,MACH;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ,CAAC;AAGD,KAAK,cAAc;AACnB,MAAM,uBAAmB,kCAAS,IAAI;AACtC,iBAAiB,YAAY;AAE7B,IAAO,eAAQ;",
4
+ "sourcesContent": ["import React, { useMemo } from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport type { DSGridT } from './react-desc-prop-types.js';\nimport { DSCardHeaderPropTypesSchema } from './react-desc-prop-types.js';\nimport { GridItem } from './GridItem.js';\nimport { useGrid } from './config/useGrid.js';\nimport { DSGridName } from './DSGridDefinitions.js';\n\nconst Grid = React.forwardRef<HTMLDivElement, DSGridT.Props>((props, ref) => {\n const {\n propsWithDefaults: {\n withMaxWidthBreakpoints,\n alignItems,\n cols,\n children,\n rows,\n gutter,\n justify,\n wrap,\n width,\n height,\n innerRef,\n span,\n ...rest\n },\n globalProps,\n xstyledProps,\n isSpanParent,\n renderChildren,\n } = useGrid(props);\n\n // xsmall was added after the initial implementation, so we need to make sure it's always present\n // to avoid breaking changes.\n\n const correctSpan = useMemo(() => {\n if (span && typeof span !== 'number' && span.small && !span.xsmall) {\n return { ...span, xsmall: span.small };\n }\n return span;\n }, [span]);\n\n const correctCols = useMemo(() => {\n if (typeof cols === 'object' && !Array.isArray(cols) && cols.small && !cols.xsmall) {\n return { ...cols, xsmall: cols.small };\n }\n return cols;\n }, [cols]);\n\n const correctRows = useMemo(() => {\n if (typeof rows === 'object' && !Array.isArray(rows) && rows.small && !rows.xsmall) {\n return { ...rows, xsmall: rows.small };\n }\n return rows;\n }, [rows]);\n\n return (\n <GridItem\n {...rest}\n {...globalProps}\n {...xstyledProps}\n span={correctSpan}\n alignItems={alignItems}\n cols={correctCols}\n gutter={gutter}\n isSpanParent={isSpanParent}\n justify={justify}\n rows={correctRows}\n wrap={wrap}\n childNumber={React.Children.count(children)}\n innerRef={innerRef ?? ref}\n w={width}\n h={height}\n withMaxWidthBreakpoints={withMaxWidthBreakpoints}\n >\n {renderChildren}\n </GridItem>\n );\n});\n\n// Since this component is using ForwardRef, we must provide a displayName to avoid 'undefined' name in propsTable.\nGrid.displayName = DSGridName;\nconst DSGridWithSchema = describe(Grid);\nDSGridWithSchema.propTypes = DSCardHeaderPropTypesSchema;\n\nexport default Grid;\nexport { DSGridWithSchema, Grid };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADwDnB;AAxDJ,mBAA+B;AAC/B,8BAAyB;AAEzB,mCAA4C;AAC5C,sBAAyB;AACzB,qBAAwB;AACxB,+BAA2B;AAE3B,MAAM,OAAO,aAAAA,QAAM,WAA0C,CAAC,OAAO,QAAQ;AAC3E,QAAM;AAAA,IACJ,mBAAmB;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,wBAAQ,KAAK;AAKjB,QAAM,kBAAc,sBAAQ,MAAM;AAChC,QAAI,QAAQ,OAAO,SAAS,YAAY,KAAK,SAAS,CAAC,KAAK,QAAQ;AAClE,aAAO,EAAE,GAAG,MAAM,QAAQ,KAAK,MAAM;AAAA,IACvC;AACA,WAAO;AAAA,EACT,GAAG,CAAC,IAAI,CAAC;AAET,QAAM,kBAAc,sBAAQ,MAAM;AAChC,QAAI,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI,KAAK,KAAK,SAAS,CAAC,KAAK,QAAQ;AAClF,aAAO,EAAE,GAAG,MAAM,QAAQ,KAAK,MAAM;AAAA,IACvC;AACA,WAAO;AAAA,EACT,GAAG,CAAC,IAAI,CAAC;AAET,QAAM,kBAAc,sBAAQ,MAAM;AAChC,QAAI,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI,KAAK,KAAK,SAAS,CAAC,KAAK,QAAQ;AAClF,aAAO,EAAE,GAAG,MAAM,QAAQ,KAAK,MAAM;AAAA,IACvC;AACA,WAAO;AAAA,EACT,GAAG,CAAC,IAAI,CAAC;AAET,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,MAAM;AAAA,MACN;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA,aAAa,aAAAA,QAAM,SAAS,MAAM,QAAQ;AAAA,MAC1C,UAAU,YAAY;AAAA,MACtB,GAAG;AAAA,MACH,GAAG;AAAA,MACH;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ,CAAC;AAGD,KAAK,cAAc;AACnB,MAAM,uBAAmB,kCAAS,IAAI;AACtC,iBAAiB,YAAY;AAE7B,IAAO,eAAQ;",
6
6
  "names": ["React"]
7
7
  }
package/dist/cjs/index.js CHANGED
@@ -26,21 +26,21 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var src_exports = {};
30
- __export(src_exports, {
29
+ var index_exports = {};
30
+ __export(index_exports, {
31
31
  DSCardHeaderPropTypesSchema: () => import_react_desc_prop_types2.DSCardHeaderPropTypesSchema,
32
32
  DSGridPropTypes: () => import_react_desc_prop_types2.DSGridPropTypes,
33
33
  DSGridWithSchema: () => import_Grid.DSGridWithSchema,
34
34
  Grid: () => import_Grid.default,
35
35
  GridContainer: () => import_Grid.default,
36
36
  GridItem: () => import_Grid.default,
37
- default: () => src_default,
37
+ default: () => index_default,
38
38
  defaultProps: () => import_react_desc_prop_types2.defaultProps,
39
39
  getGridProps: () => import_react_desc_prop_types2.getGridProps
40
40
  });
41
- module.exports = __toCommonJS(src_exports);
41
+ module.exports = __toCommonJS(index_exports);
42
42
  var React = __toESM(require("react"));
43
43
  var import_Grid = __toESM(require("./Grid.js"));
44
44
  var import_react_desc_prop_types2 = require("./react-desc-prop-types.js");
45
- var src_default = import_Grid.default;
45
+ var index_default = import_Grid.default;
46
46
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type {} from '@xstyled/system';\nimport Grid, { DSGridWithSchema } from './Grid.js';\nexport { type DSGridT } from './react-desc-prop-types.js';\nexport { defaultProps, DSGridPropTypes, DSCardHeaderPropTypesSchema, getGridProps } from './react-desc-prop-types.js';\nexport default Grid;\nexport { Grid, Grid as GridContainer, Grid as GridItem, DSGridWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAAA;AAAA,EAAA,iCAAAA;AAAA,EAAA,4BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,kBAAuC;AAEvC,IAAAC,gCAAyF;AACzF,IAAO,cAAQ,YAAAC;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAAA;AAAA,EAAA,iCAAAA;AAAA,EAAA,4BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,kBAAuC;AAEvC,IAAAC,gCAAyF;AACzF,IAAO,gBAAQ,YAAAC;",
6
6
  "names": ["Grid", "import_react_desc_prop_types", "Grid"]
7
7
  }
@@ -47,11 +47,13 @@ const defaultProps = {
47
47
  justifyItems: "normal"
48
48
  };
49
49
  const rowColBreakpoints = import_ds_props_helpers.PropTypes.shape({
50
+ xsmall: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.number, import_ds_props_helpers.PropTypes.string])),
50
51
  small: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.number, import_ds_props_helpers.PropTypes.string])),
51
52
  medium: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.number, import_ds_props_helpers.PropTypes.string])),
52
53
  large: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.number, import_ds_props_helpers.PropTypes.string]))
53
54
  });
54
55
  const spanBreakpoints = import_ds_props_helpers.PropTypes.shape({
56
+ xsmall: import_ds_props_helpers.PropTypes.number,
55
57
  small: import_ds_props_helpers.PropTypes.number,
56
58
  medium: import_ds_props_helpers.PropTypes.number,
57
59
  large: import_ds_props_helpers.PropTypes.number
@@ -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 { GlobalAttributesT, XstyledProps, DSPropTypesSchema } 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' | 'space-between';\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 // Grid components override some of the global attributes,\n // components inheriting from Grid needs a way to exclude these attributes from GlobalAttributesT\n // in such scenario, they would do\n // Omit<\n // GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps\n // ^ their's namespace own DefaultProps | OptionalProps | ...\n // | keyof GridSpecificGlobalAttributes\n // ^ Grid's overrides\n // >\n // This way, the component will have all the global attributes except the ones that are overridden by Grid and by the component itself\n // in one line: Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps [ | ... ] | keyof GridSpecificGlobalAttributes>\n export type GridSpecificGlobalAttributes = Omit<\n GlobalAttributesT<HTMLDivElement>,\n keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >;\n export type GridSpecificGlobalAttributesGeneric<ElementType = HTMLDivElement> = Omit<\n GlobalAttributesT<ElementType>,\n keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >;\n\n export interface Props extends Partial<DefaultProps>, OptionalProps, GridSpecificGlobalAttributes, XstyledProps {}\n\n export interface InternalProps extends DefaultProps, OptionalProps, GridSpecificGlobalAttributes, 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: DSPropTypesSchema<DSGridT.Props> = {\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 justify: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\n justifyItems: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\n alignContent: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\n rowGap: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\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};\n\nexport const DSCardHeaderPropTypesSchema = DSGridPropTypes as unknown as WeakValidationMap<DSGridT.Props>;\n\nexport const getGridProps = (props: unknown): Partial<DSGridT.Props> => {\n if (typeof props !== 'object' || props === null) return {};\n const innerProps = props as Record<string, unknown>;\n const innerGridPropTypes = props as Record<keyof DSGridT.Props, unknown>;\n const filteredProps: Partial<DSGridT.Props> = {};\n\n Object.keys(innerProps).forEach((key) => {\n const innerKey = key as keyof DSGridT.Props;\n if (innerGridPropTypes[innerKey] && innerProps[innerKey] !== undefined) {\n filteredProps[innerKey] = innerProps[innerKey];\n }\n });\n return filteredProps;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AACvE,uBAAuE;AAgGhE,MAAM,eAAqC;AAAA,EAChD,MAAM,CAAC;AAAA,EACP,MAAM,CAAC;AAAA,EACP,WA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W,QAAQ,MAAM,QAAW;AACtE,oBAAc,QAAQ,IAAI,WAAW,QAAQ;AAAA,IAC/C;AAAA,EACF,CAAC;AACD,SAAO;AACT;",
4
+ "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } 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 xsmall?: RowOrColsSyntaxSugar[];\n small?: RowOrColsSyntaxSugar[];\n medium?: RowOrColsSyntaxSugar[];\n large?: RowOrColsSyntaxSugar[];\n }\n\n export type RowOrColsValidValues = RowOrColsSyntaxSugar | RowColBreakpoints;\n\n export interface SpanBreakpoints {\n xsmall?: number;\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' | 'space-between';\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 // Grid components override some of the global attributes,\n // components inheriting from Grid needs a way to exclude these attributes from GlobalAttributesT\n // in such scenario, they would do\n // Omit<\n // GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps\n // ^ their's namespace own DefaultProps | OptionalProps | ...\n // | keyof GridSpecificGlobalAttributes\n // ^ Grid's overrides\n // >\n // This way, the component will have all the global attributes except the ones that are overridden by Grid and by the component itself\n // in one line: Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps [ | ... ] | keyof GridSpecificGlobalAttributes>\n export type GridSpecificGlobalAttributes = Omit<\n GlobalAttributesT<HTMLDivElement>,\n keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >;\n export type GridSpecificGlobalAttributesGeneric<ElementType = HTMLDivElement> = Omit<\n GlobalAttributesT<ElementType>,\n keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >;\n\n export interface Props extends Partial<DefaultProps>, OptionalProps, GridSpecificGlobalAttributes, XstyledProps {}\n\n export interface InternalProps extends DefaultProps, OptionalProps, GridSpecificGlobalAttributes, 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 xsmall: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\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 xsmall: PropTypes.number,\n small: PropTypes.number,\n medium: PropTypes.number,\n large: PropTypes.number,\n});\n\nexport const DSGridPropTypes: DSPropTypesSchema<DSGridT.Props> = {\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 justify: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\n justifyItems: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\n alignContent: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\n rowGap: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\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};\n\nexport const DSCardHeaderPropTypesSchema = DSGridPropTypes as unknown as WeakValidationMap<DSGridT.Props>;\n\nexport const getGridProps = (props: unknown): Partial<DSGridT.Props> => {\n if (typeof props !== 'object' || props === null) return {};\n const innerProps = props as Record<string, unknown>;\n const innerGridPropTypes = props as Record<keyof DSGridT.Props, unknown>;\n const filteredProps: Partial<DSGridT.Props> = {};\n\n Object.keys(innerProps).forEach((key) => {\n const innerKey = key as keyof DSGridT.Props;\n if (innerGridPropTypes[innerKey] && innerProps[innerKey] !== undefined) {\n filteredProps[innerKey] = innerProps[innerKey];\n }\n });\n return filteredProps;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AACvE,uBAAuE;AAkGhE,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,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;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,QAAQ,kCAAU;AAAA,EAClB,OAAO,kCAAU;AAAA,EACjB,QAAQ,kCAAU;AAAA,EAClB,OAAO,kCAAU;AACnB,CAAC;AAEM,MAAM,kBAAoD;AAAA,EAC/D,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,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,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;AAEO,MAAM,8BAA8B;AAEpC,MAAM,eAAe,CAAC,UAA2C;AACtE,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO,CAAC;AACzD,QAAM,aAAa;AACnB,QAAM,qBAAqB;AAC3B,QAAM,gBAAwC,CAAC;AAE/C,SAAO,KAAK,UAAU,EAAE,QAAQ,CAAC,QAAQ;AACvC,UAAM,WAAW;AACjB,QAAI,mBAAmB,QAAQ,KAAK,WAAW,QAAQ,MAAM,QAAW;AACtE,oBAAc,QAAQ,IAAI,WAAW,QAAQ;AAAA,IAC/C;AAAA,EACF,CAAC;AACD,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -89,6 +89,19 @@ const generateColsWithMediaQueries = (cols, theme, isSpanParent) => {
89
89
  ${cssString}
90
90
  `);
91
91
  }
92
+ if (cols.xsmall) {
93
+ let cssString = "";
94
+ if (Array.isArray(cols.xsmall)) {
95
+ cssString = generateColsCssStringForArray(cols.xsmall);
96
+ } else if (isSpanParent) {
97
+ cssString = generateColsCssStringForBootstrapLikeishScenario(cols.xsmall);
98
+ }
99
+ finalMediaDeclaration.push(theme.media.xsmall`${cssString}`);
100
+ if (finalMediaDeclaration.length === 0)
101
+ finalMediaDeclaration.push(import_ds_system.css`
102
+ ${cssString}
103
+ `);
104
+ }
92
105
  return finalMediaDeclaration;
93
106
  };
94
107
  const manageColsV2 = ({ cols, theme, isSpanParent }) => {
@@ -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 { Theme } from '@elliemae/pui-theme';\nimport type { DSGridT } from '../react-desc-prop-types.js';\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,SAClC,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI;AAKjD,MAAM,gCAAgC,CAAC,YAAoD;AAIzF,QAAM,UAAO,kCAAgB,OAAuC,EAAe,KAAK,GAAG;AAC3F,QAAM,WAAQ,kCAAgB,OAAuC,EAClE,IAAI,CAAC,MAAM,aAAa,CAAC,GAAG,EAC5B,KAAK,GAAG;AACX,SAAO;AAAA,0BACiB,OAAO,kBAAkB;AAAA,+BACpB,OAAO,MAAM;AAAA,0BAClB,QAAQ,kBAAkB;AAAA,+BACrB,QAAQ,MAAM;AAAA;AAE7C;AACA,MAAM,mDAAmD,CAAC,YAAqC;AAAA,iCAC9D,OAAO;AAAA,sCACF,OAAO;AAAA;AAE7C,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,SAAS,EAAE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eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport type { Theme } from '@elliemae/pui-theme';\nimport type { DSGridT } from '../react-desc-prop-types.js';\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 if (cols.xsmall) {\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.xsmall)) {\n cssString = generateColsCssStringForArray(cols.xsmall);\n } else if (isSpanParent) {\n cssString = generateColsCssStringForBootstrapLikeishScenario(cols.xsmall);\n }\n finalMediaDeclaration.push(theme.media.xsmall`${cssString}`);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\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,SAClC,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI;AAKjD,MAAM,gCAAgC,CAAC,YAAoD;AAIzF,QAAM,UAAO,kCAAgB,OAAuC,EAAe,KAAK,GAAG;AAC3F,QAAM,WAAQ,kCAAgB,OAAuC,EAClE,IAAI,CAAC,MAAM,aAAa,CAAC,GAAG,EAC5B,KAAK,GAAG;AACX,SAAO;AAAA,0BACiB,OAAO,kBAAkB;AAAA,+BACpB,OAAO,MAAM;AAAA,0BAClB,QAAQ,kBAAkB;AAAA,+BACrB,QAAQ,MAAM;AAAA;AAE7C;AACA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,8BAA8B,KAAK,MAAM;AAAA,IACvD,WAAW,cAAc;AACvB,kBAAY,iDAAiD,KAAK,MAAM;AAAA,IAC1E;AACA,0BAAsB,KAAK,MAAM,MAAM,SAAS,SAAS,EAAE;AAC3D,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AAAA,EACL;AAEA,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,SAAS;AAAA;AAAA,IAEf;AAAA,EACF;AAEA,MAAI,cAAc;AAChB,UAAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI,SAAS;AAAA;AAAA,IAEf;AAAA,EACF;AAEA,SAAO,CAAC,sBAAK;AACf;",
6
6
  "names": []
7
7
  }
@@ -89,6 +89,19 @@ const generateRowsWithMediaQueries = (rows, theme, isSpanParent) => {
89
89
  `);
90
90
  finalMediaDeclaration.push(theme.media.small`${cssString}`);
91
91
  }
92
+ if (rows.xsmall) {
93
+ let cssString = "";
94
+ if (Array.isArray(rows.xsmall)) {
95
+ cssString = generateRowsCssStringForArray(rows.xsmall);
96
+ } else if (isSpanParent) {
97
+ cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.xsmall);
98
+ }
99
+ if (finalMediaDeclaration.length === 0)
100
+ finalMediaDeclaration.push(import_ds_system.css`
101
+ ${cssString}
102
+ `);
103
+ finalMediaDeclaration.push(theme.media.xsmall`${cssString}`);
104
+ }
92
105
  return finalMediaDeclaration;
93
106
  };
94
107
  const manageRowsV2 = ({ rows, theme, isSpanParent }) => {
@@ -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 { Theme } from '@elliemae/pui-theme';\nimport type { DSGridT } from '../react-desc-prop-types.js';\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;AAKrC,MAAM,6BAA6B,CAAC,SAClC,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI;AAKjD,MAAM,gCAAgC,CAAC,YAAoD;AAIzF,QAAM,UAAO,kCAAgB,OAAuC,EAAe,KAAK,GAAG;AAC3F,QAAM,WAAQ,kCAAgB,OAAuC,EAClE,IAAI,CAAC,MAAM,aAAa,CAAC,GAAG,EAC5B,KAAK,GAAG;AACX,SAAO;AAAA,uBACc,OAAO,kBAAkB;AAAA,4BACpB,OAAO,MAAM;AAAA,uBAClB,QAAQ,kBAAkB;AAAA,4BACrB,QAAQ,MAAM;AAAA;AAE1C;AACA,MAAM,mDAAmD,CAAC,YAAqC;AAAA,8BACjE,OAAO;AAAA,mCACF,OAAO;AAAA;AAE1C,MAAM,+BAA+B,CACnC,MACA,OACA,iBAC6B;AAC7B,QAAM,wBAAkD,CAAC;AAKzD,MAAI,KAAK,OAAO;AAId,QAAI,YAAY;AAChB,QAAI,MAAM,QAAQ,KAAK,KA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AAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI,SAAS;AAAA;AAAA,IAEf;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 { Theme } from '@elliemae/pui-theme';\nimport type { DSGridT } from '../react-desc-prop-types.js';\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 if (rows.xsmall) {\n let cssString = '';\n if (Array.isArray(rows.xsmall)) {\n cssString = generateRowsCssStringForArray(rows.xsmall);\n } else if (isSpanParent) {\n cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.xsmall);\n }\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.xsmall`${cssString}`);\n }\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;AAKrC,MAAM,6BAA6B,CAAC,SAClC,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI;AAKjD,MAAM,gCAAgC,CAAC,YAAoD;AAIzF,QAAM,UAAO,kCAAgB,OAAuC,EAAe,KAAK,GAAG;AAC3F,QAAM,WAAQ,kCAAgB,OAAuC,EAClE,IAAI,CAAC,MAAM,aAAa,CAAC,GAAG,EAC5B,KAAK,GAAG;AACX,SAAO;AAAA,uBACc,OAAO,kBAAkB;AAAA,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I,KAAK,QAAQ;AACf,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,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK,MAAM,MAAM,SAAS,SAAS,EAAE;AAAA,EAC7D;AAEA,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,SAAS;AAAA;AAAA,IAEf;AAAA,EACF;AAEA,MAAI,cAAc;AAChB,UAAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI,SAAS;AAAA;AAAA,IAEf;AAAA,EACF;AAEA,SAAO,CAAC,sBAAK;AACf;",
6
6
  "names": []
7
7
  }
@@ -77,6 +77,14 @@ const manageSpanParent = ({
77
77
  `);
78
78
  finalMediaDeclaration.push(theme.media.small`${cssString}`);
79
79
  }
80
+ if (span.xsmall) {
81
+ const cssString = generateCssStringForSpan(span.xsmall);
82
+ if (finalMediaDeclaration.length === 0)
83
+ finalMediaDeclaration.push(import_ds_system.css`
84
+ ${cssString}
85
+ `);
86
+ finalMediaDeclaration.push(theme.media.xsmall`${cssString}`);
87
+ }
80
88
  return finalMediaDeclaration;
81
89
  };
82
90
  //# sourceMappingURL=manageSpanParent.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/utils/manageSpanParent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { css } from '@elliemae/ds-system';\nimport type { Theme } from '@elliemae/pui-theme';\nimport type { DSGridT } from '../react-desc-prop-types.js';\n\ntype InterpolatedFunctionProps = {\n theme: Theme;\n} & DSGridT.ItemProps;\n\nconst generateCssStringForSpan = (span: number): string => `\n -ms-grid-column: auto / span ${span};\n grid-column: auto / span ${span};\n`;\n// This is used to support bootrap like-ish way of using the grid component\nexport const manageSpanParent = ({\n isSpanParent,\n span,\n theme,\n}: InterpolatedFunctionProps): ReturnType<typeof css>[] => {\n // If it's not a span parent, we don't need to do anything\n if (!isSpanParent) return [css``];\n\n // if span is a number we don't add media queries\n if (typeof span === 'number') {\n return [\n css`\n -ms-grid-column: auto / span ${span};\n grid-column: auto / span ${span};\n `,\n ];\n }\n // the only remaining valid definition for our supported types is an object, if it's not an object we fallback to doing nothing\n if (typeof span !== 'object') return [css``];\n\n // Span object\n\n const finalMediaDeclaration: ReturnType<typeof css>[] = [];\n // we conditionally push into the array the media queries because span definitions supports partial definitions\n // meaning that you can define spans 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 (span.large) {\n const cssString = generateCssStringForSpan(span.large);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.large`${cssString}`);\n }\n if (span.medium) {\n const cssString = generateCssStringForSpan(span.medium);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.medium`${cssString}`);\n }\n if (span.small) {\n const cssString = generateCssStringForSpan(span.small);\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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,uBAAoB;AAQpB,MAAM,2BAA2B,CAAC,SAAyB;AAAA,iCAC1B,IAAI;AAAA,6BACR,IAAI;AAAA;AAG1B,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACF,MAA2D;AAEzD,MAAI,CAAC,aAAc,QAAO,CAAC,sBAAK;AAGhC,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO;AAAA,MACL;AAAA,uCACiC,IAAI;AAAA,mCACR,IAAI;AAAA;AAAA,IAEnC;AAAA,EACF;AAEA,MAAI,OAAO,SAAS,SAAU,QAAO,CAAC,sBAAK;AAI3C,QAAM,wBAAkD,CAAC;AAKzD,MAAI,KAAK,OAAO;AACd,UAAM,YAAY,yBAAyB,KAAK,KAAK;AACrD,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK,MAAM,MAAM,QAAQ,SAAS,EAAE;AAAA,EAC5D;AACA,MAAI,KAAK,QAAQ;AACf,UAAM,YAAY,yBAAyB,KAAK,MAAM;AACtD,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK,MAAM,MAAM,SAAS,SAAS,EAAE;AAAA,EAC7D;AACA,MAAI,KAAK,OAAO;AACd,UAAM,YAAY,yBAAyB,KAAK,KAAK;AACrD,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK,MAAM,MAAM,QAAQ,SAAS,EAAE;AAAA,EAC5D;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { css } from '@elliemae/ds-system';\nimport type { Theme } from '@elliemae/pui-theme';\nimport type { DSGridT } from '../react-desc-prop-types.js';\n\ntype InterpolatedFunctionProps = {\n theme: Theme;\n} & DSGridT.ItemProps;\n\nconst generateCssStringForSpan = (span: number): string => `\n -ms-grid-column: auto / span ${span};\n grid-column: auto / span ${span};\n`;\n// This is used to support bootrap like-ish way of using the grid component\nexport const manageSpanParent = ({\n isSpanParent,\n span,\n theme,\n}: InterpolatedFunctionProps): ReturnType<typeof css>[] => {\n // If it's not a span parent, we don't need to do anything\n if (!isSpanParent) return [css``];\n\n // if span is a number we don't add media queries\n if (typeof span === 'number') {\n return [\n css`\n -ms-grid-column: auto / span ${span};\n grid-column: auto / span ${span};\n `,\n ];\n }\n // the only remaining valid definition for our supported types is an object, if it's not an object we fallback to doing nothing\n if (typeof span !== 'object') return [css``];\n\n // Span object\n\n const finalMediaDeclaration: ReturnType<typeof css>[] = [];\n // we conditionally push into the array the media queries because span definitions supports partial definitions\n // meaning that you can define spans 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 (span.large) {\n const cssString = generateCssStringForSpan(span.large);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.large`${cssString}`);\n }\n if (span.medium) {\n const cssString = generateCssStringForSpan(span.medium);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.medium`${cssString}`);\n }\n if (span.small) {\n const cssString = generateCssStringForSpan(span.small);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.small`${cssString}`);\n }\n if (span.xsmall) {\n const cssString = generateCssStringForSpan(span.xsmall);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.xsmall`${cssString}`);\n }\n\n return finalMediaDeclaration;\n};\n", "import * as React from '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;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK,MAAM,MAAM,SAAS,SAAS,EAAE;AAAA,EAC7D;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -49,7 +49,7 @@ const manageSpan = import_ds_system.css`
49
49
  const theKey = key;
50
50
  const spanValue = span[theKey];
51
51
  if (!!spanValue && theme.breakpoints[theKey]) {
52
- if (theKey === "small") {
52
+ if (theKey === "xsmall") {
53
53
  data += `
54
54
  -ms-grid-column: auto / span ${spanValue};
55
55
  grid-column: auto / span ${spanValue};
@@ -75,7 +75,7 @@ const manageCols = import_ds_system.css`
75
75
  if (!!colValue && Array.isArray(colValue)) {
76
76
  const mtg = (0, import_ds_system.mapTemplateGrid)(colValue).join(" ");
77
77
  const mtgs = (0, import_ds_system.mapTemplateGrid)(colValue).map((c) => `minmax(0, ${c})`).join(" ");
78
- if (theKey === "small") {
78
+ if (theKey === "xsmall") {
79
79
  data += `-ms-grid-columns: ${mtg || "minmax(0px, 1fr)"};
80
80
  grid-template-columns: ${mtg || "auto"};
81
81
  -ms-grid-columns: ${mtgs || "minmax(0px, 1fr)"};
@@ -89,7 +89,7 @@ const manageCols = import_ds_system.css`
89
89
  }`;
90
90
  }
91
91
  } else if (!!colValue && isSpanParent) {
92
- if (theKey === "small") {
92
+ if (theKey === "xsmall") {
93
93
  data += `-ms-grid-columns: repeat(${colValue}, 1fr);
94
94
  grid-template-columns: repeat(${colValue}, 1fr);`;
95
95
  } else {
@@ -129,7 +129,7 @@ const manageRows = import_ds_system.css`
129
129
  if (rowValue && Array.isArray(rowValue)) {
130
130
  const mtg = (0, import_ds_system.mapTemplateGrid)(rowValue).join(" ");
131
131
  const mtgs = (0, import_ds_system.mapTemplateGrid)(rowValue).map((c) => `minmax(0, ${c})`).join(" ");
132
- if (key === "small") {
132
+ if (key === "xsmall") {
133
133
  data += `-ms-grid-rows: ${mtg || "minmax(0px, 1fr)"};
134
134
  grid-template-rows: ${mtg || "auto"};
135
135
  -ms-grid-rows: ${mtgs || "minmax(0px, 1fr)"};
@@ -143,7 +143,7 @@ const manageRows = import_ds_system.css`
143
143
  }`;
144
144
  }
145
145
  } else if (!!rowValue && isSpanParent) {
146
- if (theKey === "small") {
146
+ if (theKey === "xsmall") {
147
147
  data += `-ms-grid-rows: repeat(${rowValue}, 1fr);
148
148
  grid-template-rows: repeat(${rowValue}, 1fr);`;
149
149
  } else {
@@ -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 @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", "import * as React from 'react';\nexport { React };\n"],
5
- "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AAA,qCACC,IAAI;AAAA,EACrC;AACA,SAAO;AACT,CAAC;AAAA;",
4
+ "sourcesContent": ["/* 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 === 'xsmall') {\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 === 'xsmall') {\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 === 'xsmall') {\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 === 'xsmall') {\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 === 'xsmall') {\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,QAAO;AAE1B,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO;AAAA,uCAC0B,IAAI;AAAA,mCACR,I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AkB,OAAO,kBAAkB;AAAA,4CACnB,OAAO,MAAM;AAAA,uCAClB,QAAQ,kBAAkB;AAAA,4CACrB,QAAQ,MAAM;AAAA,QAChD,OAAO;AACL,kBAAQ,sBAAsB,MAAM,YAAY,MAAM,CAAC;AAAA,uCAC5B,OAAO,kBAAkB;AAAA,4CACpB,OAAO,MAAM;AAAA,uCAClB,QAAQ,kBAAkB;AAAA,4CACrB,QAAQ,MAAM;AAAA;AAAA,QAEhD;AAAA,MACF,WAAW,CAAC,CAAC,YAAY,cAAc;AACrC,YAAI,WAAW,UAAU;AACvB,kBAAQ,yBAAyB,QAAQ;AAAA,kDACH,QAAQ;AAAA,QAChD,OAAO;AACL,kBAAQ,sBAAsB,MAAM,YAAY,MAAM,CAAC;AAAA,8CACrB,QAAQ;AAAA,mDACH,QAAQ;AAAA;AAAA,QAEjD;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,CAAC,GAAG,EAAE,KAAK,GAAG;AACvF,WAAO;AAAA,yBACY,OAAO,kBAAkB;AAAA,8BACpB,OAAO,MAAM;AAAA,yBAClB,QAAQ,kBAAkB;AAAA,8BACrB,QAAQ,MAAM;AAAA;AAAA,EAExC;AACA,MAAI,cAAc;AAChB,WAAO;AAAA,gCACmB,IAAI;AAAA,qCACC,IAAI;AAAA,EACrC;AACA,SAAO;AACT,CAAC;AAAA;",
6
6
  "names": []
7
7
  }
package/dist/esm/Grid.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import React2 from "react";
3
+ import React2, { useMemo } from "react";
4
4
  import { describe } from "@elliemae/ds-props-helpers";
5
5
  import { DSCardHeaderPropTypesSchema } from "./react-desc-prop-types.js";
6
6
  import { GridItem } from "./GridItem.js";
@@ -20,6 +20,7 @@ const Grid = React2.forwardRef((props, ref) => {
20
20
  width,
21
21
  height,
22
22
  innerRef,
23
+ span,
23
24
  ...rest
24
25
  },
25
26
  globalProps,
@@ -27,18 +28,37 @@ const Grid = React2.forwardRef((props, ref) => {
27
28
  isSpanParent,
28
29
  renderChildren
29
30
  } = useGrid(props);
31
+ const correctSpan = useMemo(() => {
32
+ if (span && typeof span !== "number" && span.small && !span.xsmall) {
33
+ return { ...span, xsmall: span.small };
34
+ }
35
+ return span;
36
+ }, [span]);
37
+ const correctCols = useMemo(() => {
38
+ if (typeof cols === "object" && !Array.isArray(cols) && cols.small && !cols.xsmall) {
39
+ return { ...cols, xsmall: cols.small };
40
+ }
41
+ return cols;
42
+ }, [cols]);
43
+ const correctRows = useMemo(() => {
44
+ if (typeof rows === "object" && !Array.isArray(rows) && rows.small && !rows.xsmall) {
45
+ return { ...rows, xsmall: rows.small };
46
+ }
47
+ return rows;
48
+ }, [rows]);
30
49
  return /* @__PURE__ */ jsx(
31
50
  GridItem,
32
51
  {
33
52
  ...rest,
34
53
  ...globalProps,
35
54
  ...xstyledProps,
55
+ span: correctSpan,
36
56
  alignItems,
37
- cols,
57
+ cols: correctCols,
38
58
  gutter,
39
59
  isSpanParent,
40
60
  justify,
41
- rows,
61
+ rows: correctRows,
42
62
  wrap,
43
63
  childNumber: React2.Children.count(children),
44
64
  innerRef: innerRef ?? ref,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/Grid.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport type { DSGridT } from './react-desc-prop-types.js';\nimport { DSCardHeaderPropTypesSchema } from './react-desc-prop-types.js';\nimport { GridItem } from './GridItem.js';\nimport { useGrid } from './config/useGrid.js';\nimport { DSGridName } from './DSGridDefinitions.js';\n\nconst Grid = React.forwardRef<HTMLDivElement, DSGridT.Props>((props, ref) => {\n const {\n propsWithDefaults: {\n withMaxWidthBreakpoints,\n alignItems,\n cols,\n children,\n rows,\n gutter,\n justify,\n wrap,\n width,\n height,\n innerRef,\n ...rest\n },\n globalProps,\n xstyledProps,\n isSpanParent,\n renderChildren,\n } = useGrid(props);\n\n return (\n <GridItem\n {...rest}\n {...globalProps}\n {...xstyledProps}\n alignItems={alignItems}\n cols={cols}\n gutter={gutter}\n isSpanParent={isSpanParent}\n justify={justify}\n rows={rows}\n wrap={wrap}\n childNumber={React.Children.count(children)}\n innerRef={innerRef ?? ref}\n w={width}\n h={height}\n withMaxWidthBreakpoints={withMaxWidthBreakpoints}\n >\n {renderChildren}\n </GridItem>\n );\n});\n\n// Since this component is using ForwardRef, we must provide a displayName to avoid 'undefined' name in propsTable.\nGrid.displayName = DSGridName;\nconst DSGridWithSchema = describe(Grid);\nDSGridWithSchema.propTypes = DSCardHeaderPropTypesSchema;\n\nexport default Grid;\nexport { DSGridWithSchema, Grid };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC+BnB;AA/BJ,OAAOA,YAAW;AAClB,SAAS,gBAAgB;AAEzB,SAAS,mCAAmC;AAC5C,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAE3B,MAAM,OAAOA,OAAM,WAA0C,CAAC,OAAO,QAAQ;AAC3E,QAAM;AAAA,IACJ,mBAAmB;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,QAAQ,KAAK;AAEjB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAaA,OAAM,SAAS,MAAM,QAAQ;AAAA,MAC1C,UAAU,YAAY;AAAA,MACtB,GAAG;AAAA,MACH,GAAG;AAAA,MACH;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ,CAAC;AAGD,KAAK,cAAc;AACnB,MAAM,mBAAmB,SAAS,IAAI;AACtC,iBAAiB,YAAY;AAE7B,IAAO,eAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport type { DSGridT } from './react-desc-prop-types.js';\nimport { DSCardHeaderPropTypesSchema } from './react-desc-prop-types.js';\nimport { GridItem } from './GridItem.js';\nimport { useGrid } from './config/useGrid.js';\nimport { DSGridName } from './DSGridDefinitions.js';\n\nconst Grid = React.forwardRef<HTMLDivElement, DSGridT.Props>((props, ref) => {\n const {\n propsWithDefaults: {\n withMaxWidthBreakpoints,\n alignItems,\n cols,\n children,\n rows,\n gutter,\n justify,\n wrap,\n width,\n height,\n innerRef,\n span,\n ...rest\n },\n globalProps,\n xstyledProps,\n isSpanParent,\n renderChildren,\n } = useGrid(props);\n\n // xsmall was added after the initial implementation, so we need to make sure it's always present\n // to avoid breaking changes.\n\n const correctSpan = useMemo(() => {\n if (span && typeof span !== 'number' && span.small && !span.xsmall) {\n return { ...span, xsmall: span.small };\n }\n return span;\n }, [span]);\n\n const correctCols = useMemo(() => {\n if (typeof cols === 'object' && !Array.isArray(cols) && cols.small && !cols.xsmall) {\n return { ...cols, xsmall: cols.small };\n }\n return cols;\n }, [cols]);\n\n const correctRows = useMemo(() => {\n if (typeof rows === 'object' && !Array.isArray(rows) && rows.small && !rows.xsmall) {\n return { ...rows, xsmall: rows.small };\n }\n return rows;\n }, [rows]);\n\n return (\n <GridItem\n {...rest}\n {...globalProps}\n {...xstyledProps}\n span={correctSpan}\n alignItems={alignItems}\n cols={correctCols}\n gutter={gutter}\n isSpanParent={isSpanParent}\n justify={justify}\n rows={correctRows}\n wrap={wrap}\n childNumber={React.Children.count(children)}\n innerRef={innerRef ?? ref}\n w={width}\n h={height}\n withMaxWidthBreakpoints={withMaxWidthBreakpoints}\n >\n {renderChildren}\n </GridItem>\n );\n});\n\n// Since this component is using ForwardRef, we must provide a displayName to avoid 'undefined' name in propsTable.\nGrid.displayName = DSGridName;\nconst DSGridWithSchema = describe(Grid);\nDSGridWithSchema.propTypes = DSCardHeaderPropTypesSchema;\n\nexport default Grid;\nexport { DSGridWithSchema, Grid };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACwDnB;AAxDJ,OAAOA,UAAS,eAAe;AAC/B,SAAS,gBAAgB;AAEzB,SAAS,mCAAmC;AAC5C,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAE3B,MAAM,OAAOA,OAAM,WAA0C,CAAC,OAAO,QAAQ;AAC3E,QAAM;AAAA,IACJ,mBAAmB;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,QAAQ,KAAK;AAKjB,QAAM,cAAc,QAAQ,MAAM;AAChC,QAAI,QAAQ,OAAO,SAAS,YAAY,KAAK,SAAS,CAAC,KAAK,QAAQ;AAClE,aAAO,EAAE,GAAG,MAAM,QAAQ,KAAK,MAAM;AAAA,IACvC;AACA,WAAO;AAAA,EACT,GAAG,CAAC,IAAI,CAAC;AAET,QAAM,cAAc,QAAQ,MAAM;AAChC,QAAI,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI,KAAK,KAAK,SAAS,CAAC,KAAK,QAAQ;AAClF,aAAO,EAAE,GAAG,MAAM,QAAQ,KAAK,MAAM;AAAA,IACvC;AACA,WAAO;AAAA,EACT,GAAG,CAAC,IAAI,CAAC;AAET,QAAM,cAAc,QAAQ,MAAM;AAChC,QAAI,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI,KAAK,KAAK,SAAS,CAAC,KAAK,QAAQ;AAClF,aAAO,EAAE,GAAG,MAAM,QAAQ,KAAK,MAAM;AAAA,IACvC;AACA,WAAO;AAAA,EACT,GAAG,CAAC,IAAI,CAAC;AAET,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,MAAM;AAAA,MACN;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA,aAAaA,OAAM,SAAS,MAAM,QAAQ;AAAA,MAC1C,UAAU,YAAY;AAAA,MACtB,GAAG;AAAA,MACH,GAAG;AAAA,MACH;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ,CAAC;AAGD,KAAK,cAAc;AACnB,MAAM,mBAAmB,SAAS,IAAI;AACtC,iBAAiB,YAAY;AAE7B,IAAO,eAAQ;",
6
6
  "names": ["React"]
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import Grid, { DSGridWithSchema } from "./Grid.js";
3
3
  import { defaultProps, DSGridPropTypes, DSCardHeaderPropTypesSchema, getGridProps } from "./react-desc-prop-types.js";
4
- var src_default = Grid;
4
+ var index_default = Grid;
5
5
  export {
6
6
  DSCardHeaderPropTypesSchema,
7
7
  DSGridPropTypes,
@@ -9,7 +9,7 @@ export {
9
9
  Grid,
10
10
  Grid as GridContainer,
11
11
  Grid as GridItem,
12
- src_default as default,
12
+ index_default as default,
13
13
  defaultProps,
14
14
  getGridProps
15
15
  };
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type {} from '@xstyled/system';\nimport Grid, { DSGridWithSchema } from './Grid.js';\nexport { type DSGridT } from './react-desc-prop-types.js';\nexport { defaultProps, DSGridPropTypes, DSCardHeaderPropTypesSchema, getGridProps } from './react-desc-prop-types.js';\nexport default Grid;\nexport { Grid, Grid as GridContainer, Grid as GridItem, DSGridWithSchema };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACCvB,OAAO,QAAQ,wBAAwB;AAEvC,SAAS,cAAc,iBAAiB,6BAA6B,oBAAoB;AACzF,IAAO,cAAQ;",
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,OAAO,QAAQ,wBAAwB;AAEvC,SAAS,cAAc,iBAAiB,6BAA6B,oBAAoB;AACzF,IAAO,gBAAQ;",
6
6
  "names": []
7
7
  }
@@ -11,11 +11,13 @@ const defaultProps = {
11
11
  justifyItems: "normal"
12
12
  };
13
13
  const rowColBreakpoints = PropTypes.shape({
14
+ xsmall: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
14
15
  small: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
15
16
  medium: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
16
17
  large: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string]))
17
18
  });
18
19
  const spanBreakpoints = PropTypes.shape({
20
+ xsmall: PropTypes.number,
19
21
  small: PropTypes.number,
20
22
  medium: PropTypes.number,
21
23
  large: PropTypes.number
@@ -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 { GlobalAttributesT, XstyledProps, DSPropTypesSchema } 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' | 'space-between';\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 // Grid components override some of the global attributes,\n // components inheriting from Grid needs a way to exclude these attributes from GlobalAttributesT\n // in such scenario, they would do\n // Omit<\n // GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps\n // ^ their's namespace own DefaultProps | OptionalProps | ...\n // | keyof GridSpecificGlobalAttributes\n // ^ Grid's overrides\n // >\n // This way, the component will have all the global attributes except the ones that are overridden by Grid and by the component itself\n // in one line: Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps [ | ... ] | keyof GridSpecificGlobalAttributes>\n export type GridSpecificGlobalAttributes = Omit<\n GlobalAttributesT<HTMLDivElement>,\n keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >;\n export type GridSpecificGlobalAttributesGeneric<ElementType = HTMLDivElement> = Omit<\n GlobalAttributesT<ElementType>,\n keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >;\n\n export interface Props extends Partial<DefaultProps>, OptionalProps, GridSpecificGlobalAttributes, XstyledProps {}\n\n export interface InternalProps extends DefaultProps, OptionalProps, GridSpecificGlobalAttributes, 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: DSPropTypesSchema<DSGridT.Props> = {\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 justify: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\n justifyItems: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\n alignContent: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\n rowGap: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\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};\n\nexport const DSCardHeaderPropTypesSchema = DSGridPropTypes as unknown as WeakValidationMap<DSGridT.Props>;\n\nexport const getGridProps = (props: unknown): Partial<DSGridT.Props> => {\n if (typeof props !== 'object' || props === null) return {};\n const innerProps = props as Record<string, unknown>;\n const innerGridPropTypes = props as Record<keyof DSGridT.Props, unknown>;\n const filteredProps: Partial<DSGridT.Props> = {};\n\n Object.keys(innerProps).forEach((key) => {\n const innerKey = key as keyof DSGridT.Props;\n if (innerGridPropTypes[innerKey] && innerProps[innerKey] !== undefined) {\n filteredProps[innerKey] = innerProps[innerKey];\n }\n });\n return filteredProps;\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE,SAAS,qBAAqB,kBAAkB,MAAM,iBAAiB;AAgGhE,MAAM,eAAqC;AAAA,EAChD,MAAM,CAAC;AAAA,EACP,MAAM,CAAC;AAAA,EACP,WAAW;AAAA,EACX,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,cA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import type React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } 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 xsmall?: RowOrColsSyntaxSugar[];\n small?: RowOrColsSyntaxSugar[];\n medium?: RowOrColsSyntaxSugar[];\n large?: RowOrColsSyntaxSugar[];\n }\n\n export type RowOrColsValidValues = RowOrColsSyntaxSugar | RowColBreakpoints;\n\n export interface SpanBreakpoints {\n xsmall?: number;\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' | 'space-between';\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 // Grid components override some of the global attributes,\n // components inheriting from Grid needs a way to exclude these attributes from GlobalAttributesT\n // in such scenario, they would do\n // Omit<\n // GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps\n // ^ their's namespace own DefaultProps | OptionalProps | ...\n // | keyof GridSpecificGlobalAttributes\n // ^ Grid's overrides\n // >\n // This way, the component will have all the global attributes except the ones that are overridden by Grid and by the component itself\n // in one line: Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps [ | ... ] | keyof GridSpecificGlobalAttributes>\n export type GridSpecificGlobalAttributes = Omit<\n GlobalAttributesT<HTMLDivElement>,\n keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >;\n export type GridSpecificGlobalAttributesGeneric<ElementType = HTMLDivElement> = Omit<\n GlobalAttributesT<ElementType>,\n keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >;\n\n export interface Props extends Partial<DefaultProps>, OptionalProps, GridSpecificGlobalAttributes, XstyledProps {}\n\n export interface InternalProps extends DefaultProps, OptionalProps, GridSpecificGlobalAttributes, 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 xsmall: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\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 xsmall: PropTypes.number,\n small: PropTypes.number,\n medium: PropTypes.number,\n large: PropTypes.number,\n});\n\nexport const DSGridPropTypes: DSPropTypesSchema<DSGridT.Props> = {\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 justify: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\n justifyItems: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\n alignContent: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\n rowGap: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop'),\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};\n\nexport const DSCardHeaderPropTypesSchema = DSGridPropTypes as unknown as WeakValidationMap<DSGridT.Props>;\n\nexport const getGridProps = (props: unknown): Partial<DSGridT.Props> => {\n if (typeof props !== 'object' || props === null) return {};\n const innerProps = props as Record<string, unknown>;\n const innerGridPropTypes = props as Record<keyof DSGridT.Props, unknown>;\n const filteredProps: Partial<DSGridT.Props> = {};\n\n Object.keys(innerProps).forEach((key) => {\n const innerKey = key as keyof DSGridT.Props;\n if (innerGridPropTypes[innerKey] && innerProps[innerKey] !== undefined) {\n filteredProps[innerKey] = innerProps[innerKey];\n }\n });\n return filteredProps;\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2B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AM,qBAAqB;AAC3B,QAAM,gBAAwC,CAAC;AAE/C,SAAO,KAAK,UAAU,EAAE,QAAQ,CAAC,QAAQ;AACvC,UAAM,WAAW;AACjB,QAAI,mBAAmB,QAAQ,KAAK,WAAW,QAAQ,MAAM,QAAW;AACtE,oBAAc,QAAQ,IAAI,WAAW,QAAQ;AAAA,IAC/C;AAAA,EACF,CAAC;AACD,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -56,6 +56,19 @@ const generateColsWithMediaQueries = (cols, theme, isSpanParent) => {
56
56
  ${cssString}
57
57
  `);
58
58
  }
59
+ if (cols.xsmall) {
60
+ let cssString = "";
61
+ if (Array.isArray(cols.xsmall)) {
62
+ cssString = generateColsCssStringForArray(cols.xsmall);
63
+ } else if (isSpanParent) {
64
+ cssString = generateColsCssStringForBootstrapLikeishScenario(cols.xsmall);
65
+ }
66
+ finalMediaDeclaration.push(theme.media.xsmall`${cssString}`);
67
+ if (finalMediaDeclaration.length === 0)
68
+ finalMediaDeclaration.push(css`
69
+ ${cssString}
70
+ `);
71
+ }
59
72
  return finalMediaDeclaration;
60
73
  };
61
74
  const manageColsV2 = ({ cols, theme, isSpanParent }) => {
@@ -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 { Theme } from '@elliemae/pui-theme';\nimport type { DSGridT } from '../react-desc-prop-types.js';\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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AsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;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,SAAS,EAAE;AAC1D,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;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,SAAS;AAAA;AAAA,IAEf;AAAA,EACF;AAEA,MAAI,cAAc;AAChB,UAAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI,SAAS;AAAA;AAAA,IAEf;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 { Theme } from '@elliemae/pui-theme';\nimport type { DSGridT } from '../react-desc-prop-types.js';\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 if (cols.xsmall) {\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.xsmall)) {\n cssString = generateColsCssStringForArray(cols.xsmall);\n } else if (isSpanParent) {\n cssString = generateColsCssStringForBootstrapLikeishScenario(cols.xsmall);\n }\n finalMediaDeclaration.push(theme.media.xsmall`${cssString}`);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\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;AAKrC,MAAM,6BAA6B,CAAC,SAClC,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI;AAKjD,MAAM,gCAAgC,CAAC,YAAoD;AAIzF,QAAM,MAAO,gBAAgB,OAAuC,EAAe,KAAK,GAAG;AAC3F,QAAM,OAAQ,gBAAgB,OAAuC,EAClE,IAAI,CAAC,MAAM,aAAa,CAAC,GAAG,EAC5B,KAAK,GAAG;AACX,SAAO;AAAA,0BACiB,OAAO,kBAAkB;AAAA,+BACpB,OAAO,MAAM;AAAA,0BAClB,QAAQ,kBAAkB;AAAA,+BACrB,QAAQ,MAAM;AAAA;AAE7C;AACA,MAAM,mDAAmD,CAAC,YAAqC;AAAA,iCAC9D,OAAO;AAAA,sCACF,OAAO;AAAA;AAE7C,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,SAAS,EAAE;AAC1D,QAAI,sBAAsB,WAAW;A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AAI,GAAG;AACvB,UAAM,YAAY,8BAA8B,IAAI;AACpD,WAAO;AAAA,MACL;AAAA,UACI,SAAS;AAAA;AAAA,IAEf;AAAA,EACF;AAEA,MAAI,cAAc;AAChB,UAAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI,SAAS;AAAA;AAAA,IAEf;AAAA,EACF;AAEA,SAAO,CAAC,KAAK;AACf;",
6
6
  "names": []
7
7
  }
@@ -56,6 +56,19 @@ const generateRowsWithMediaQueries = (rows, theme, isSpanParent) => {
56
56
  `);
57
57
  finalMediaDeclaration.push(theme.media.small`${cssString}`);
58
58
  }
59
+ if (rows.xsmall) {
60
+ let cssString = "";
61
+ if (Array.isArray(rows.xsmall)) {
62
+ cssString = generateRowsCssStringForArray(rows.xsmall);
63
+ } else if (isSpanParent) {
64
+ cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.xsmall);
65
+ }
66
+ if (finalMediaDeclaration.length === 0)
67
+ finalMediaDeclaration.push(css`
68
+ ${cssString}
69
+ `);
70
+ finalMediaDeclaration.push(theme.media.xsmall`${cssString}`);
71
+ }
59
72
  return finalMediaDeclaration;
60
73
  };
61
74
  const manageRowsV2 = ({ rows, theme, isSpanParent }) => {
@@ -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 { Theme } from '@elliemae/pui-theme';\nimport type { DSGridT } from '../react-desc-prop-types.js';\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 = generateRowsCssStringFor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nC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK,MAAM,MAAM,SAAS,SAAS,EAAE;AAAA,EAC7D;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,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK,MAAM,MAAM,QAAQ,SAAS,EAAE;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,SAAS;AAAA;AAAA,IAEf;AAAA,EACF;AAEA,MAAI,cAAc;AAChB,UAAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI,SAAS;AAAA;AAAA,IAEf;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 { Theme } from '@elliemae/pui-theme';\nimport type { DSGridT } from '../react-desc-prop-types.js';\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 if (rows.xsmall) {\n let cssString = '';\n if (Array.isArray(rows.xsmall)) {\n cssString = generateRowsCssStringForArray(rows.xsmall);\n } else if (isSpanParent) {\n cssString = generateRowsCssStringForBootstrapLikeishScenario(rows.xsmall);\n }\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.xsmall`${cssString}`);\n }\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;AAKrC,MAAM,6BAA6B,CAAC,SAClC,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI;AAKjD,MAAM,gCAAgC,CAAC,YAAoD;AAIzF,QAAM,MAAO,gBAAgB,OAAuC,EAAe,KAAK,GAAG;AAC3F,QAAM,OAAQ,gBAAgB,OAAuC,EAClE,IAAI,CAAC,MAAM,aAAa,CAAC,GAAG,EAC5B,KAAK,GAAG;AACX,SAAO;AAAA,uBACc,OAAO,kBAAkB;AAAA,4BACpB,OAAO,MAAM;AAAA,uBAClB,QAAQ,kBAAkB;AAAA,4BACrB,QAAQ,MAAM;AAAA;AAE1C;AACA,MAAM,mDAAmD,CAAC,YAAqC;AAAA,8BACjE,OAAO;AAAA,mCACF,OAAO;AAAA;AAE1C,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,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK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,UAAM,YAAY,8BAA8B,IAAI;AACpD,WAAO;AAAA,MACL;AAAA,UACI,SAAS;AAAA;AAAA,IAEf;AAAA,EACF;AAEA,MAAI,cAAc;AAChB,UAAM,YAAY,iDAAiD,IAAI;AACvE,WAAO;AAAA,MACL;AAAA,UACI,SAAS;AAAA;AAAA,IAEf;AAAA,EACF;AAEA,SAAO,CAAC,KAAK;AACf;",
6
6
  "names": []
7
7
  }
@@ -44,6 +44,14 @@ const manageSpanParent = ({
44
44
  `);
45
45
  finalMediaDeclaration.push(theme.media.small`${cssString}`);
46
46
  }
47
+ if (span.xsmall) {
48
+ const cssString = generateCssStringForSpan(span.xsmall);
49
+ if (finalMediaDeclaration.length === 0)
50
+ finalMediaDeclaration.push(css`
51
+ ${cssString}
52
+ `);
53
+ finalMediaDeclaration.push(theme.media.xsmall`${cssString}`);
54
+ }
47
55
  return finalMediaDeclaration;
48
56
  };
49
57
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/manageSpanParent.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { css } from '@elliemae/ds-system';\nimport type { Theme } from '@elliemae/pui-theme';\nimport type { DSGridT } from '../react-desc-prop-types.js';\n\ntype InterpolatedFunctionProps = {\n theme: Theme;\n} & DSGridT.ItemProps;\n\nconst generateCssStringForSpan = (span: number): string => `\n -ms-grid-column: auto / span ${span};\n grid-column: auto / span ${span};\n`;\n// This is used to support bootrap like-ish way of using the grid component\nexport const manageSpanParent = ({\n isSpanParent,\n span,\n theme,\n}: InterpolatedFunctionProps): ReturnType<typeof css>[] => {\n // If it's not a span parent, we don't need to do anything\n if (!isSpanParent) return [css``];\n\n // if span is a number we don't add media queries\n if (typeof span === 'number') {\n return [\n css`\n -ms-grid-column: auto / span ${span};\n grid-column: auto / span ${span};\n `,\n ];\n }\n // the only remaining valid definition for our supported types is an object, if it's not an object we fallback to doing nothing\n if (typeof span !== 'object') return [css``];\n\n // Span object\n\n const finalMediaDeclaration: ReturnType<typeof css>[] = [];\n // we conditionally push into the array the media queries because span definitions supports partial definitions\n // meaning that you can define spans 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 (span.large) {\n const cssString = generateCssStringForSpan(span.large);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.large`${cssString}`);\n }\n if (span.medium) {\n const cssString = generateCssStringForSpan(span.medium);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.medium`${cssString}`);\n }\n if (span.small) {\n const cssString = generateCssStringForSpan(span.small);\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"],
5
- "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW;AAQpB,MAAM,2BAA2B,CAAC,SAAyB;AAAA,iCAC1B,IAAI;AAAA,6BACR,IAAI;AAAA;AAG1B,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACF,MAA2D;AAEzD,MAAI,CAAC,aAAc,QAAO,CAAC,KAAK;AAGhC,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO;AAAA,MACL;AAAA,uCACiC,IAAI;AAAA,mCACR,IAAI;AAAA;AAAA,IAEnC;AAAA,EACF;AAEA,MAAI,OAAO,SAAS,SAAU,QAAO,CAAC,KAAK;AAI3C,QAAM,wBAAkD,CAAC;AAKzD,MAAI,KAAK,OAAO;AACd,UAAM,YAAY,yBAAyB,KAAK,KAAK;AACrD,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK,MAAM,MAAM,QAAQ,SAAS,EAAE;AAAA,EAC5D;AACA,MAAI,KAAK,QAAQ;AACf,UAAM,YAAY,yBAAyB,KAAK,MAAM;AACtD,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK,MAAM,MAAM,SAAS,SAAS,EAAE;AAAA,EAC7D;AACA,MAAI,KAAK,OAAO;AACd,UAAM,YAAY,yBAAyB,KAAK,KAAK;AACrD,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK,MAAM,MAAM,QAAQ,SAAS,EAAE;AAAA,EAC5D;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { css } from '@elliemae/ds-system';\nimport type { Theme } from '@elliemae/pui-theme';\nimport type { DSGridT } from '../react-desc-prop-types.js';\n\ntype InterpolatedFunctionProps = {\n theme: Theme;\n} & DSGridT.ItemProps;\n\nconst generateCssStringForSpan = (span: number): string => `\n -ms-grid-column: auto / span ${span};\n grid-column: auto / span ${span};\n`;\n// This is used to support bootrap like-ish way of using the grid component\nexport const manageSpanParent = ({\n isSpanParent,\n span,\n theme,\n}: InterpolatedFunctionProps): ReturnType<typeof css>[] => {\n // If it's not a span parent, we don't need to do anything\n if (!isSpanParent) return [css``];\n\n // if span is a number we don't add media queries\n if (typeof span === 'number') {\n return [\n css`\n -ms-grid-column: auto / span ${span};\n grid-column: auto / span ${span};\n `,\n ];\n }\n // the only remaining valid definition for our supported types is an object, if it's not an object we fallback to doing nothing\n if (typeof span !== 'object') return [css``];\n\n // Span object\n\n const finalMediaDeclaration: ReturnType<typeof css>[] = [];\n // we conditionally push into the array the media queries because span definitions supports partial definitions\n // meaning that you can define spans 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 (span.large) {\n const cssString = generateCssStringForSpan(span.large);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.large`${cssString}`);\n }\n if (span.medium) {\n const cssString = generateCssStringForSpan(span.medium);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.medium`${cssString}`);\n }\n if (span.small) {\n const cssString = generateCssStringForSpan(span.small);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.small`${cssString}`);\n }\n if (span.xsmall) {\n const cssString = generateCssStringForSpan(span.xsmall);\n if (finalMediaDeclaration.length === 0)\n finalMediaDeclaration.push(css`\n ${cssString}\n `);\n finalMediaDeclaration.push(theme.media.xsmall`${cssString}`);\n }\n\n return finalMediaDeclaration;\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW;AAQpB,MAAM,2BAA2B,CAAC,SAAyB;AAAA,iCAC1B,IAAI;AAAA,6BACR,IAAI;AAAA;AAG1B,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACF,MAA2D;AAEzD,MAAI,CAAC,aAAc,QAAO,CAAC,KAAK;AAGhC,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO;AAAA,MACL;AAAA,uCACiC,IAAI;AAAA,mCACR,IAAI;AAAA;AAAA,IAEnC;AAAA,EACF;AAEA,MAAI,OAAO,SAAS,SAAU,QAAO,CAAC,KAAK;AAI3C,QAAM,wBAAkD,CAAC;AAKzD,MAAI,KAAK,OAAO;AACd,UAAM,YAAY,yBAAyB,KAAK,KAAK;AACrD,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK,MAAM,MAAM,QAAQ,SAAS,EAAE;AAAA,EAC5D;AACA,MAAI,KAAK,QAAQ;AACf,UAAM,YAAY,yBAAyB,KAAK,MAAM;AACtD,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK,MAAM,MAAM,SAAS,SAAS,EAAE;AAAA,EAC7D;AACA,MAAI,KAAK,OAAO;AACd,UAAM,YAAY,yBAAyB,KAAK,KAAK;AACrD,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK,MAAM,MAAM,QAAQ,SAAS,EAAE;AAAA,EAC5D;AACA,MAAI,KAAK,QAAQ;AACf,UAAM,YAAY,yBAAyB,KAAK,MAAM;AACtD,QAAI,sBAAsB,WAAW;AACnC,4BAAsB,KAAK;AAAA,UACvB,SAAS;AAAA,OACZ;AACH,0BAAsB,KAAK,MAAM,MAAM,SAAS,SAAS,EAAE;AAAA,EAC7D;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -14,7 +14,7 @@ const manageSpan = css`
14
14
  const theKey = key;
15
15
  const spanValue = span[theKey];
16
16
  if (!!spanValue && theme.breakpoints[theKey]) {
17
- if (theKey === "small") {
17
+ if (theKey === "xsmall") {
18
18
  data += `
19
19
  -ms-grid-column: auto / span ${spanValue};
20
20
  grid-column: auto / span ${spanValue};
@@ -40,7 +40,7 @@ const manageCols = css`
40
40
  if (!!colValue && Array.isArray(colValue)) {
41
41
  const mtg = mapTemplateGrid(colValue).join(" ");
42
42
  const mtgs = mapTemplateGrid(colValue).map((c) => `minmax(0, ${c})`).join(" ");
43
- if (theKey === "small") {
43
+ if (theKey === "xsmall") {
44
44
  data += `-ms-grid-columns: ${mtg || "minmax(0px, 1fr)"};
45
45
  grid-template-columns: ${mtg || "auto"};
46
46
  -ms-grid-columns: ${mtgs || "minmax(0px, 1fr)"};
@@ -54,7 +54,7 @@ const manageCols = css`
54
54
  }`;
55
55
  }
56
56
  } else if (!!colValue && isSpanParent) {
57
- if (theKey === "small") {
57
+ if (theKey === "xsmall") {
58
58
  data += `-ms-grid-columns: repeat(${colValue}, 1fr);
59
59
  grid-template-columns: repeat(${colValue}, 1fr);`;
60
60
  } else {
@@ -94,7 +94,7 @@ const manageRows = css`
94
94
  if (rowValue && Array.isArray(rowValue)) {
95
95
  const mtg = mapTemplateGrid(rowValue).join(" ");
96
96
  const mtgs = mapTemplateGrid(rowValue).map((c) => `minmax(0, ${c})`).join(" ");
97
- if (key === "small") {
97
+ if (key === "xsmall") {
98
98
  data += `-ms-grid-rows: ${mtg || "minmax(0px, 1fr)"};
99
99
  grid-template-rows: ${mtg || "auto"};
100
100
  -ms-grid-rows: ${mtgs || "minmax(0px, 1fr)"};
@@ -108,7 +108,7 @@ const manageRows = css`
108
108
  }`;
109
109
  }
110
110
  } else if (!!rowValue && isSpanParent) {
111
- if (theKey === "small") {
111
+ if (theKey === "xsmall") {
112
112
  data += `-ms-grid-rows: repeat(${rowValue}, 1fr);
113
113
  grid-template-rows: repeat(${rowValue}, 1fr);`;
114
114
  } else {
@@ -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 @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,QAAO;AAE1B,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO;AAAA,uCAC0B,IAAI;AAAA,mCACR,IAAI;AAAA,EACnC;AAEA,MAAI,OAAO,SAAS,SAAU,QAAO;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,SAAS;AAAA,uCACb,SAAS;AAAA;AAAA,MAExC,OAAO;AACL,gBAAQ,sBAAsB,MAAM,YAAY,MAAM,CAAC;AAAA,mDACd,SAAS;AAAA,+CACb,SAAS;AAAA;AAAA,MAEhD;AAAA,IACF;AAAA,EACF,CAAC;AACD,SAAO;AACT,CAAC;AAAA;AAGI,MAAM,aAAa;AAAA,IACtB,CAAC,EAAE,MAAM,OA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F;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,CAAC,GAAG,EAAE,KAAK,GAAG;AACvF,WAAO;AAAA,yBACY,OAAO,kBAAkB;AAAA,8BACpB,OAAO,MAAM;AAAA,yBAClB,QAAQ,kBAAkB;AAAA,8BACrB,QAAQ,MAAM;AAAA;AAAA,EAExC;AACA,MAAI,cAAc;AAChB,WAAO;AAAA,gCACmB,IAAI;AAAA,qCACC,IAAI;AAAA,EACrC;AACA,SAAO;AACT,CAAC;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 === 'xsmall') {\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 === 'xsmall') {\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 === 'xsmall') {\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 === 'xsmall') {\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 === 'xsmall') {\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'};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;AAAA,EAExC;AACA,MAAI,cAAc;AAChB,WAAO;AAAA,gCACmB,IAAI;AAAA,qCACC,IAAI;AAAA,EACrC;AACA,SAAO;AACT,CAAC;AAAA;",
6
6
  "names": []
7
7
  }
@@ -2,7 +2,7 @@
2
2
  import type { DSGridT } from '../react-desc-prop-types.js';
3
3
  export declare const useGrid: (props: DSGridT.Props) => {
4
4
  propsWithDefaults: DSGridT.InternalProps;
5
- globalProps: Partial<Pick<object, "wrap" | "form" | "list" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode"> & Omit<{
5
+ globalProps: Partial<Pick<object, "wrap" | "form" | "list" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode"> & Omit<{
6
6
  wrap?: string | undefined;
7
7
  form?: string | undefined;
8
8
  list?: string | undefined;
@@ -269,6 +269,8 @@ export declare const useGrid: (props: DSGridT.Props) => {
269
269
  unselectable?: "off" | "on" | undefined;
270
270
  inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
271
271
  is?: string | undefined;
272
+ exportparts?: string | undefined;
273
+ part?: string | undefined;
272
274
  accept?: string | undefined;
273
275
  acceptCharset?: string | undefined;
274
276
  action?: string | undefined;
@@ -4,12 +4,14 @@ import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliem
4
4
  export declare namespace DSGridT {
5
5
  type RowOrColsSyntaxSugar = string | number | (string | number)[];
6
6
  interface RowColBreakpoints {
7
+ xsmall?: RowOrColsSyntaxSugar[];
7
8
  small?: RowOrColsSyntaxSugar[];
8
9
  medium?: RowOrColsSyntaxSugar[];
9
10
  large?: RowOrColsSyntaxSugar[];
10
11
  }
11
12
  type RowOrColsValidValues = RowOrColsSyntaxSugar | RowColBreakpoints;
12
13
  interface SpanBreakpoints {
14
+ xsmall?: number;
13
15
  small?: number;
14
16
  medium?: number;
15
17
  large?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-grid",
3
- "version": "3.51.0-rc.8",
3
+ "version": "3.51.1",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Grid",
6
6
  "files": [
@@ -37,19 +37,19 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@xstyled/system": "~3.7.3",
40
- "@elliemae/ds-props-helpers": "3.51.0-rc.8",
41
- "@elliemae/ds-system": "3.51.0-rc.8"
40
+ "@elliemae/ds-props-helpers": "3.51.1",
41
+ "@elliemae/ds-system": "3.51.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@elliemae/pui-cli": "9.0.0-next.55",
45
- "@elliemae/pui-theme": "~2.10.0",
45
+ "@elliemae/pui-theme": "~2.11.0",
46
46
  "jest": "~29.7.0",
47
47
  "react-test-renderer": "^18.3.1",
48
48
  "styled-components": "~5.3.9",
49
- "@elliemae/ds-monorepo-devops": "3.51.0-rc.8"
49
+ "@elliemae/ds-monorepo-devops": "3.51.1"
50
50
  },
51
51
  "peerDependencies": {
52
- "@elliemae/pui-theme": "~2.10.0",
52
+ "@elliemae/pui-theme": "~2.11.0",
53
53
  "lodash": "^4.17.21",
54
54
  "react": "^18.3.1",
55
55
  "react-dom": "^18.3.1",