@drivy/cobalt 0.44.1 → 0.45.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/components/Layout/Components/LayoutStack.js +21 -22
- package/components/Layout/Components/LayoutStack.js.map +1 -1
- package/components/Layout/Surfaces/index.js +33 -0
- package/components/Layout/Surfaces/index.js.map +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +6 -6
- package/types/src/components/Layout/Components/LayoutStack.d.ts +14 -10
- package/types/src/index.d.ts +1 -0
|
@@ -2,43 +2,42 @@ import { nanoid } from 'nanoid';
|
|
|
2
2
|
import React, { Children, cloneElement, isValidElement } from 'react';
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
|
|
5
|
-
const LayoutStackItem = ({ children, isTable, ...props }) => {
|
|
5
|
+
const LayoutStackItem = ({ children, isTable, className, isTableHeader: _isTableHeader, ...props }) => {
|
|
6
6
|
const Comp = isTable ? "tr" : "div";
|
|
7
|
-
return (React.createElement(Comp, { className: "cobalt-layout-stack__item", ...props }, children));
|
|
7
|
+
return (React.createElement(Comp, { className: cx("cobalt-layout-stack__item", className), ...props }, children));
|
|
8
8
|
};
|
|
9
|
-
const LayoutStackLinkItem = ({ children, ...hyperlinkProps }) => {
|
|
10
|
-
return (React.createElement("a", { className: "cobalt-layout-stack__item", ...hyperlinkProps }, children));
|
|
9
|
+
const LayoutStackLinkItem = ({ children, className, ...hyperlinkProps }) => {
|
|
10
|
+
return (React.createElement("a", { className: cx("cobalt-layout-stack__item", className), ...hyperlinkProps }, children));
|
|
11
11
|
};
|
|
12
12
|
const isStackItem = (child) => {
|
|
13
|
-
return isValidElement(child) &&
|
|
13
|
+
return (isValidElement(child) &&
|
|
14
|
+
(child.type === LayoutStackItem || child.type === LayoutStackLinkItem));
|
|
14
15
|
};
|
|
15
|
-
const LayoutStack = ({ children, isTable, isPageHeader, }) => {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
const LayoutStack = ({ children, isTable, isPageHeader, className, ...props }) => {
|
|
17
|
+
const classNames = cx("cobalt-layout-stack", {
|
|
18
|
+
"cobalt-layout--isPageHeader": isPageHeader,
|
|
19
|
+
}, className);
|
|
20
|
+
if (isTable) {
|
|
21
|
+
const headerElements = [];
|
|
22
|
+
const bodyElements = [];
|
|
23
|
+
Children.map(children, (child) => {
|
|
24
|
+
if (isStackItem(child)) {
|
|
25
|
+
const newChild = cloneElement(child, { isTable: true, key: nanoid() });
|
|
26
|
+
if (newChild.props.isTableHeader) {
|
|
23
27
|
headerElements.push(newChild);
|
|
24
28
|
}
|
|
25
29
|
else {
|
|
26
30
|
bodyElements.push(newChild);
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const className = cx("cobalt-layout-stack", {
|
|
33
|
-
"cobalt-layout--isPageHeader": isPageHeader,
|
|
34
|
-
});
|
|
35
|
-
if (isTable) {
|
|
36
|
-
return (React.createElement("table", { className: className },
|
|
33
|
+
return child;
|
|
34
|
+
});
|
|
35
|
+
return (React.createElement("table", { className: classNames, ...props },
|
|
37
36
|
!!headerElements.length && React.createElement("thead", null, headerElements),
|
|
38
37
|
React.createElement("tbody", null, bodyElements)));
|
|
39
38
|
}
|
|
40
39
|
else {
|
|
41
|
-
return React.createElement("div", { className:
|
|
40
|
+
return (React.createElement("div", { className: classNames, ...props }, children));
|
|
42
41
|
}
|
|
43
42
|
};
|
|
44
43
|
LayoutStack.Item = LayoutStackItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutStack.js","sources":["../../../../src/components/Layout/Components/LayoutStack.tsx"],"sourcesContent":["import { nanoid } from \"nanoid\"\nimport React, { Children, isValidElement, cloneElement } from \"react\"\nimport cx from \"classnames\"\n\ntype
|
|
1
|
+
{"version":3,"file":"LayoutStack.js","sources":["../../../../src/components/Layout/Components/LayoutStack.tsx"],"sourcesContent":["import { nanoid } from \"nanoid\"\nimport React, { Children, isValidElement, cloneElement } from \"react\"\nimport cx from \"classnames\"\n\ntype LayoutStackPropsType =\n | (React.HTMLAttributes<HTMLDivElement> & {\n children: React.ReactNode\n isTable: never\n isPageHeader: never\n })\n | (React.HTMLAttributes<HTMLTableElement> & {\n children: React.ReactNode\n isPageHeader?: boolean\n isTable?: boolean\n })\n\ntype LayoutStackItemPropsType =\n | (React.HTMLAttributes<HTMLDivElement> & {\n children: React.ReactNode\n isTable: never\n isTableHeader: never\n })\n | (React.HTMLAttributes<HTMLTableRowElement> & {\n children: React.ReactNode\n isTable?: boolean\n isTableHeader?: boolean\n })\n\ntype LayoutStackLinkItemPropsType =\n React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n children: React.ReactNode\n }\n\nconst LayoutStackItem = ({\n children,\n isTable,\n className,\n isTableHeader: _isTableHeader,\n ...props\n}: LayoutStackItemPropsType) => {\n const Comp = isTable ? \"tr\" : \"div\"\n return (\n <Comp className={cx(\"cobalt-layout-stack__item\", className)} {...props}>\n {children}\n </Comp>\n )\n}\n\nconst LayoutStackLinkItem = ({\n children,\n className,\n ...hyperlinkProps\n}: LayoutStackLinkItemPropsType) => {\n return (\n <a\n className={cx(\"cobalt-layout-stack__item\", className)}\n {...hyperlinkProps}\n >\n {children}\n </a>\n )\n}\n\nconst isStackItem = (\n child: React.ReactNode\n): child is React.ReactElement<Omit<LayoutStackItemPropsType, \"children\">> => {\n return (\n isValidElement(child) &&\n (child.type === LayoutStackItem || child.type === LayoutStackLinkItem)\n )\n}\n\nconst LayoutStack = ({\n children,\n isTable,\n isPageHeader,\n className,\n ...props\n}: LayoutStackPropsType) => {\n const classNames = cx(\n \"cobalt-layout-stack\",\n {\n \"cobalt-layout--isPageHeader\": isPageHeader,\n },\n className\n )\n if (isTable) {\n const headerElements: React.ReactElement[] = []\n const bodyElements: React.ReactElement[] = []\n Children.map(children, (child) => {\n if (isStackItem(child)) {\n const newChild = cloneElement(child, { isTable: true, key: nanoid() })\n if (newChild.props.isTableHeader) {\n headerElements.push(newChild)\n } else {\n bodyElements.push(newChild)\n }\n }\n return child\n })\n return (\n <table className={classNames} {...props}>\n {!!headerElements.length && <thead>{headerElements}</thead>}\n <tbody>{bodyElements}</tbody>\n </table>\n )\n } else {\n return (\n <div className={classNames} {...props}>\n {children}\n </div>\n )\n }\n}\n\nLayoutStack.Item = LayoutStackItem\n\nLayoutStack.LinkItem = LayoutStackLinkItem\n\nexport default LayoutStack\n"],"names":[],"mappings":";;;;AAiCA,MAAM,eAAe,GAAG,CAAC,EACvB,QAAQ,EACR,OAAO,EACP,SAAS,EACT,aAAa,EAAE,cAAc,EAC7B,GAAG,KAAK,EACiB,KAAI;IAC7B,MAAM,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,KAAK,CAAA;AACnC,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,2BAA2B,EAAE,SAAS,CAAC,EAAM,GAAA,KAAK,IACnE,QAAQ,CACJ,EACR;AACH,CAAC,CAAA;AAED,MAAM,mBAAmB,GAAG,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,GAAG,cAAc,EACY,KAAI;AACjC,IAAA,QACE,KACE,CAAA,aAAA,CAAA,GAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,2BAA2B,EAAE,SAAS,CAAC,KACjD,cAAc,EAAA,EAEjB,QAAQ,CACP,EACL;AACH,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,CAClB,KAAsB,KACqD;AAC3E,IAAA,QACE,cAAc,CAAC,KAAK,CAAC;AACrB,SAAC,KAAK,CAAC,IAAI,KAAK,eAAe,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAmB,CAAC,EACvE;AACH,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,EACnB,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,EACT,GAAG,K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;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
|
|
4
|
+
const getDirectionClasses = (direction) => {
|
|
5
|
+
const directionClasses = [];
|
|
6
|
+
if (typeof direction === "string") {
|
|
7
|
+
directionClasses.push(`c-flex-${direction}`.replace("column", "col"));
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
for (const [key, value] of Object.entries(direction)) {
|
|
11
|
+
directionClasses.push(`${key}:c-flex-${value}`.replace("column", "col"));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return directionClasses;
|
|
15
|
+
};
|
|
16
|
+
const Flexible = ({ children, direction = "column", bottomPadding = false, }) => {
|
|
17
|
+
return (React.createElement("div", { className: cx("cobalt-layout-flexible", getDirectionClasses(direction), {
|
|
18
|
+
"cobalt-layout--bottomPadding": bottomPadding,
|
|
19
|
+
}) }, children));
|
|
20
|
+
};
|
|
21
|
+
const FlexibleWithConstraint = ({ children, size, direction = "column", bottomPadding = false, }) => {
|
|
22
|
+
return (React.createElement("div", { className: cx(`cobalt-layout-flexibleWithConstraint cobalt-layout-flexibleWithConstraint--${size}`, getDirectionClasses(direction), {
|
|
23
|
+
"cobalt-layout--bottomPadding": bottomPadding,
|
|
24
|
+
}) }, children));
|
|
25
|
+
};
|
|
26
|
+
const Fixed = ({ children, width, direction = "column", bottomPadding = false, }) => {
|
|
27
|
+
return (React.createElement("div", { className: cx(`cobalt-layout-fixed cobalt-layout-fixed--${width}`, getDirectionClasses(direction), {
|
|
28
|
+
"cobalt-layout--bottomPadding": bottomPadding,
|
|
29
|
+
}) }, children));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { Fixed, Flexible, FlexibleWithConstraint };
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Layout/Surfaces/index.tsx"],"sourcesContent":["import React, { type ReactNode } from \"react\"\nimport cx from \"classnames\"\nimport { breakpoints } from \"../../../tokens\"\n\nexport type ResponsiveProp<T> = {\n [key in keyof typeof breakpoints]?: T\n}\n\ntype DirectionProp = \"row\" | \"column\" | \"row-reverse\" | \"column-reverse\"\ntype ResponsiveDirection = ResponsiveProp<DirectionProp>\n\nconst getDirectionClasses = (\n direction: ResponsiveDirection | DirectionProp\n) => {\n const directionClasses: string[] = []\n if (typeof direction === \"string\") {\n directionClasses.push(`c-flex-${direction}`.replace(\"column\", \"col\"))\n } else {\n for (const [key, value] of Object.entries(direction)) {\n directionClasses.push(`${key}:c-flex-${value}`.replace(\"column\", \"col\"))\n }\n }\n return directionClasses\n}\n\nexport const Flexible = ({\n children,\n direction = \"column\",\n bottomPadding = false,\n}: {\n children?: ReactNode\n direction?: ResponsiveDirection | DirectionProp\n bottomPadding?: boolean\n}) => {\n return (\n <div\n className={cx(\"cobalt-layout-flexible\", getDirectionClasses(direction), {\n \"cobalt-layout--bottomPadding\": bottomPadding,\n })}\n >\n {children}\n </div>\n )\n}\n\nexport const FlexibleWithConstraint = ({\n children,\n size,\n direction = \"column\",\n bottomPadding = false,\n}: {\n children?: ReactNode\n size: \"small\" | \"medium\" | \"large\"\n direction?: ResponsiveDirection | DirectionProp\n bottomPadding?: boolean\n}) => {\n return (\n <div\n className={cx(\n `cobalt-layout-flexibleWithConstraint cobalt-layout-flexibleWithConstraint--${size}`,\n getDirectionClasses(direction),\n {\n \"cobalt-layout--bottomPadding\": bottomPadding,\n }\n )}\n >\n {children}\n </div>\n )\n}\n\nexport const Fixed = ({\n children,\n width,\n direction = \"column\",\n bottomPadding = false,\n}: {\n children?: ReactNode\n width: 280 | 420 | 600\n direction?: ResponsiveDirection | DirectionProp\n bottomPadding?: boolean\n}) => {\n return (\n <div\n className={cx(\n `cobalt-layout-fixed cobalt-layout-fixed--${width}`,\n getDirectionClasses(direction),\n {\n \"cobalt-layout--bottomPadding\": bottomPadding,\n }\n )}\n >\n {children}\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aAAa;AAC9C,SAAA,CACF,EAEA,EAAA,QAAQ,CACL,EACP;AACH,EAAC;AAEY,MAAA,KAAK,GAAG,CAAC,EACpB,QAAQ,EACR,KAAK,EACL,SAAS,GAAG,QAAQ,EACpB,aAAa,GAAG,KAAK,GAMtB,KAAI;AACH,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,EAAE,CACX,CAAA,yCAAA,EAA4C,KAAK,CAAA,CAAE,EACnD,mBAAmB,CAAC,SAAS,CAAC,EAC9B;AACE,YAAA,8BAA8B,EAAE,aAAa;AAC9C,SAAA,CACF,EAEA,EAAA,QAAQ,CACL,EACP;AACH;;;;"}
|
package/index.js
CHANGED
|
@@ -51,6 +51,7 @@ export { default as LayoutSection } from './components/Layout/Components/LayoutS
|
|
|
51
51
|
export { default as LayoutSectionTitle } from './components/Layout/Components/LayoutSectionTitle.js';
|
|
52
52
|
export { default as LayoutCard } from './components/Layout/Components/LayoutCard.js';
|
|
53
53
|
export { default as LayoutStack } from './components/Layout/Components/LayoutStack.js';
|
|
54
|
+
export { Fixed, Flexible, FlexibleWithConstraint } from './components/Layout/Surfaces/index.js';
|
|
54
55
|
export { default as useBreakpoint } from './hooks/useBreakpoint.js';
|
|
55
56
|
export { getMonthDaysByWeeks, getWeekDays } from './components/Calendar/utils.js';
|
|
56
57
|
export { default as AccountDetailsIcon } from './components/Icon/__generated__/AccountDetailsIcon.js';
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drivy/cobalt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.1",
|
|
4
4
|
"description": "Opinionated design system for Drivy's projects.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "types/src/index.d.ts",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@storybook/react": "7.6.20",
|
|
60
60
|
"@storybook/react-webpack5": "7.6.20",
|
|
61
61
|
"@svgr/cli": "7.0.0",
|
|
62
|
-
"@testing-library/jest-dom": "6.4.
|
|
62
|
+
"@testing-library/jest-dom": "6.4.6",
|
|
63
63
|
"@testing-library/react": "14.3.1",
|
|
64
64
|
"@testing-library/react-hooks": "8.0.1",
|
|
65
65
|
"@types/fs-extra": "11.0.4",
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"jest": "29.7.0",
|
|
81
81
|
"jest-environment-jsdom": "29.7.0",
|
|
82
82
|
"nested-object-access": "^0.2.5",
|
|
83
|
-
"np": "10.0.
|
|
83
|
+
"np": "10.0.7",
|
|
84
84
|
"postcss-flexbugs-fixes": "5.0.2",
|
|
85
85
|
"postcss-loader": "7.3.4",
|
|
86
|
-
"prettier": "3.3.
|
|
86
|
+
"prettier": "3.3.3",
|
|
87
87
|
"raw-loader": "4.0.2",
|
|
88
88
|
"react": "18.3.1",
|
|
89
89
|
"react-dom": "18.3.1",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"rollup-plugin-postcss": "4.0.2",
|
|
98
98
|
"rollup-plugin-svgo": "2.0.0",
|
|
99
99
|
"rollup-plugin-typescript2": "0.36.0",
|
|
100
|
-
"sass": "1.77.
|
|
100
|
+
"sass": "1.77.8",
|
|
101
101
|
"sass-loader": "13.3.3",
|
|
102
102
|
"sharp": "0.33.4",
|
|
103
103
|
"sharp-cli": "4.2.0",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"svg2vectordrawable": "2.9.1",
|
|
108
108
|
"svgo": "3.3.2",
|
|
109
109
|
"ts-jest": "29.2.2",
|
|
110
|
-
"tsx": "4.
|
|
110
|
+
"tsx": "4.16.2",
|
|
111
111
|
"typescript": "5.4.5"
|
|
112
112
|
},
|
|
113
113
|
"keywords": [
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
type
|
|
2
|
+
type LayoutStackPropsType = (React.HTMLAttributes<HTMLDivElement> & {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
isTable: never;
|
|
5
5
|
isPageHeader: never;
|
|
6
|
-
}) | (React.HTMLAttributes<
|
|
6
|
+
}) | (React.HTMLAttributes<HTMLTableElement> & {
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
isPageHeader?: boolean;
|
|
9
9
|
isTable?: boolean;
|
|
10
10
|
});
|
|
11
|
+
type LayoutStackItemPropsType = (React.HTMLAttributes<HTMLDivElement> & {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
isTable: never;
|
|
14
|
+
isTableHeader: never;
|
|
15
|
+
}) | (React.HTMLAttributes<HTMLTableRowElement> & {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
isTable?: boolean;
|
|
18
|
+
isTableHeader?: boolean;
|
|
19
|
+
});
|
|
11
20
|
type LayoutStackLinkItemPropsType = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
12
21
|
children: React.ReactNode;
|
|
13
|
-
isPageHeader?: boolean;
|
|
14
22
|
};
|
|
15
23
|
declare const LayoutStack: {
|
|
16
|
-
({ children, isTable, isPageHeader, }:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
isPageHeader?: boolean;
|
|
20
|
-
}): React.JSX.Element;
|
|
21
|
-
Item: ({ children, isTable, ...props }: LayoutStackItemPropsType) => React.JSX.Element;
|
|
22
|
-
LinkItem: ({ children, ...hyperlinkProps }: LayoutStackLinkItemPropsType) => React.JSX.Element;
|
|
24
|
+
({ children, isTable, isPageHeader, className, ...props }: LayoutStackPropsType): React.JSX.Element;
|
|
25
|
+
Item: ({ children, isTable, className, isTableHeader: _isTableHeader, ...props }: LayoutStackItemPropsType) => React.JSX.Element;
|
|
26
|
+
LinkItem: ({ children, className, ...hyperlinkProps }: LayoutStackLinkItemPropsType) => React.JSX.Element;
|
|
23
27
|
};
|
|
24
28
|
export default LayoutStack;
|
package/types/src/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export { default as Popover } from "./components/Popover";
|
|
|
49
49
|
export { default as HorizontalList, HorizontalListPaddingBlock, } from "./components/HorizontalList";
|
|
50
50
|
/** Layouts */
|
|
51
51
|
export * from "./components/Layout/Components";
|
|
52
|
+
export * from "./components/Layout/Surfaces";
|
|
52
53
|
/** HOOKS */
|
|
53
54
|
export { default as useBreakpoint } from "./hooks/useBreakpoint";
|
|
54
55
|
/** utils **/
|