@entur/layout 3.4.0 → 3.4.1-next.0
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/beta/cjs/Flex/Flex.cjs +105 -101
- package/dist/beta/cjs/Flex/Flex.cjs.map +1 -1
- package/dist/beta/cjs/Grid/Grid.cjs +74 -70
- package/dist/beta/cjs/Grid/Grid.cjs.map +1 -1
- package/dist/beta/cjs/Grid/GridItem.cjs +35 -31
- package/dist/beta/cjs/Grid/GridItem.cjs.map +1 -1
- package/dist/beta/cjs/templates/Sidebar.cjs +85 -67
- package/dist/beta/cjs/templates/Sidebar.cjs.map +1 -1
- package/dist/beta/cjs/templates/portal/Portal.cjs +35 -36
- package/dist/beta/cjs/templates/portal/Portal.cjs.map +1 -1
- package/dist/beta/esm/Flex/Flex.mjs +105 -101
- package/dist/beta/esm/Flex/Flex.mjs.map +1 -1
- package/dist/beta/esm/Grid/Grid.mjs +74 -70
- package/dist/beta/esm/Grid/Grid.mjs.map +1 -1
- package/dist/beta/esm/Grid/GridItem.mjs +35 -31
- package/dist/beta/esm/Grid/GridItem.mjs.map +1 -1
- package/dist/beta/esm/templates/Sidebar.mjs +85 -67
- package/dist/beta/esm/templates/Sidebar.mjs.map +1 -1
- package/dist/beta/esm/templates/portal/Portal.mjs +35 -36
- package/dist/beta/esm/templates/portal/Portal.mjs.map +1 -1
- package/dist/beta/types/Flex/Flex.d.ts +3 -1
- package/dist/beta/types/Grid/Grid.d.ts +3 -1
- package/dist/beta/types/Grid/GridItem.d.ts +3 -1
- package/dist/beta/types/templates/Sidebar.d.ts +32 -8
- package/dist/beta/types/templates/portal/Portal.d.ts +21 -4
- package/package.json +2 -2
|
@@ -1,79 +1,83 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import { getSpacingValue } from "../LayoutWrapper/utils.mjs";
|
|
3
4
|
import { useResponsiveValue } from "../LayoutWrapper/useResponsiveValue.mjs";
|
|
4
5
|
import classNames from "classnames";
|
|
5
6
|
/* empty css */
|
|
6
7
|
const defaultElement = "div";
|
|
7
|
-
const Grid = (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
8
|
+
const Grid = React.forwardRef(
|
|
9
|
+
({
|
|
10
|
+
templateColumns,
|
|
11
|
+
templateRows,
|
|
12
|
+
gap = "m",
|
|
13
|
+
rowGap,
|
|
14
|
+
columnGap,
|
|
15
|
+
autoFlow = "row",
|
|
16
|
+
align,
|
|
17
|
+
justify,
|
|
18
|
+
alignContent,
|
|
19
|
+
height,
|
|
20
|
+
as,
|
|
21
|
+
className,
|
|
22
|
+
children,
|
|
23
|
+
style,
|
|
24
|
+
...rest
|
|
25
|
+
}, ref) => {
|
|
26
|
+
const Element = as || defaultElement;
|
|
27
|
+
const resolvedTemplateColumns = useResponsiveValue(templateColumns) ?? "repeat(12, 1fr)";
|
|
28
|
+
const resolvedTemplateRows = useResponsiveValue(templateRows);
|
|
29
|
+
const resolvedGap = useResponsiveValue(gap);
|
|
30
|
+
const resolvedRowGap = useResponsiveValue(rowGap);
|
|
31
|
+
const resolvedColumnGap = useResponsiveValue(columnGap);
|
|
32
|
+
const resolvedAutoFlow = useResponsiveValue(autoFlow) ?? "row";
|
|
33
|
+
const resolvedAlign = useResponsiveValue(align);
|
|
34
|
+
const resolvedJustify = useResponsiveValue(justify);
|
|
35
|
+
const resolvedAlignContent = useResponsiveValue(alignContent);
|
|
36
|
+
const gridStyle = {
|
|
37
|
+
...resolvedTemplateColumns && {
|
|
38
|
+
"--grid-template-columns": resolvedTemplateColumns
|
|
39
|
+
},
|
|
40
|
+
...resolvedTemplateRows && {
|
|
41
|
+
"--grid-template-rows": resolvedTemplateRows
|
|
42
|
+
},
|
|
43
|
+
...resolvedAutoFlow && {
|
|
44
|
+
"--grid-auto-flow": resolvedAutoFlow
|
|
45
|
+
},
|
|
46
|
+
...resolvedAlign && {
|
|
47
|
+
"--grid-align-items": resolvedAlign
|
|
48
|
+
},
|
|
49
|
+
...resolvedJustify && {
|
|
50
|
+
"--grid-justify-content": resolvedJustify
|
|
51
|
+
},
|
|
52
|
+
...resolvedAlignContent && {
|
|
53
|
+
"--grid-align-content": resolvedAlignContent
|
|
54
|
+
},
|
|
55
|
+
...resolvedGap && {
|
|
56
|
+
"--grid-gap": getSpacingValue(resolvedGap)
|
|
57
|
+
},
|
|
58
|
+
...resolvedRowGap && {
|
|
59
|
+
"--grid-row-gap": getSpacingValue(resolvedRowGap)
|
|
60
|
+
},
|
|
61
|
+
...resolvedColumnGap && {
|
|
62
|
+
"--grid-column-gap": getSpacingValue(resolvedColumnGap)
|
|
63
|
+
},
|
|
64
|
+
...height && {
|
|
65
|
+
"--grid-height": height
|
|
66
|
+
},
|
|
67
|
+
...style
|
|
68
|
+
};
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
Element,
|
|
71
|
+
{
|
|
72
|
+
ref,
|
|
73
|
+
className: classNames("eds-layout-grid", className),
|
|
74
|
+
style: gridStyle,
|
|
75
|
+
...rest,
|
|
76
|
+
children
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
);
|
|
77
81
|
export {
|
|
78
82
|
Grid
|
|
79
83
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.mjs","sources":["../../../../src/beta/Grid/Grid.tsx"],"sourcesContent":["import React from 'react';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { getSpacingValue } from '../LayoutWrapper/utils';\nimport type { GridSpacingValue, ResponsiveValue } from '../LayoutWrapper/utils';\nimport { useResponsiveValue } from '../LayoutWrapper/useResponsiveValue';\nimport classNames from 'classnames';\n\nimport './Grid.scss';\n\ntype AlignItems = React.CSSProperties['alignItems'];\ntype JustifyContent = React.CSSProperties['justifyContent'];\ntype AlignContent = React.CSSProperties['alignContent'];\n\nexport type GridOwnProps = {\n /** CSS grid-template-columns value (supports responsive objects)\n * @default \"repeat(12, 1fr)\"\n */\n templateColumns?: string | ResponsiveValue<string>;\n /** Spacing between grid items (supports responsive objects)\n * @default \"m\"\n */\n gap?: GridSpacingValue | ResponsiveValue<GridSpacingValue>;\n /** Vertical spacing between grid rows (supports responsive objects) */\n rowGap?: GridSpacingValue | ResponsiveValue<GridSpacingValue>;\n /** Horizontal spacing between grid columns (supports responsive objects) */\n columnGap?: GridSpacingValue | ResponsiveValue<GridSpacingValue>;\n /** CSS grid-template-rows value (supports responsive objects) */\n templateRows?: string | ResponsiveValue<string>;\n /** CSS grid-auto-flow value (supports responsive objects)\n * @default \"row\"\n */\n autoFlow?:\n | 'row'\n | 'column'\n | 'dense'\n | 'row dense'\n | 'column dense'\n | ResponsiveValue<\n 'row' | 'column' | 'dense' | 'row dense' | 'column dense'\n >;\n /** CSS align-items value (supports responsive objects) */\n align?: AlignItems | ResponsiveValue<AlignItems>;\n /** CSS justify-content value (supports responsive objects) */\n justify?: JustifyContent | ResponsiveValue<JustifyContent>;\n /** CSS align-content value (supports responsive objects) */\n alignContent?: AlignContent | ResponsiveValue<AlignContent>;\n /** The height of the grid container */\n height?: string;\n /** HTML element or React component used to render the Grid\n * @default \"div\"\n */\n as?: string | React.ElementType;\n /** Additional class names */\n className?: string;\n /** Content of the Grid container */\n children?: React.ReactNode;\n};\n\nexport type GridProps<T extends React.ElementType = typeof defaultElement> =\n PolymorphicComponentProps<T, GridOwnProps>;\n\nconst defaultElement = 'div';\n\nexport const Grid = <E extends React.ElementType = typeof defaultElement>({\n
|
|
1
|
+
{"version":3,"file":"Grid.mjs","sources":["../../../../src/beta/Grid/Grid.tsx"],"sourcesContent":["import React from 'react';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { getSpacingValue } from '../LayoutWrapper/utils';\nimport type { GridSpacingValue, ResponsiveValue } from '../LayoutWrapper/utils';\nimport { useResponsiveValue } from '../LayoutWrapper/useResponsiveValue';\nimport classNames from 'classnames';\n\nimport './Grid.scss';\n\ntype AlignItems = React.CSSProperties['alignItems'];\ntype JustifyContent = React.CSSProperties['justifyContent'];\ntype AlignContent = React.CSSProperties['alignContent'];\n\nexport type GridOwnProps = {\n /** CSS grid-template-columns value (supports responsive objects)\n * @default \"repeat(12, 1fr)\"\n */\n templateColumns?: string | ResponsiveValue<string>;\n /** Spacing between grid items (supports responsive objects)\n * @default \"m\"\n */\n gap?: GridSpacingValue | ResponsiveValue<GridSpacingValue>;\n /** Vertical spacing between grid rows (supports responsive objects) */\n rowGap?: GridSpacingValue | ResponsiveValue<GridSpacingValue>;\n /** Horizontal spacing between grid columns (supports responsive objects) */\n columnGap?: GridSpacingValue | ResponsiveValue<GridSpacingValue>;\n /** CSS grid-template-rows value (supports responsive objects) */\n templateRows?: string | ResponsiveValue<string>;\n /** CSS grid-auto-flow value (supports responsive objects)\n * @default \"row\"\n */\n autoFlow?:\n | 'row'\n | 'column'\n | 'dense'\n | 'row dense'\n | 'column dense'\n | ResponsiveValue<\n 'row' | 'column' | 'dense' | 'row dense' | 'column dense'\n >;\n /** CSS align-items value (supports responsive objects) */\n align?: AlignItems | ResponsiveValue<AlignItems>;\n /** CSS justify-content value (supports responsive objects) */\n justify?: JustifyContent | ResponsiveValue<JustifyContent>;\n /** CSS align-content value (supports responsive objects) */\n alignContent?: AlignContent | ResponsiveValue<AlignContent>;\n /** The height of the grid container */\n height?: string;\n /** HTML element or React component used to render the Grid\n * @default \"div\"\n */\n as?: string | React.ElementType;\n /** Additional class names */\n className?: string;\n /** Content of the Grid container */\n children?: React.ReactNode;\n};\n\nexport type GridProps<T extends React.ElementType = typeof defaultElement> =\n PolymorphicComponentProps<T, GridOwnProps>;\n\nconst defaultElement = 'div';\n\nexport const Grid = React.forwardRef(\n <E extends React.ElementType = typeof defaultElement>(\n {\n templateColumns,\n templateRows,\n gap = 'm',\n rowGap,\n columnGap,\n autoFlow = 'row',\n align,\n justify,\n alignContent,\n height,\n as,\n className,\n children,\n style,\n ...rest\n }: GridProps<E>,\n ref?: React.Ref<Element>,\n ): JSX.Element => {\n const Element: React.ElementType = as || defaultElement;\n\n const resolvedTemplateColumns =\n useResponsiveValue(templateColumns) ?? 'repeat(12, 1fr)';\n const resolvedTemplateRows = useResponsiveValue(templateRows);\n const resolvedGap = useResponsiveValue(gap);\n const resolvedRowGap = useResponsiveValue(rowGap);\n const resolvedColumnGap = useResponsiveValue(columnGap);\n const resolvedAutoFlow = useResponsiveValue(autoFlow) ?? 'row';\n const resolvedAlign = useResponsiveValue(align);\n const resolvedJustify = useResponsiveValue(justify);\n const resolvedAlignContent = useResponsiveValue(alignContent);\n\n const gridStyle: React.CSSProperties = {\n ...(resolvedTemplateColumns && {\n '--grid-template-columns': resolvedTemplateColumns,\n }),\n ...(resolvedTemplateRows && {\n '--grid-template-rows': resolvedTemplateRows,\n }),\n ...(resolvedAutoFlow && {\n '--grid-auto-flow': resolvedAutoFlow,\n }),\n ...(resolvedAlign && {\n '--grid-align-items': resolvedAlign,\n }),\n ...(resolvedJustify && {\n '--grid-justify-content': resolvedJustify,\n }),\n ...(resolvedAlignContent && {\n '--grid-align-content': resolvedAlignContent,\n }),\n ...(resolvedGap && {\n '--grid-gap': getSpacingValue(resolvedGap),\n }),\n ...(resolvedRowGap && {\n '--grid-row-gap': getSpacingValue(resolvedRowGap),\n }),\n ...(resolvedColumnGap && {\n '--grid-column-gap': getSpacingValue(resolvedColumnGap),\n }),\n ...(height && {\n '--grid-height': height,\n }),\n ...style,\n } as React.CSSProperties;\n\n return (\n <Element\n ref={ref}\n className={classNames('eds-layout-grid', className)}\n style={gridStyle}\n {...rest}\n >\n {children}\n </Element>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;AA6DA,MAAM,iBAAiB;AAEhB,MAAM,OAAO,MAAM;AAAA,EACxB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACgB;AAChB,UAAM,UAA6B,MAAM;AAEzC,UAAM,0BACJ,mBAAmB,eAAe,KAAK;AACzC,UAAM,uBAAuB,mBAAmB,YAAY;AAC5D,UAAM,cAAc,mBAAmB,GAAG;AAC1C,UAAM,iBAAiB,mBAAmB,MAAM;AAChD,UAAM,oBAAoB,mBAAmB,SAAS;AACtD,UAAM,mBAAmB,mBAAmB,QAAQ,KAAK;AACzD,UAAM,gBAAgB,mBAAmB,KAAK;AAC9C,UAAM,kBAAkB,mBAAmB,OAAO;AAClD,UAAM,uBAAuB,mBAAmB,YAAY;AAE5D,UAAM,YAAiC;AAAA,MACrC,GAAI,2BAA2B;AAAA,QAC7B,2BAA2B;AAAA,MAAA;AAAA,MAE7B,GAAI,wBAAwB;AAAA,QAC1B,wBAAwB;AAAA,MAAA;AAAA,MAE1B,GAAI,oBAAoB;AAAA,QACtB,oBAAoB;AAAA,MAAA;AAAA,MAEtB,GAAI,iBAAiB;AAAA,QACnB,sBAAsB;AAAA,MAAA;AAAA,MAExB,GAAI,mBAAmB;AAAA,QACrB,0BAA0B;AAAA,MAAA;AAAA,MAE5B,GAAI,wBAAwB;AAAA,QAC1B,wBAAwB;AAAA,MAAA;AAAA,MAE1B,GAAI,eAAe;AAAA,QACjB,cAAc,gBAAgB,WAAW;AAAA,MAAA;AAAA,MAE3C,GAAI,kBAAkB;AAAA,QACpB,kBAAkB,gBAAgB,cAAc;AAAA,MAAA;AAAA,MAElD,GAAI,qBAAqB;AAAA,QACvB,qBAAqB,gBAAgB,iBAAiB;AAAA,MAAA;AAAA,MAExD,GAAI,UAAU;AAAA,QACZ,iBAAiB;AAAA,MAAA;AAAA,MAEnB,GAAG;AAAA,IAAA;AAGL,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW,WAAW,mBAAmB,SAAS;AAAA,QAClD,OAAO;AAAA,QACN,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import { useResponsiveValue } from "../LayoutWrapper/useResponsiveValue.mjs";
|
|
3
4
|
import classNames from "classnames";
|
|
4
5
|
/* empty css */
|
|
@@ -12,37 +13,40 @@ const formatGridSpan = (value) => {
|
|
|
12
13
|
}
|
|
13
14
|
return value;
|
|
14
15
|
};
|
|
15
|
-
const GridItem = (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
16
|
+
const GridItem = React.forwardRef(
|
|
17
|
+
({
|
|
18
|
+
colSpan,
|
|
19
|
+
rowSpan = 1,
|
|
20
|
+
as,
|
|
21
|
+
className,
|
|
22
|
+
children,
|
|
23
|
+
style,
|
|
24
|
+
...rest
|
|
25
|
+
}, ref) => {
|
|
26
|
+
const Element = as || defaultElement;
|
|
27
|
+
const resolvedColSpan = useResponsiveValue(colSpan);
|
|
28
|
+
const resolvedRowSpan = useResponsiveValue(rowSpan);
|
|
29
|
+
const itemStyle = {
|
|
30
|
+
...resolvedColSpan !== void 0 && {
|
|
31
|
+
"--grid-item-column": formatGridSpan(resolvedColSpan)
|
|
32
|
+
},
|
|
33
|
+
...resolvedRowSpan !== void 0 && {
|
|
34
|
+
"--grid-item-row": formatGridSpan(resolvedRowSpan)
|
|
35
|
+
},
|
|
36
|
+
...style
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
Element,
|
|
40
|
+
{
|
|
41
|
+
ref,
|
|
42
|
+
className: classNames("eds-layout-grid-item", className),
|
|
43
|
+
style: itemStyle,
|
|
44
|
+
...rest,
|
|
45
|
+
children
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
);
|
|
46
50
|
export {
|
|
47
51
|
GridItem
|
|
48
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridItem.mjs","sources":["../../../../src/beta/Grid/GridItem.tsx"],"sourcesContent":["import React from 'react';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { useResponsiveValue } from '../LayoutWrapper/useResponsiveValue';\nimport type { ResponsiveValue } from '../LayoutWrapper/utils';\nimport classNames from 'classnames';\n\nimport './GridItem.scss';\n\nexport type GridItemOwnProps = {\n /** Number of columns the item should span (supports responsive objects)\n * If number: adds \"span\" prefix (e.g., 6 → \"span 6\")\n * If string: used directly (e.g., \"span 3\" or \"1 / 3\")\n */\n colSpan?: number | string | ResponsiveValue<number | string>;\n /** Number of rows the item should span (supports responsive objects)\n * @default 1\n * If number: adds \"span\" prefix (e.g., 2 → \"span 2\")\n * If string: used directly (e.g., \"span 2\" or \"1 / 3\")\n */\n rowSpan?: number | string | ResponsiveValue<number | string>;\n /** HTML element or React component used to render the Grid item\n * @default \"div\"\n */\n as?: string | React.ElementType;\n /** Additional class names */\n className?: string;\n /** Content of the Grid item */\n children?: React.ReactNode;\n};\n\nexport type GridItemProps<T extends React.ElementType = typeof defaultElement> =\n PolymorphicComponentProps<T, GridItemOwnProps>;\n\nconst defaultElement = 'div';\n\nconst formatGridSpan = (\n value: number | string | undefined,\n): string | undefined => {\n if (value === undefined) {\n return undefined;\n }\n\n if (typeof value === 'number') {\n return `span ${value}`;\n }\n\n return value;\n};\n\nexport const GridItem = <E extends React.ElementType = typeof defaultElement>({\n
|
|
1
|
+
{"version":3,"file":"GridItem.mjs","sources":["../../../../src/beta/Grid/GridItem.tsx"],"sourcesContent":["import React from 'react';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { useResponsiveValue } from '../LayoutWrapper/useResponsiveValue';\nimport type { ResponsiveValue } from '../LayoutWrapper/utils';\nimport classNames from 'classnames';\n\nimport './GridItem.scss';\n\nexport type GridItemOwnProps = {\n /** Number of columns the item should span (supports responsive objects)\n * If number: adds \"span\" prefix (e.g., 6 → \"span 6\")\n * If string: used directly (e.g., \"span 3\" or \"1 / 3\")\n */\n colSpan?: number | string | ResponsiveValue<number | string>;\n /** Number of rows the item should span (supports responsive objects)\n * @default 1\n * If number: adds \"span\" prefix (e.g., 2 → \"span 2\")\n * If string: used directly (e.g., \"span 2\" or \"1 / 3\")\n */\n rowSpan?: number | string | ResponsiveValue<number | string>;\n /** HTML element or React component used to render the Grid item\n * @default \"div\"\n */\n as?: string | React.ElementType;\n /** Additional class names */\n className?: string;\n /** Content of the Grid item */\n children?: React.ReactNode;\n};\n\nexport type GridItemProps<T extends React.ElementType = typeof defaultElement> =\n PolymorphicComponentProps<T, GridItemOwnProps>;\n\nconst defaultElement = 'div';\n\nconst formatGridSpan = (\n value: number | string | undefined,\n): string | undefined => {\n if (value === undefined) {\n return undefined;\n }\n\n if (typeof value === 'number') {\n return `span ${value}`;\n }\n\n return value;\n};\n\nexport const GridItem = React.forwardRef(\n <E extends React.ElementType = typeof defaultElement>(\n {\n colSpan,\n rowSpan = 1,\n as,\n className,\n children,\n style,\n ...rest\n }: GridItemProps<E>,\n ref?: React.Ref<Element>,\n ): JSX.Element => {\n const Element: React.ElementType = as || defaultElement;\n\n const resolvedColSpan = useResponsiveValue(colSpan);\n const resolvedRowSpan = useResponsiveValue(rowSpan);\n\n const itemStyle: React.CSSProperties = {\n ...(resolvedColSpan !== undefined && {\n '--grid-item-column': formatGridSpan(resolvedColSpan),\n }),\n ...(resolvedRowSpan !== undefined && {\n '--grid-item-row': formatGridSpan(resolvedRowSpan),\n }),\n ...style,\n } as React.CSSProperties;\n\n return (\n <Element\n ref={ref}\n className={classNames('eds-layout-grid-item', className)}\n style={itemStyle}\n {...rest}\n >\n {children}\n </Element>\n );\n },\n);\n"],"names":[],"mappings":";;;;;AAiCA,MAAM,iBAAiB;AAEvB,MAAM,iBAAiB,CACrB,UACuB;AACvB,MAAI,UAAU,QAAW;AACvB,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,QAAQ,KAAK;AAAA,EACtB;AAEA,SAAO;AACT;AAEO,MAAM,WAAW,MAAM;AAAA,EAC5B,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACgB;AAChB,UAAM,UAA6B,MAAM;AAEzC,UAAM,kBAAkB,mBAAmB,OAAO;AAClD,UAAM,kBAAkB,mBAAmB,OAAO;AAElD,UAAM,YAAiC;AAAA,MACrC,GAAI,oBAAoB,UAAa;AAAA,QACnC,sBAAsB,eAAe,eAAe;AAAA,MAAA;AAAA,MAEtD,GAAI,oBAAoB,UAAa;AAAA,QACnC,mBAAmB,eAAe,eAAe;AAAA,MAAA;AAAA,MAEnD,GAAG;AAAA,IAAA;AAGL,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW,WAAW,wBAAwB,SAAS;AAAA,QACvD,OAAO;AAAA,QACN,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;"}
|
|
@@ -1,76 +1,94 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import classNames from "classnames";
|
|
3
4
|
import { Contrast } from "../Contrast.mjs";
|
|
4
5
|
import { FlexComponent } from "../Flex/index.mjs";
|
|
5
6
|
import { GridComponent } from "../Grid/index.mjs";
|
|
6
7
|
/* empty css */
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
8
|
+
const defaultSidebarElement = "aside";
|
|
9
|
+
const defaultSectionElement = "div";
|
|
10
|
+
const defaultNavigationElement = "nav";
|
|
11
|
+
const defaultFooterElement = "footer";
|
|
12
|
+
const SidebarLogo = React.forwardRef(
|
|
13
|
+
({ children, as, ...rest }, ref) => {
|
|
14
|
+
const Element = as || defaultSectionElement;
|
|
15
|
+
return /* @__PURE__ */ jsx(Element, { ref, ...rest, children });
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
const SidebarUser = React.forwardRef(
|
|
19
|
+
({ children, as, ...rest }, ref) => {
|
|
20
|
+
const Element = as || defaultSectionElement;
|
|
21
|
+
return /* @__PURE__ */ jsx(Element, { ref, ...rest, children });
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
const SidebarData = React.forwardRef(
|
|
25
|
+
({ children, as, ...rest }, ref) => {
|
|
26
|
+
const Element = as || defaultSectionElement;
|
|
27
|
+
return /* @__PURE__ */ jsx(Element, { ref, ...rest, children });
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
const SidebarNavigation = React.forwardRef(
|
|
31
|
+
({ children, className, as, ...rest }, ref) => {
|
|
32
|
+
const Element = as || defaultNavigationElement;
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
Element,
|
|
35
|
+
{
|
|
36
|
+
ref,
|
|
37
|
+
className: classNames(
|
|
38
|
+
"eds-layout-template-sidebar__navigation",
|
|
39
|
+
className
|
|
40
|
+
),
|
|
41
|
+
...rest,
|
|
42
|
+
children
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
const SidebarFooter = React.forwardRef(
|
|
48
|
+
({ children, className, as, ...rest }, ref) => {
|
|
49
|
+
const Element = as || defaultFooterElement;
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
Element,
|
|
52
|
+
{
|
|
53
|
+
ref,
|
|
54
|
+
className: classNames("eds-layout-template-sidebar__footer", className),
|
|
55
|
+
...rest,
|
|
56
|
+
children
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
const SidebarRoot = React.forwardRef(
|
|
62
|
+
({
|
|
63
|
+
children,
|
|
64
|
+
className,
|
|
65
|
+
style,
|
|
66
|
+
contrast = true,
|
|
67
|
+
as,
|
|
68
|
+
...rest
|
|
69
|
+
}, ref) => {
|
|
70
|
+
const WrapperElement = contrast ? Contrast : "div";
|
|
71
|
+
return /* @__PURE__ */ jsx(GridComponent.Item, { as: WrapperElement, colSpan: "1 / 2", rowSpan: "1 / 2", children: /* @__PURE__ */ jsx(
|
|
72
|
+
FlexComponent,
|
|
73
|
+
{
|
|
74
|
+
ref,
|
|
75
|
+
as: as || defaultSidebarElement,
|
|
76
|
+
direction: "column",
|
|
77
|
+
gap: "m",
|
|
78
|
+
className: classNames(
|
|
79
|
+
"eds-layout-template-sidebar",
|
|
80
|
+
{
|
|
81
|
+
"eds-layout-template-sidebar--plain": !contrast
|
|
82
|
+
},
|
|
83
|
+
className
|
|
84
|
+
),
|
|
85
|
+
style,
|
|
86
|
+
...rest,
|
|
87
|
+
children
|
|
88
|
+
}
|
|
89
|
+
) });
|
|
90
|
+
}
|
|
91
|
+
);
|
|
74
92
|
const Sidebar = Object.assign(SidebarRoot, {
|
|
75
93
|
Logo: SidebarLogo,
|
|
76
94
|
User: SidebarUser,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.mjs","sources":["../../../../src/beta/templates/Sidebar.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { Contrast } from '../../Contrast';\nimport { Flex } from '../Flex';\nimport { Grid } from '../Grid';\nimport './Sidebar.scss';\n\
|
|
1
|
+
{"version":3,"file":"Sidebar.mjs","sources":["../../../../src/beta/templates/Sidebar.tsx"],"sourcesContent":["import React from 'react';\nimport type { PolymorphicComponentProps } from '@entur/utils';\nimport classNames from 'classnames';\nimport { Contrast } from '../../Contrast';\nimport { Flex } from '../Flex';\nimport { Grid } from '../Grid';\nimport './Sidebar.scss';\n\ntype SidebarOwnProps = {\n /** Toggle contrast styling for the sidebar */\n contrast?: boolean;\n className?: string;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n};\n\ntype SidebarSectionOwnProps = {\n className?: string;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n};\n\nconst defaultSidebarElement = 'aside';\nconst defaultSectionElement = 'div';\nconst defaultNavigationElement = 'nav';\nconst defaultFooterElement = 'footer';\n\nexport type SidebarProps<\n T extends React.ElementType = typeof defaultSidebarElement,\n> = PolymorphicComponentProps<T, SidebarOwnProps>;\n\nexport type SidebarSectionProps<\n T extends React.ElementType = typeof defaultSectionElement,\n> = PolymorphicComponentProps<T, SidebarSectionOwnProps>;\n\nconst SidebarLogo = React.forwardRef(\n <E extends React.ElementType = typeof defaultSectionElement>(\n { children, as, ...rest }: SidebarSectionProps<E>,\n ref?: React.Ref<Element>,\n ) => {\n const Element: React.ElementType = as || defaultSectionElement;\n return (\n <Element ref={ref} {...rest}>\n {children}\n </Element>\n );\n },\n);\n\nconst SidebarUser = React.forwardRef(\n <E extends React.ElementType = typeof defaultSectionElement>(\n { children, as, ...rest }: SidebarSectionProps<E>,\n ref?: React.Ref<Element>,\n ) => {\n const Element: React.ElementType = as || defaultSectionElement;\n return (\n <Element ref={ref} {...rest}>\n {children}\n </Element>\n );\n },\n);\n\nconst SidebarData = React.forwardRef(\n <E extends React.ElementType = typeof defaultSectionElement>(\n { children, as, ...rest }: SidebarSectionProps<E>,\n ref?: React.Ref<Element>,\n ) => {\n const Element: React.ElementType = as || defaultSectionElement;\n return (\n <Element ref={ref} {...rest}>\n {children}\n </Element>\n );\n },\n);\n\nconst SidebarNavigation = React.forwardRef(\n <E extends React.ElementType = typeof defaultNavigationElement>(\n { children, className, as, ...rest }: SidebarSectionProps<E>,\n ref?: React.Ref<Element>,\n ) => {\n const Element: React.ElementType = as || defaultNavigationElement;\n return (\n <Element\n ref={ref}\n className={classNames(\n 'eds-layout-template-sidebar__navigation',\n className,\n )}\n {...rest}\n >\n {children}\n </Element>\n );\n },\n);\n\nconst SidebarFooter = React.forwardRef(\n <E extends React.ElementType = typeof defaultFooterElement>(\n { children, className, as, ...rest }: SidebarSectionProps<E>,\n ref?: React.Ref<Element>,\n ) => {\n const Element: React.ElementType = as || defaultFooterElement;\n return (\n <Element\n ref={ref}\n className={classNames('eds-layout-template-sidebar__footer', className)}\n {...rest}\n >\n {children}\n </Element>\n );\n },\n);\n\nconst SidebarRoot = React.forwardRef(\n <E extends React.ElementType = typeof defaultSidebarElement>(\n {\n children,\n className,\n style,\n contrast = true,\n as,\n ...rest\n }: SidebarProps<E>,\n ref?: React.Ref<Element>,\n ) => {\n const WrapperElement = contrast ? Contrast : 'div';\n return (\n <Grid.Item as={WrapperElement} colSpan=\"1 / 2\" rowSpan=\"1 / 2\">\n <Flex\n ref={ref}\n as={as || defaultSidebarElement}\n direction=\"column\"\n gap=\"m\"\n className={classNames(\n 'eds-layout-template-sidebar',\n {\n 'eds-layout-template-sidebar--plain': !contrast,\n },\n className,\n )}\n style={style}\n {...rest}\n >\n {children}\n </Flex>\n </Grid.Item>\n );\n },\n);\n\nexport type SidebarComponent = typeof SidebarRoot & {\n Logo: typeof SidebarLogo;\n User: typeof SidebarUser;\n Data: typeof SidebarData;\n Navigation: typeof SidebarNavigation;\n Footer: typeof SidebarFooter;\n};\n\nexport const Sidebar: SidebarComponent = Object.assign(SidebarRoot, {\n Logo: SidebarLogo,\n User: SidebarUser,\n Data: SidebarData,\n Navigation: SidebarNavigation,\n Footer: SidebarFooter,\n});\n\nSidebar.displayName = 'Template.Portal.Sidebar';\nSidebar.Logo.displayName = 'Template.Portal.Sidebar.Logo';\nSidebar.User.displayName = 'Template.Portal.Sidebar.User';\nSidebar.Data.displayName = 'Template.Portal.Sidebar.Data';\nSidebar.Navigation.displayName = 'Template.Portal.Sidebar.Navigation';\nSidebar.Footer.displayName = 'Template.Portal.Sidebar.Footer';\n"],"names":["Grid","Flex"],"mappings":";;;;;;;AAsBA,MAAM,wBAAwB;AAC9B,MAAM,wBAAwB;AAC9B,MAAM,2BAA2B;AACjC,MAAM,uBAAuB;AAU7B,MAAM,cAAc,MAAM;AAAA,EACxB,CACE,EAAE,UAAU,IAAI,GAAG,KAAA,GACnB,QACG;AACH,UAAM,UAA6B,MAAM;AACzC,WACE,oBAAC,SAAA,EAAQ,KAAW,GAAG,MACpB,UACH;AAAA,EAEJ;AACF;AAEA,MAAM,cAAc,MAAM;AAAA,EACxB,CACE,EAAE,UAAU,IAAI,GAAG,KAAA,GACnB,QACG;AACH,UAAM,UAA6B,MAAM;AACzC,WACE,oBAAC,SAAA,EAAQ,KAAW,GAAG,MACpB,UACH;AAAA,EAEJ;AACF;AAEA,MAAM,cAAc,MAAM;AAAA,EACxB,CACE,EAAE,UAAU,IAAI,GAAG,KAAA,GACnB,QACG;AACH,UAAM,UAA6B,MAAM;AACzC,WACE,oBAAC,SAAA,EAAQ,KAAW,GAAG,MACpB,UACH;AAAA,EAEJ;AACF;AAEA,MAAM,oBAAoB,MAAM;AAAA,EAC9B,CACE,EAAE,UAAU,WAAW,IAAI,GAAG,KAAA,GAC9B,QACG;AACH,UAAM,UAA6B,MAAM;AACzC,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,MAAM,gBAAgB,MAAM;AAAA,EAC1B,CACE,EAAE,UAAU,WAAW,IAAI,GAAG,KAAA,GAC9B,QACG;AACH,UAAM,UAA6B,MAAM;AACzC,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW,WAAW,uCAAuC,SAAS;AAAA,QACrE,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,MAAM,cAAc,MAAM;AAAA,EACxB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,iBAAiB,WAAW,WAAW;AAC7C,WACE,oBAACA,cAAK,MAAL,EAAU,IAAI,gBAAgB,SAAQ,SAAQ,SAAQ,SACrD,UAAA;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC;AAAA,QACA,IAAI,MAAM;AAAA,QACV,WAAU;AAAA,QACV,KAAI;AAAA,QACJ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,YACE,sCAAsC,CAAC;AAAA,UAAA;AAAA,UAEzC;AAAA,QAAA;AAAA,QAEF;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA,GAEL;AAAA,EAEJ;AACF;AAUO,MAAM,UAA4B,OAAO,OAAO,aAAa;AAAA,EAClE,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,QAAQ;AACV,CAAC;AAED,QAAQ,cAAc;AACtB,QAAQ,KAAK,cAAc;AAC3B,QAAQ,KAAK,cAAc;AAC3B,QAAQ,KAAK,cAAc;AAC3B,QAAQ,WAAW,cAAc;AACjC,QAAQ,OAAO,cAAc;"}
|
|
@@ -1,44 +1,43 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import classNames from "classnames";
|
|
3
4
|
import { GridComponent } from "../../Grid/index.mjs";
|
|
4
5
|
import { Sidebar } from "../Sidebar.mjs";
|
|
5
6
|
/* empty css */
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
className,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const PortalMain = (
|
|
25
|
-
children,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
);
|
|
41
|
-
};
|
|
7
|
+
const defaultPortalMainElement = "main";
|
|
8
|
+
const PortalRoot = React.forwardRef(
|
|
9
|
+
({ children, className, style, as, ...rest }, ref) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
GridComponent,
|
|
12
|
+
{
|
|
13
|
+
ref,
|
|
14
|
+
as,
|
|
15
|
+
templateColumns: "var(--eds-sidebar-width, min-content) minmax(0, 1fr)",
|
|
16
|
+
gap: "m",
|
|
17
|
+
className: classNames("eds-layout-template-portal", className),
|
|
18
|
+
style,
|
|
19
|
+
...rest,
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
const PortalMain = React.forwardRef(
|
|
26
|
+
({ children, className, style, as, ...rest }, ref) => {
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
GridComponent.Item,
|
|
29
|
+
{
|
|
30
|
+
ref,
|
|
31
|
+
as: as || defaultPortalMainElement,
|
|
32
|
+
colSpan: "2 / -1",
|
|
33
|
+
className: classNames("eds-layout-template-portal__main", className),
|
|
34
|
+
style,
|
|
35
|
+
...rest,
|
|
36
|
+
children
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
42
41
|
const Portal = Object.assign(PortalRoot, {
|
|
43
42
|
Sidebar,
|
|
44
43
|
Main: PortalMain
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Portal.mjs","sources":["../../../../../src/beta/templates/portal/Portal.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { Grid } from '../../Grid';\nimport { Sidebar, SidebarComponent } from '../Sidebar';\nimport './Portal.scss';\n\nexport type PortalProps
|
|
1
|
+
{"version":3,"file":"Portal.mjs","sources":["../../../../../src/beta/templates/portal/Portal.tsx"],"sourcesContent":["import React from 'react';\nimport type { PolymorphicComponentProps } from '@entur/utils';\nimport classNames from 'classnames';\nimport { Grid } from '../../Grid';\nimport { Sidebar, SidebarComponent } from '../Sidebar';\nimport './Portal.scss';\n\ntype PortalOwnProps = {\n className?: string;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n};\n\ntype PortalMainOwnProps = {\n className?: string;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n};\n\nconst defaultPortalMainElement = 'main';\n\nexport type PortalProps<T extends React.ElementType = typeof Grid> =\n PolymorphicComponentProps<T, PortalOwnProps>;\n\nexport type PortalMainProps<\n T extends React.ElementType = typeof defaultPortalMainElement,\n> = PolymorphicComponentProps<T, PortalMainOwnProps>;\n\nconst PortalRoot = React.forwardRef(\n <E extends React.ElementType = typeof Grid>(\n { children, className, style, as, ...rest }: PortalProps<E>,\n ref?: React.Ref<Element>,\n ) => {\n return (\n <Grid\n ref={ref}\n as={as}\n templateColumns=\"var(--eds-sidebar-width, min-content) minmax(0, 1fr)\"\n gap=\"m\"\n className={classNames('eds-layout-template-portal', className)}\n style={style}\n {...rest}\n >\n {children}\n </Grid>\n );\n },\n);\n\nconst PortalMain = React.forwardRef(\n <E extends React.ElementType = typeof defaultPortalMainElement>(\n { children, className, style, as, ...rest }: PortalMainProps<E>,\n ref?: React.Ref<Element>,\n ) => {\n return (\n <Grid.Item\n ref={ref}\n as={as || defaultPortalMainElement}\n colSpan=\"2 / -1\"\n className={classNames('eds-layout-template-portal__main', className)}\n style={style}\n {...rest}\n >\n {children}\n </Grid.Item>\n );\n },\n);\n\nexport type PortalComponent = typeof PortalRoot & {\n Sidebar: SidebarComponent;\n Main: typeof PortalMain;\n};\n\nexport const Portal: PortalComponent = Object.assign(PortalRoot, {\n Sidebar,\n Main: PortalMain,\n});\n\nPortal.displayName = 'Template.Portal';\nPortal.Main.displayName = 'Template.Portal.Main';\n"],"names":["Grid"],"mappings":";;;;;;AAmBA,MAAM,2BAA2B;AASjC,MAAM,aAAa,MAAM;AAAA,EACvB,CACE,EAAE,UAAU,WAAW,OAAO,IAAI,GAAG,KAAA,GACrC,QACG;AACH,WACE;AAAA,MAACA;AAAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,iBAAgB;AAAA,QAChB,KAAI;AAAA,QACJ,WAAW,WAAW,8BAA8B,SAAS;AAAA,QAC7D;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,MAAM,aAAa,MAAM;AAAA,EACvB,CACE,EAAE,UAAU,WAAW,OAAO,IAAI,GAAG,KAAA,GACrC,QACG;AACH,WACE;AAAA,MAACA,cAAK;AAAA,MAAL;AAAA,QACC;AAAA,QACA,IAAI,MAAM;AAAA,QACV,SAAQ;AAAA,QACR,WAAW,WAAW,oCAAoC,SAAS;AAAA,QACnE;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAOO,MAAM,SAA0B,OAAO,OAAO,YAAY;AAAA,EAC/D;AAAA,EACA,MAAM;AACR,CAAC;AAED,OAAO,cAAc;AACrB,OAAO,KAAK,cAAc;"}
|
|
@@ -61,5 +61,7 @@ export type FlexOwnProps = {
|
|
|
61
61
|
};
|
|
62
62
|
export type FlexProps<T extends React.ElementType = typeof defaultElement> = PolymorphicComponentProps<T, FlexOwnProps>;
|
|
63
63
|
declare const defaultElement = "div";
|
|
64
|
-
export declare const Flex:
|
|
64
|
+
export declare const Flex: React.ForwardRefExoticComponent<Omit<FlexOwnProps & {
|
|
65
|
+
as?: React.ElementType<any> | undefined;
|
|
66
|
+
} & Omit<Omit<any, "ref">, keyof FlexOwnProps>, "ref"> & React.RefAttributes<Element>>;
|
|
65
67
|
export {};
|
|
@@ -42,5 +42,7 @@ export type GridOwnProps = {
|
|
|
42
42
|
};
|
|
43
43
|
export type GridProps<T extends React.ElementType = typeof defaultElement> = PolymorphicComponentProps<T, GridOwnProps>;
|
|
44
44
|
declare const defaultElement = "div";
|
|
45
|
-
export declare const Grid:
|
|
45
|
+
export declare const Grid: React.ForwardRefExoticComponent<Omit<GridOwnProps & {
|
|
46
|
+
as?: React.ElementType<any> | undefined;
|
|
47
|
+
} & Omit<Omit<any, "ref">, keyof GridOwnProps>, "ref"> & React.RefAttributes<Element>>;
|
|
46
48
|
export {};
|
|
@@ -24,5 +24,7 @@ export type GridItemOwnProps = {
|
|
|
24
24
|
};
|
|
25
25
|
export type GridItemProps<T extends React.ElementType = typeof defaultElement> = PolymorphicComponentProps<T, GridItemOwnProps>;
|
|
26
26
|
declare const defaultElement = "div";
|
|
27
|
-
export declare const GridItem:
|
|
27
|
+
export declare const GridItem: React.ForwardRefExoticComponent<Omit<GridItemOwnProps & {
|
|
28
|
+
as?: React.ElementType<any> | undefined;
|
|
29
|
+
} & Omit<Omit<any, "ref">, keyof GridItemOwnProps>, "ref"> & React.RefAttributes<Element>>;
|
|
28
30
|
export {};
|