@veeqo/ui 11.1.0 → 11.3.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/components/Alerts/Alert/Alert.cjs +22 -27
- package/dist/components/Alerts/Alert/Alert.cjs.map +1 -1
- package/dist/components/Alerts/Alert/Alert.js +22 -27
- package/dist/components/Alerts/Alert/Alert.js.map +1 -1
- package/dist/components/Alerts/Alert/Alert.module.scss.cjs +9 -0
- package/dist/components/Alerts/Alert/Alert.module.scss.cjs.map +1 -0
- package/dist/components/Alerts/Alert/Alert.module.scss.js +7 -0
- package/dist/components/Alerts/Alert/Alert.module.scss.js.map +1 -0
- package/dist/components/Alerts/Alerts.module.scss.cjs +9 -0
- package/dist/components/Alerts/Alerts.module.scss.cjs.map +1 -0
- package/dist/components/Alerts/Alerts.module.scss.js +7 -0
- package/dist/components/Alerts/Alerts.module.scss.js.map +1 -0
- package/dist/components/Alerts/MiniAlert/MiniAlert.cjs +13 -8
- package/dist/components/Alerts/MiniAlert/MiniAlert.cjs.map +1 -1
- package/dist/components/Alerts/MiniAlert/MiniAlert.js +14 -9
- package/dist/components/Alerts/MiniAlert/MiniAlert.js.map +1 -1
- package/dist/components/Alerts/MiniAlert/MiniAlert.module.scss.cjs +9 -0
- package/dist/components/Alerts/MiniAlert/MiniAlert.module.scss.cjs.map +1 -0
- package/dist/components/Alerts/MiniAlert/MiniAlert.module.scss.js +7 -0
- package/dist/components/Alerts/MiniAlert/MiniAlert.module.scss.js.map +1 -0
- package/dist/components/Alerts/constants.cjs +8 -36
- package/dist/components/Alerts/constants.cjs.map +1 -1
- package/dist/components/Alerts/constants.d.ts +1 -2
- package/dist/components/Alerts/constants.js +9 -36
- package/dist/components/Alerts/constants.js.map +1 -1
- package/dist/components/Alerts/types.d.ts +1 -1
- package/dist/components/DataGrid/DataGrid.cjs +17 -3
- package/dist/components/DataGrid/DataGrid.cjs.map +1 -1
- package/dist/components/DataGrid/DataGrid.d.ts +1 -1
- package/dist/components/DataGrid/DataGrid.js +17 -3
- package/dist/components/DataGrid/DataGrid.js.map +1 -1
- package/dist/components/DataGrid/components/Body/Body.cjs +1 -1
- package/dist/components/DataGrid/components/Body/Body.cjs.map +1 -1
- package/dist/components/DataGrid/components/Body/Body.js +1 -1
- package/dist/components/DataGrid/components/Body/Body.js.map +1 -1
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.cjs +34 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.cjs.map +1 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.d.ts +24 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.js +28 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.js.map +1 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.module.scss.cjs +9 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.module.scss.cjs.map +1 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.module.scss.js +7 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.module.scss.js.map +1 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/index.d.ts +1 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBody.cjs +21 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBody.cjs.map +1 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBody.d.ts +21 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBody.js +15 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBody.js.map +1 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.cjs +46 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.cjs.map +1 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.d.ts +13 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.js +40 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.js.map +1 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/index.d.ts +1 -0
- package/dist/components/DataGrid/components/Body/Row/Row.cjs.map +1 -1
- package/dist/components/DataGrid/components/Body/Row/Row.d.ts +6 -3
- package/dist/components/DataGrid/components/Body/Row/Row.js.map +1 -1
- package/dist/components/DataGrid/components/Body/index.d.ts +2 -0
- package/dist/components/DataGrid/components/Footer/Footer.cjs +1 -1
- package/dist/components/DataGrid/components/Footer/Footer.cjs.map +1 -1
- package/dist/components/DataGrid/components/Footer/Footer.js +1 -1
- package/dist/components/DataGrid/components/Footer/Footer.js.map +1 -1
- package/dist/components/DataGrid/types/DataGridProps.d.ts +21 -0
- package/dist/components/DataGrid/types/EmptyState.d.ts +6 -0
- package/dist/components/DataGrid/types/index.d.ts +1 -0
- package/dist/components/Skeleton/Skeleton.cjs +7 -12
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +4 -4
- package/dist/components/Skeleton/Skeleton.js +6 -11
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.module.scss.cjs +9 -0
- package/dist/components/Skeleton/Skeleton.module.scss.cjs.map +1 -0
- package/dist/components/Skeleton/Skeleton.module.scss.js +7 -0
- package/dist/components/Skeleton/Skeleton.module.scss.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/assignCssVars.cjs +26 -0
- package/dist/utils/assignCssVars.cjs.map +1 -0
- package/dist/utils/assignCssVars.d.ts +13 -0
- package/dist/utils/assignCssVars.js +24 -0
- package/dist/utils/assignCssVars.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/Alerts/Alert/constants.cjs +0 -18
- package/dist/components/Alerts/Alert/constants.cjs.map +0 -1
- package/dist/components/Alerts/Alert/constants.d.ts +0 -3
- package/dist/components/Alerts/Alert/constants.js +0 -15
- package/dist/components/Alerts/Alert/constants.js.map +0 -1
- package/dist/components/Alerts/Alert/styled.cjs +0 -20
- package/dist/components/Alerts/Alert/styled.cjs.map +0 -1
- package/dist/components/Alerts/Alert/styled.d.ts +0 -4
- package/dist/components/Alerts/Alert/styled.js +0 -14
- package/dist/components/Alerts/Alert/styled.js.map +0 -1
- package/dist/components/Alerts/MiniAlert/constants.cjs +0 -22
- package/dist/components/Alerts/MiniAlert/constants.cjs.map +0 -1
- package/dist/components/Alerts/MiniAlert/constants.d.ts +0 -8
- package/dist/components/Alerts/MiniAlert/constants.js +0 -19
- package/dist/components/Alerts/MiniAlert/constants.js.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { Skeleton } from '../../../../Skeleton/Skeleton.js';
|
|
3
|
+
import { buildClassnames } from '../../../../../utils/buildClassnames.js';
|
|
4
|
+
import 'uid/secure';
|
|
5
|
+
import { usePinnedColumnStyles } from '../../../hooks/usePinnedColumnStyles.js';
|
|
6
|
+
import '@tanstack/react-table';
|
|
7
|
+
import '../../../../Stack/Stack.js';
|
|
8
|
+
import '../../../../Stack/types.js';
|
|
9
|
+
import { theme } from '../../../../../theme/index.js';
|
|
10
|
+
import '../../../../Choice/components/styled.js';
|
|
11
|
+
import '../../../../Text/Text.js';
|
|
12
|
+
import '../../../../Checkbox/styled.js';
|
|
13
|
+
import '../../../../Radio/Radio.js';
|
|
14
|
+
import { CellContent } from '../../CellContent/CellContent.js';
|
|
15
|
+
import styles from '../BodyCell/BodyCell.module.scss.js';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A cell component for the DataGrid that displays a skeleton loader.
|
|
19
|
+
*/
|
|
20
|
+
const LoadingBodyCell = ({ column }) => {
|
|
21
|
+
const { justifyContent, textAlign } = column.columnDef.meta;
|
|
22
|
+
const { pinnedCellClassName, pinnedCellStyles } = usePinnedColumnStyles({
|
|
23
|
+
column,
|
|
24
|
+
});
|
|
25
|
+
const loadingCellClassname = buildClassnames([
|
|
26
|
+
styles.bodyCell,
|
|
27
|
+
pinnedCellClassName,
|
|
28
|
+
'data-grid-cell',
|
|
29
|
+
'data-grid-cell-loading',
|
|
30
|
+
]);
|
|
31
|
+
return (React__default.createElement("td", { className: loadingCellClassname, style: pinnedCellStyles, "aria-colindex": column.getIndex() + 1 },
|
|
32
|
+
React__default.createElement(CellContent, { contentStyle: {
|
|
33
|
+
justifyContent,
|
|
34
|
+
textAlign,
|
|
35
|
+
} },
|
|
36
|
+
React__default.createElement(Skeleton, { width: "75%", height: theme.sizes[3] }))));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { LoadingBodyCell };
|
|
40
|
+
//# sourceMappingURL=LoadingBodyCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingBodyCell.js","sources":["../../../../../../src/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.tsx"],"sourcesContent":["import React from 'react';\nimport { Column } from '@tanstack/react-table';\n\nimport { Skeleton } from '../../../../Skeleton';\nimport { buildClassnames } from '../../../../../utils';\nimport { usePinnedColumnStyles } from '../../../hooks';\nimport { CellContent } from '../../CellContent';\nimport { theme } from '../../../../../theme';\n\nimport styles from '../BodyCell/BodyCell.module.scss';\n\ntype LoadingBodyCellProps = {\n /**\n * The TanStack Table column instance.\n */\n column: Column<any, any>;\n};\n\n/**\n * A cell component for the DataGrid that displays a skeleton loader.\n */\nexport const LoadingBodyCell = ({ column }: LoadingBodyCellProps) => {\n const { justifyContent, textAlign } = column.columnDef.meta!;\n const { pinnedCellClassName, pinnedCellStyles } = usePinnedColumnStyles({\n column,\n });\n\n const loadingCellClassname = buildClassnames([\n styles.bodyCell,\n pinnedCellClassName,\n 'data-grid-cell',\n 'data-grid-cell-loading',\n ]);\n\n return (\n <td\n className={loadingCellClassname}\n style={pinnedCellStyles}\n aria-colindex={column.getIndex() + 1}\n >\n <CellContent\n contentStyle={\n {\n justifyContent,\n textAlign,\n } as React.CSSProperties\n }\n >\n <Skeleton width=\"75%\" height={theme.sizes[3]} />\n </CellContent>\n </td>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;AAkBA;;AAEG;MACU,eAAe,GAAG,CAAC,EAAE,MAAM,EAAwB,KAAI;IAClE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC,IAAK;AAC5D,IAAA,MAAM,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,GAAG,qBAAqB,CAAC;QACtE,MAAM;AACP,KAAA,CAAC;IAEF,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAC3C,QAAA,MAAM,CAAC,QAAQ;QACf,mBAAmB;QACnB,gBAAgB;QAChB,wBAAwB;AACzB,KAAA,CAAC;AAEF,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EACE,SAAS,EAAE,oBAAoB,EAC/B,KAAK,EAAE,gBAAgB,mBACR,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAA;QAEpCA,cAAC,CAAA,aAAA,CAAA,WAAW,EACV,EAAA,YAAY,EACV;gBACE,cAAc;gBACd,SAAS;AACa,aAAA,EAAA;AAG1B,YAAAA,cAAA,CAAA,aAAA,CAAC,QAAQ,EAAC,EAAA,KAAK,EAAC,KAAK,EAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAI,CACpC,CACX;AAET;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LoadingBody } from './LoadingBody';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.cjs","sources":["../../../../../../src/components/DataGrid/components/Body/Row/Row.tsx"],"sourcesContent":["import React from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"Row.cjs","sources":["../../../../../../src/components/DataGrid/components/Body/Row/Row.tsx"],"sourcesContent":["import React from 'react';\n\nimport { buildClassnames } from '../../../../../utils';\n\ntype RowProps = {\n /**\n * Row information, including id, index, and depth (typically the TanStack table row).\n */\n row: {\n id: string;\n index: number;\n depth: number;\n };\n\n /**\n * Whether rows should be striped or not.\n */\n striped: boolean;\n\n /**\n * Whether row expanding is enabled.\n */\n enableExpanding: boolean;\n\n /**\n * Child elements (table cells).\n */\n children: React.ReactNode;\n};\n\nexport const Row = ({ row, striped, enableExpanding, children }: RowProps) => (\n <tr\n className={buildClassnames(['data-grid-row', striped ? 'striped' : undefined])}\n key={row.id}\n // 0-based index + header row.\n aria-rowindex={row.index + 2}\n aria-level={enableExpanding ? row.depth + 1 : undefined}\n >\n {children}\n </tr>\n);\n"],"names":["React","buildClassnames"],"mappings":";;;;;;;;;;AA8BO,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAY,MACvEA,sBAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EACE,SAAS,EAAEC,+BAAe,CAAC,CAAC,eAAe,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC,EAC9E,GAAG,EAAE,GAAG,CAAC,EAAE,EAAA,eAAA,EAEI,GAAG,CAAC,KAAK,GAAG,CAAC,EAChB,YAAA,EAAA,eAAe,GAAG,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,SAAS,EAAA,EAEtD,QAAQ,CACN;;;;"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Row as RowItem } from '@tanstack/react-table';
|
|
3
2
|
type RowProps = {
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* Row information, including id, index, and depth (typically the TanStack table row).
|
|
6
5
|
*/
|
|
7
|
-
row:
|
|
6
|
+
row: {
|
|
7
|
+
id: string;
|
|
8
|
+
index: number;
|
|
9
|
+
depth: number;
|
|
10
|
+
};
|
|
8
11
|
/**
|
|
9
12
|
* Whether rows should be striped or not.
|
|
10
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.js","sources":["../../../../../../src/components/DataGrid/components/Body/Row/Row.tsx"],"sourcesContent":["import React from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"Row.js","sources":["../../../../../../src/components/DataGrid/components/Body/Row/Row.tsx"],"sourcesContent":["import React from 'react';\n\nimport { buildClassnames } from '../../../../../utils';\n\ntype RowProps = {\n /**\n * Row information, including id, index, and depth (typically the TanStack table row).\n */\n row: {\n id: string;\n index: number;\n depth: number;\n };\n\n /**\n * Whether rows should be striped or not.\n */\n striped: boolean;\n\n /**\n * Whether row expanding is enabled.\n */\n enableExpanding: boolean;\n\n /**\n * Child elements (table cells).\n */\n children: React.ReactNode;\n};\n\nexport const Row = ({ row, striped, enableExpanding, children }: RowProps) => (\n <tr\n className={buildClassnames(['data-grid-row', striped ? 'striped' : undefined])}\n key={row.id}\n // 0-based index + header row.\n aria-rowindex={row.index + 2}\n aria-level={enableExpanding ? row.depth + 1 : undefined}\n >\n {children}\n </tr>\n);\n"],"names":["React"],"mappings":";;;;AA8BO,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAY,MACvEA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EACE,SAAS,EAAE,eAAe,CAAC,CAAC,eAAe,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC,EAC9E,GAAG,EAAE,GAAG,CAAC,EAAE,EAAA,eAAA,EAEI,GAAG,CAAC,KAAK,GAAG,CAAC,EAChB,YAAA,EAAA,eAAe,GAAG,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,SAAS,EAAA,EAEtD,QAAQ,CACN;;;;"}
|
|
@@ -11,7 +11,7 @@ const Footer = ({ table, ariaRoles }) => {
|
|
|
11
11
|
// We're not making use of column grouping, so we only need the first footer group.
|
|
12
12
|
const [footer] = table.getFooterGroups();
|
|
13
13
|
return (React__default.default.createElement("tfoot", { className: "data-grid-footer" },
|
|
14
|
-
React__default.default.createElement("tr", { className: "data-grid-footer-row" }, footer.headers.map((header) => (React__default.default.createElement(FooterCell.FooterCell, { key: header.id, ariaRoles: ariaRoles, header: header }))))));
|
|
14
|
+
React__default.default.createElement("tr", { className: "data-grid-footer-row", "aria-rowindex": table.getRowCount() + 1 }, footer.headers.map((header) => (React__default.default.createElement(FooterCell.FooterCell, { key: header.id, ariaRoles: ariaRoles, header: header }))))));
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
exports.Footer = Footer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.cjs","sources":["../../../../../src/components/DataGrid/components/Footer/Footer.tsx"],"sourcesContent":["import React from 'react';\nimport { Table } from '@tanstack/react-table';\n\nimport { AriaRoles } from '../../types';\nimport { FooterCell } from './FooterCell';\n\ntype FooterProps = {\n /**\n * The TanStack table instance.\n */\n table: Table<any>;\n\n /**\n * ARIA roles used in the grid.\n */\n ariaRoles: AriaRoles;\n};\n\nexport const Footer = ({ table, ariaRoles }: FooterProps) => {\n // We're not making use of column grouping, so we only need the first footer group.\n const [footer] = table.getFooterGroups();\n\n return (\n <tfoot className=\"data-grid-footer\">\n <tr className=\"data-grid-footer-row\">\n {footer.headers.map((header) => (\n <FooterCell key={header.id} ariaRoles={ariaRoles} header={header} />\n ))}\n </tr>\n </tfoot>\n );\n};\n"],"names":["React","FooterCell"],"mappings":";;;;;;;;;AAkBa,MAAA,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,EAAe,KAAI;;IAE1D,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,eAAe,EAAE;AAExC,IAAA,QACEA,sBAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAO,SAAS,EAAC,kBAAkB,EAAA;
|
|
1
|
+
{"version":3,"file":"Footer.cjs","sources":["../../../../../src/components/DataGrid/components/Footer/Footer.tsx"],"sourcesContent":["import React from 'react';\nimport { Table } from '@tanstack/react-table';\n\nimport { AriaRoles } from '../../types';\nimport { FooterCell } from './FooterCell';\n\ntype FooterProps = {\n /**\n * The TanStack table instance.\n */\n table: Table<any>;\n\n /**\n * ARIA roles used in the grid.\n */\n ariaRoles: AriaRoles;\n};\n\nexport const Footer = ({ table, ariaRoles }: FooterProps) => {\n // We're not making use of column grouping, so we only need the first footer group.\n const [footer] = table.getFooterGroups();\n\n return (\n <tfoot className=\"data-grid-footer\">\n <tr className=\"data-grid-footer-row\" aria-rowindex={table.getRowCount() + 1}>\n {footer.headers.map((header) => (\n <FooterCell key={header.id} ariaRoles={ariaRoles} header={header} />\n ))}\n </tr>\n </tfoot>\n );\n};\n"],"names":["React","FooterCell"],"mappings":";;;;;;;;;AAkBa,MAAA,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,EAAe,KAAI;;IAE1D,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,eAAe,EAAE;AAExC,IAAA,QACEA,sBAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAO,SAAS,EAAC,kBAAkB,EAAA;QACjCA,sBAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,SAAS,EAAC,sBAAsB,EAAA,eAAA,EAAgB,KAAK,CAAC,WAAW,EAAE,GAAG,CAAC,IACxE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MACzBA,sBAAC,CAAA,aAAA,CAAAC,qBAAU,IAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAA,CAAI,CACrE,CAAC,CACC,CACC;AAEZ;;;;"}
|
|
@@ -5,7 +5,7 @@ const Footer = ({ table, ariaRoles }) => {
|
|
|
5
5
|
// We're not making use of column grouping, so we only need the first footer group.
|
|
6
6
|
const [footer] = table.getFooterGroups();
|
|
7
7
|
return (React__default.createElement("tfoot", { className: "data-grid-footer" },
|
|
8
|
-
React__default.createElement("tr", { className: "data-grid-footer-row" }, footer.headers.map((header) => (React__default.createElement(FooterCell, { key: header.id, ariaRoles: ariaRoles, header: header }))))));
|
|
8
|
+
React__default.createElement("tr", { className: "data-grid-footer-row", "aria-rowindex": table.getRowCount() + 1 }, footer.headers.map((header) => (React__default.createElement(FooterCell, { key: header.id, ariaRoles: ariaRoles, header: header }))))));
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { Footer };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.js","sources":["../../../../../src/components/DataGrid/components/Footer/Footer.tsx"],"sourcesContent":["import React from 'react';\nimport { Table } from '@tanstack/react-table';\n\nimport { AriaRoles } from '../../types';\nimport { FooterCell } from './FooterCell';\n\ntype FooterProps = {\n /**\n * The TanStack table instance.\n */\n table: Table<any>;\n\n /**\n * ARIA roles used in the grid.\n */\n ariaRoles: AriaRoles;\n};\n\nexport const Footer = ({ table, ariaRoles }: FooterProps) => {\n // We're not making use of column grouping, so we only need the first footer group.\n const [footer] = table.getFooterGroups();\n\n return (\n <tfoot className=\"data-grid-footer\">\n <tr className=\"data-grid-footer-row\">\n {footer.headers.map((header) => (\n <FooterCell key={header.id} ariaRoles={ariaRoles} header={header} />\n ))}\n </tr>\n </tfoot>\n );\n};\n"],"names":["React"],"mappings":";;;AAkBa,MAAA,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,EAAe,KAAI;;IAE1D,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,eAAe,EAAE;AAExC,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAO,SAAS,EAAC,kBAAkB,EAAA;
|
|
1
|
+
{"version":3,"file":"Footer.js","sources":["../../../../../src/components/DataGrid/components/Footer/Footer.tsx"],"sourcesContent":["import React from 'react';\nimport { Table } from '@tanstack/react-table';\n\nimport { AriaRoles } from '../../types';\nimport { FooterCell } from './FooterCell';\n\ntype FooterProps = {\n /**\n * The TanStack table instance.\n */\n table: Table<any>;\n\n /**\n * ARIA roles used in the grid.\n */\n ariaRoles: AriaRoles;\n};\n\nexport const Footer = ({ table, ariaRoles }: FooterProps) => {\n // We're not making use of column grouping, so we only need the first footer group.\n const [footer] = table.getFooterGroups();\n\n return (\n <tfoot className=\"data-grid-footer\">\n <tr className=\"data-grid-footer-row\" aria-rowindex={table.getRowCount() + 1}>\n {footer.headers.map((header) => (\n <FooterCell key={header.id} ariaRoles={ariaRoles} header={header} />\n ))}\n </tr>\n </tfoot>\n );\n};\n"],"names":["React"],"mappings":";;;AAkBa,MAAA,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,EAAe,KAAI;;IAE1D,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,eAAe,EAAE;AAExC,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAO,SAAS,EAAC,kBAAkB,EAAA;QACjCA,cAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,SAAS,EAAC,sBAAsB,EAAA,eAAA,EAAgB,KAAK,CAAC,WAAW,EAAE,GAAG,CAAC,IACxE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MACzBA,cAAC,CAAA,aAAA,CAAA,UAAU,IAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAA,CAAI,CACrE,CAAC,CACC,CACC;AAEZ;;;;"}
|
|
@@ -6,6 +6,7 @@ import { SortState } from './SortState';
|
|
|
6
6
|
import { PinnedColumnState } from './PinnedColumnState';
|
|
7
7
|
import { RowGroupingConfiguration } from './RowGroupingConfiguration';
|
|
8
8
|
import { ColumnWidths } from './ColumnWidths';
|
|
9
|
+
import { EmptyState } from './EmptyState';
|
|
9
10
|
export type CustomState = {
|
|
10
11
|
iconSlot: ReactElement;
|
|
11
12
|
heading: string;
|
|
@@ -120,4 +121,24 @@ export type DataGridProps = Pick<AriaAttributes, 'aria-label'> & {
|
|
|
120
121
|
* Callback which is raised when the column widths change.
|
|
121
122
|
*/
|
|
122
123
|
onColumnsResized?: (columnWidths: ColumnWidths) => void;
|
|
124
|
+
/** Empty/Loading State */
|
|
125
|
+
/**
|
|
126
|
+
* Show the loading state.
|
|
127
|
+
*/
|
|
128
|
+
isLoading?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Number of rows to be rendered in the loading state.
|
|
131
|
+
* @default 5
|
|
132
|
+
*/
|
|
133
|
+
loadingRowCount?: number;
|
|
134
|
+
/**
|
|
135
|
+
* Settings for the empty state, rendered when there are no rows.
|
|
136
|
+
*
|
|
137
|
+
* If none is provided, a default empty state will be displayed.
|
|
138
|
+
*/
|
|
139
|
+
emptyState?: EmptyState;
|
|
140
|
+
/**
|
|
141
|
+
* Optional slot for custom content in the empty body, overrides empty state.
|
|
142
|
+
*/
|
|
143
|
+
emptySlot?: React.ReactElement;
|
|
123
144
|
};
|
|
@@ -5,3 +5,4 @@ export { ColumnDefinition } from './ColumnDefinition';
|
|
|
5
5
|
export { SortState } from './SortState';
|
|
6
6
|
export { PinnedColumnState } from './PinnedColumnState';
|
|
7
7
|
export { RowGroupingConfiguration, ExpandedRows } from './RowGroupingConfiguration';
|
|
8
|
+
export { EmptyState } from './EmptyState';
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var assignCssVars = require('../../utils/assignCssVars.cjs');
|
|
5
|
+
var Skeleton_module = require('./Skeleton.module.scss.cjs');
|
|
5
6
|
|
|
6
7
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
7
8
|
|
|
8
|
-
var
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
9
10
|
|
|
10
|
-
const Skeleton =
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
width: ${width || '100%'};
|
|
14
|
-
min-width: ${width};
|
|
15
|
-
height: ${height || '20px'};
|
|
16
|
-
min-height: ${height};
|
|
17
|
-
`};@media (prefers-reduced-motion: no-preference){animation-duration:2s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:placeHolderShimmer;animation-timing-function:linear;}@keyframes placeHolderShimmer{0%{background-position:-1080px 0;}100%{background-position:1080px 0;}}`;
|
|
18
|
-
Skeleton.displayName = 'Skeleton';
|
|
11
|
+
const Skeleton = ({ width, height }) => {
|
|
12
|
+
return (React__default.default.createElement("div", { "aria-hidden": "true", style: assignCssVars.assignCssVars({ width, height }), className: Skeleton_module.skeleton }));
|
|
13
|
+
};
|
|
19
14
|
|
|
20
15
|
exports.Skeleton = Skeleton;
|
|
21
16
|
//# sourceMappingURL=Skeleton.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.cjs","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Skeleton.cjs","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["import React from 'react';\n\nimport { assignCssVars } from '../../utils/assignCssVars';\n\nimport styles from './Skeleton.module.scss';\n\ntype SkeletonProps = {\n width?: string;\n height?: string;\n};\n\nexport const Skeleton = ({ width, height }: SkeletonProps) => {\n return (\n <div aria-hidden=\"true\" style={assignCssVars({ width, height })} className={styles.skeleton} />\n );\n};\n"],"names":["React","assignCssVars","styles"],"mappings":";;;;;;;;;;AAWa,MAAA,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAiB,KAAI;IAC3D,QACEA,6DAAiB,MAAM,EAAC,KAAK,EAAEC,2BAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAEC,eAAM,CAAC,QAAQ,EAAI,CAAA;AAEnG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type SkeletonProps = {
|
|
2
3
|
width?: string;
|
|
3
4
|
height?: string;
|
|
4
5
|
};
|
|
5
|
-
export declare const Skeleton:
|
|
6
|
-
|
|
7
|
-
} & SkeletonProps, "aria-hidden">;
|
|
6
|
+
export declare const Skeleton: ({ width, height }: SkeletonProps) => React.JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { assignCssVars } from '../../utils/assignCssVars.js';
|
|
3
|
+
import styles from './Skeleton.module.scss.js';
|
|
3
4
|
|
|
4
|
-
const Skeleton =
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
width: ${width || '100%'};
|
|
8
|
-
min-width: ${width};
|
|
9
|
-
height: ${height || '20px'};
|
|
10
|
-
min-height: ${height};
|
|
11
|
-
`};@media (prefers-reduced-motion: no-preference){animation-duration:2s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:placeHolderShimmer;animation-timing-function:linear;}@keyframes placeHolderShimmer{0%{background-position:-1080px 0;}100%{background-position:1080px 0;}}`;
|
|
12
|
-
Skeleton.displayName = 'Skeleton';
|
|
5
|
+
const Skeleton = ({ width, height }) => {
|
|
6
|
+
return (React__default.createElement("div", { "aria-hidden": "true", style: assignCssVars({ width, height }), className: styles.skeleton }));
|
|
7
|
+
};
|
|
13
8
|
|
|
14
9
|
export { Skeleton };
|
|
15
10
|
//# sourceMappingURL=Skeleton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.js","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Skeleton.js","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["import React from 'react';\n\nimport { assignCssVars } from '../../utils/assignCssVars';\n\nimport styles from './Skeleton.module.scss';\n\ntype SkeletonProps = {\n width?: string;\n height?: string;\n};\n\nexport const Skeleton = ({ width, height }: SkeletonProps) => {\n return (\n <div aria-hidden=\"true\" style={assignCssVars({ width, height })} className={styles.skeleton} />\n );\n};\n"],"names":["React"],"mappings":";;;;AAWa,MAAA,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAiB,KAAI;IAC3D,QACEA,qDAAiB,MAAM,EAAC,KAAK,EAAE,aAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAI,CAAA;AAEnG;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
|
|
4
|
+
|
|
5
|
+
___$insertStyle("._skeleton_1w7c5_1 {\n box-sizing: border-box;\n position: relative;\n margin: var(--sizes-none);\n padding: var(--sizes-none);\n display: block;\n background: #f6f7f8;\n background: linear-gradient(to right, #eeeeee 8%, #dddddd 18%, #eeeeee 33%);\n background-size: 2500px 104px;\n cursor: progress;\n border-radius: var(--sizes-1);\n width: var(--width, \"100%\");\n min-width: var(--width, \"100%\");\n height: var(--height, \"20px\");\n min-height: var(--height, \"20px\");\n}\n@keyframes _placeHolderShimmer_1w7c5_1 {\n 0% {\n background-position: -1080px 0;\n }\n 100% {\n background-position: 1080px 0;\n }\n}\n@media (prefers-reduced-motion: no-preference) {\n ._skeleton_1w7c5_1 {\n animation-duration: 2s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: _placeHolderShimmer_1w7c5_1;\n animation-timing-function: linear;\n }\n}");
|
|
6
|
+
var styles = {"skeleton":"_skeleton_1w7c5_1","placeHolderShimmer":"_placeHolderShimmer_1w7c5_1"};
|
|
7
|
+
|
|
8
|
+
module.exports = styles;
|
|
9
|
+
//# sourceMappingURL=Skeleton.module.scss.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.module.scss.cjs","sources":["../../../src/components/Skeleton/Skeleton.module.scss"],"sourcesContent":[".skeleton {\n box-sizing: border-box;\n position: relative;\n margin: var(--sizes-none);\n padding: var(--sizes-none);\n\n // General\n display: block;\n background: #f6f7f8;\n background: linear-gradient(to right, #eeeeee 8%, #dddddd 18%, #eeeeee 33%);\n background-size: 2500px 104px;\n\n cursor: progress;\n\n // Sizing\n border-radius: var(--sizes-1);\n\n width: var(--width, '100%');\n min-width: var(--width, '100%');\n\n height: var(--height, '20px');\n min-height: var(--height, '20px');\n\n // Animation\n @keyframes placeHolderShimmer {\n 0% {\n background-position: -1080px 0;\n }\n 100% {\n background-position: 1080px 0;\n }\n }\n\n @media (prefers-reduced-motion: no-preference) {\n animation-duration: 2s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: placeHolderShimmer;\n animation-timing-function: linear;\n }\n}\n\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,y5BAAA;AACA,aAAA,CAAA,UAAA,CAAA,mBAAA,CAAA,oBAAA,CAAA,6BAAA;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import insertStyle from '../../_virtual/____insertStyle.js';
|
|
2
|
+
|
|
3
|
+
insertStyle("._skeleton_1w7c5_1 {\n box-sizing: border-box;\n position: relative;\n margin: var(--sizes-none);\n padding: var(--sizes-none);\n display: block;\n background: #f6f7f8;\n background: linear-gradient(to right, #eeeeee 8%, #dddddd 18%, #eeeeee 33%);\n background-size: 2500px 104px;\n cursor: progress;\n border-radius: var(--sizes-1);\n width: var(--width, \"100%\");\n min-width: var(--width, \"100%\");\n height: var(--height, \"20px\");\n min-height: var(--height, \"20px\");\n}\n@keyframes _placeHolderShimmer_1w7c5_1 {\n 0% {\n background-position: -1080px 0;\n }\n 100% {\n background-position: 1080px 0;\n }\n}\n@media (prefers-reduced-motion: no-preference) {\n ._skeleton_1w7c5_1 {\n animation-duration: 2s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: _placeHolderShimmer_1w7c5_1;\n animation-timing-function: linear;\n }\n}");
|
|
4
|
+
var styles = {"skeleton":"_skeleton_1w7c5_1","placeHolderShimmer":"_placeHolderShimmer_1w7c5_1"};
|
|
5
|
+
|
|
6
|
+
export { styles as default };
|
|
7
|
+
//# sourceMappingURL=Skeleton.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.module.scss.js","sources":["../../../src/components/Skeleton/Skeleton.module.scss"],"sourcesContent":[".skeleton {\n box-sizing: border-box;\n position: relative;\n margin: var(--sizes-none);\n padding: var(--sizes-none);\n\n // General\n display: block;\n background: #f6f7f8;\n background: linear-gradient(to right, #eeeeee 8%, #dddddd 18%, #eeeeee 33%);\n background-size: 2500px 104px;\n\n cursor: progress;\n\n // Sizing\n border-radius: var(--sizes-1);\n\n width: var(--width, '100%');\n min-width: var(--width, '100%');\n\n height: var(--height, '20px');\n min-height: var(--height, '20px');\n\n // Animation\n @keyframes placeHolderShimmer {\n 0% {\n background-position: -1080px 0;\n }\n 100% {\n background-position: 1080px 0;\n }\n }\n\n @media (prefers-reduced-motion: no-preference) {\n animation-duration: 2s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: placeHolderShimmer;\n animation-timing-function: linear;\n }\n}\n\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,y5BAAA;AACA,aAAA,CAAA,UAAA,CAAA,mBAAA,CAAA,oBAAA,CAAA,6BAAA;;;;"}
|
package/dist/index.cjs
CHANGED
|
@@ -99,6 +99,7 @@ var withDeprecated = require('./hoc/withDeprecated.cjs');
|
|
|
99
99
|
var buildClassnames = require('./utils/buildClassnames.cjs');
|
|
100
100
|
var color = require('./utils/color.cjs');
|
|
101
101
|
var generateId = require('./utils/generateId.cjs');
|
|
102
|
+
var assignCssVars = require('./utils/assignCssVars.cjs');
|
|
102
103
|
var index$5 = require('./theme/index.cjs');
|
|
103
104
|
var AccountsIcon = require('./icons/design-system/components/AccountsIcon.cjs');
|
|
104
105
|
var AccountsOutlineIcon = require('./icons/design-system/components/AccountsOutlineIcon.cjs');
|
|
@@ -427,6 +428,7 @@ exports.buildClassnames = buildClassnames.buildClassnames;
|
|
|
427
428
|
exports.getOpaqueHexColor = color.getOpaqueHexColor;
|
|
428
429
|
exports.hexToRgb = color.hexToRgb;
|
|
429
430
|
exports.generateId = generateId.generateId;
|
|
431
|
+
exports.assignCssVars = assignCssVars.assignCssVars;
|
|
430
432
|
exports.theme = index$5.theme;
|
|
431
433
|
exports.AccountsIcon = AccountsIcon.ReactComponent;
|
|
432
434
|
exports.AccountsOutlineIcon = AccountsOutlineIcon.ReactComponent;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -97,6 +97,7 @@ export { withDeprecated } from './hoc/withDeprecated.js';
|
|
|
97
97
|
export { buildClassnames } from './utils/buildClassnames.js';
|
|
98
98
|
export { getOpaqueHexColor, hexToRgb } from './utils/color.js';
|
|
99
99
|
export { generateId } from './utils/generateId.js';
|
|
100
|
+
export { assignCssVars } from './utils/assignCssVars.js';
|
|
100
101
|
export { theme } from './theme/index.js';
|
|
101
102
|
export { ReactComponent as AccountsIcon } from './icons/design-system/components/AccountsIcon.js';
|
|
102
103
|
export { ReactComponent as AccountsOutlineIcon } from './icons/design-system/components/AccountsOutlineIcon.js';
|
package/dist/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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var utils = require('../components/ThemeInjector/utils.cjs');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Utility function which converts an object of properties into a style object with CSS variables, for use when
|
|
7
|
+
* working with CSS modules.
|
|
8
|
+
*
|
|
9
|
+
* Property names are converted from camelCase to kebab-case.
|
|
10
|
+
*
|
|
11
|
+
* @param props An object containing props to pass though as CSS variables.
|
|
12
|
+
* @returns A style object containing the CSS variables.
|
|
13
|
+
*/
|
|
14
|
+
const assignCssVars = (props) => {
|
|
15
|
+
const styleObject = {};
|
|
16
|
+
Object.entries(props).forEach(([propName, value]) => {
|
|
17
|
+
if (value === undefined) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
styleObject[`--${utils.camelToKebab(propName)}`] = value.toString();
|
|
21
|
+
});
|
|
22
|
+
return styleObject;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.assignCssVars = assignCssVars;
|
|
26
|
+
//# sourceMappingURL=assignCssVars.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignCssVars.cjs","sources":["../../src/utils/assignCssVars.ts"],"sourcesContent":["import { CSSProperties } from 'react';\nimport { camelToKebab } from '../components/ThemeInjector/utils';\n\ntype ValidCssVariableType = string | number | undefined;\n\n/**\n * Utility function which converts an object of properties into a style object with CSS variables, for use when\n * working with CSS modules.\n *\n * Property names are converted from camelCase to kebab-case.\n *\n * @param props An object containing props to pass though as CSS variables.\n * @returns A style object containing the CSS variables.\n */\nexport const assignCssVars = (props: Record<string, ValidCssVariableType>) => {\n const styleObject: Record<string, string> = {};\n\n Object.entries(props).forEach(([propName, value]) => {\n if (value === undefined) {\n return;\n }\n\n styleObject[`--${camelToKebab(propName)}`] = value.toString();\n });\n\n return styleObject as CSSProperties;\n};\n"],"names":["camelToKebab"],"mappings":";;;;AAKA;;;;;;;;AAQG;AACU,MAAA,aAAa,GAAG,CAAC,KAA2C,KAAI;IAC3E,MAAM,WAAW,GAA2B,EAAE;AAE9C,IAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAI;QAClD,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB;AACD;AAED,QAAA,WAAW,CAAC,CAAA,EAAA,EAAKA,kBAAY,CAAC,QAAQ,CAAC,CAAE,CAAA,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE;AAC/D,KAAC,CAAC;AAEF,IAAA,OAAO,WAA4B;AACrC;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
type ValidCssVariableType = string | number | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* Utility function which converts an object of properties into a style object with CSS variables, for use when
|
|
5
|
+
* working with CSS modules.
|
|
6
|
+
*
|
|
7
|
+
* Property names are converted from camelCase to kebab-case.
|
|
8
|
+
*
|
|
9
|
+
* @param props An object containing props to pass though as CSS variables.
|
|
10
|
+
* @returns A style object containing the CSS variables.
|
|
11
|
+
*/
|
|
12
|
+
export declare const assignCssVars: (props: Record<string, ValidCssVariableType>) => CSSProperties;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { camelToKebab } from '../components/ThemeInjector/utils.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Utility function which converts an object of properties into a style object with CSS variables, for use when
|
|
5
|
+
* working with CSS modules.
|
|
6
|
+
*
|
|
7
|
+
* Property names are converted from camelCase to kebab-case.
|
|
8
|
+
*
|
|
9
|
+
* @param props An object containing props to pass though as CSS variables.
|
|
10
|
+
* @returns A style object containing the CSS variables.
|
|
11
|
+
*/
|
|
12
|
+
const assignCssVars = (props) => {
|
|
13
|
+
const styleObject = {};
|
|
14
|
+
Object.entries(props).forEach(([propName, value]) => {
|
|
15
|
+
if (value === undefined) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
styleObject[`--${camelToKebab(propName)}`] = value.toString();
|
|
19
|
+
});
|
|
20
|
+
return styleObject;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { assignCssVars };
|
|
24
|
+
//# sourceMappingURL=assignCssVars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignCssVars.js","sources":["../../src/utils/assignCssVars.ts"],"sourcesContent":["import { CSSProperties } from 'react';\nimport { camelToKebab } from '../components/ThemeInjector/utils';\n\ntype ValidCssVariableType = string | number | undefined;\n\n/**\n * Utility function which converts an object of properties into a style object with CSS variables, for use when\n * working with CSS modules.\n *\n * Property names are converted from camelCase to kebab-case.\n *\n * @param props An object containing props to pass though as CSS variables.\n * @returns A style object containing the CSS variables.\n */\nexport const assignCssVars = (props: Record<string, ValidCssVariableType>) => {\n const styleObject: Record<string, string> = {};\n\n Object.entries(props).forEach(([propName, value]) => {\n if (value === undefined) {\n return;\n }\n\n styleObject[`--${camelToKebab(propName)}`] = value.toString();\n });\n\n return styleObject as CSSProperties;\n};\n"],"names":[],"mappings":";;AAKA;;;;;;;;AAQG;AACU,MAAA,aAAa,GAAG,CAAC,KAA2C,KAAI;IAC3E,MAAM,WAAW,GAA2B,EAAE;AAE9C,IAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAI;QAClD,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB;AACD;AAED,QAAA,WAAW,CAAC,CAAA,EAAA,EAAK,YAAY,CAAC,QAAQ,CAAC,CAAE,CAAA,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE;AAC/D,KAAC,CAAC;AAEF,IAAA,OAAO,WAA4B;AACrC;;;;"}
|
package/dist/utils/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('../../../theme/index.cjs');
|
|
4
|
-
|
|
5
|
-
const SpacingMap = {
|
|
6
|
-
base: index.theme.sizes.base,
|
|
7
|
-
sm: index.theme.sizes[3],
|
|
8
|
-
xs: index.theme.sizes.sm,
|
|
9
|
-
};
|
|
10
|
-
const IconSizeMap = {
|
|
11
|
-
base: index.theme.sizes.md,
|
|
12
|
-
sm: index.theme.sizes[5],
|
|
13
|
-
xs: index.theme.sizes[5],
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.IconSizeMap = IconSizeMap;
|
|
17
|
-
exports.SpacingMap = SpacingMap;
|
|
18
|
-
//# sourceMappingURL=constants.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","sources":["../../../../src/components/Alerts/Alert/constants.ts"],"sourcesContent":["import { theme } from '../../../theme';\n\nimport type { AlertSizes } from './types';\n\nexport const SpacingMap: Record<AlertSizes, string> = {\n base: theme.sizes.base,\n sm: theme.sizes[3],\n xs: theme.sizes.sm,\n};\n\nexport const IconSizeMap: Record<AlertSizes, string> = {\n base: theme.sizes.md, // 24px\n sm: theme.sizes[5], // 20px\n xs: theme.sizes[5],\n};\n"],"names":["theme"],"mappings":";;;;AAIa,MAAA,UAAU,GAA+B;AACpD,IAAA,IAAI,EAAEA,WAAK,CAAC,KAAK,CAAC,IAAI;AACtB,IAAA,EAAE,EAAEA,WAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAClB,IAAA,EAAE,EAAEA,WAAK,CAAC,KAAK,CAAC,EAAE;;AAGP,MAAA,WAAW,GAA+B;AACrD,IAAA,IAAI,EAAEA,WAAK,CAAC,KAAK,CAAC,EAAE;AACpB,IAAA,EAAE,EAAEA,WAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAClB,IAAA,EAAE,EAAEA,WAAK,CAAC,KAAK,CAAC,CAAC,CAAC;;;;;;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { theme } from '../../../theme/index.js';
|
|
2
|
-
|
|
3
|
-
const SpacingMap = {
|
|
4
|
-
base: theme.sizes.base,
|
|
5
|
-
sm: theme.sizes[3],
|
|
6
|
-
xs: theme.sizes.sm,
|
|
7
|
-
};
|
|
8
|
-
const IconSizeMap = {
|
|
9
|
-
base: theme.sizes.md,
|
|
10
|
-
sm: theme.sizes[5],
|
|
11
|
-
xs: theme.sizes[5],
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { IconSizeMap, SpacingMap };
|
|
15
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/components/Alerts/Alert/constants.ts"],"sourcesContent":["import { theme } from '../../../theme';\n\nimport type { AlertSizes } from './types';\n\nexport const SpacingMap: Record<AlertSizes, string> = {\n base: theme.sizes.base,\n sm: theme.sizes[3],\n xs: theme.sizes.sm,\n};\n\nexport const IconSizeMap: Record<AlertSizes, string> = {\n base: theme.sizes.md, // 24px\n sm: theme.sizes[5], // 20px\n xs: theme.sizes[5],\n};\n"],"names":[],"mappings":";;AAIa,MAAA,UAAU,GAA+B;AACpD,IAAA,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI;AACtB,IAAA,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAClB,IAAA,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE;;AAGP,MAAA,WAAW,GAA+B;AACrD,IAAA,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE;AACpB,IAAA,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAClB,IAAA,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;;;;;"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var styled = require('styled-components');
|
|
4
|
-
var Stack = require('../../Stack/Stack.cjs');
|
|
5
|
-
require('../../Stack/types.cjs');
|
|
6
|
-
var index = require('../../../theme/index.cjs');
|
|
7
|
-
|
|
8
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
9
|
-
|
|
10
|
-
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
11
|
-
|
|
12
|
-
const AlertContainer = styled__default.default(Stack.Stack).attrs({
|
|
13
|
-
direction: 'horizontal',
|
|
14
|
-
alignX: 'between',
|
|
15
|
-
alignY: 'top',
|
|
16
|
-
spacing: 0,
|
|
17
|
-
}).withConfig({ displayName: "vui--AlertContainer", componentId: "vui--yb86nz" }) `border:1px solid ${({ colours: { primary } }) => primary};border-radius:${index.theme.radius.base};background-color:${({ colours: { background } }) => background};`;
|
|
18
|
-
|
|
19
|
-
exports.AlertContainer = AlertContainer;
|
|
20
|
-
//# sourceMappingURL=styled.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styled.cjs","sources":["../../../../src/components/Alerts/Alert/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Stack } from '../../Stack';\nimport { AlertColours } from '../types';\nimport { theme } from '../../../theme';\n\nexport const AlertContainer = styled(Stack).attrs<{ colours: AlertColours }>({\n direction: 'horizontal',\n alignX: 'between',\n alignY: 'top',\n spacing: 0,\n})<{\n colours: AlertColours;\n}>`\n border: 1px solid ${({ colours: { primary } }) => primary};\n border-radius: ${theme.radius.base};\n\n background-color: ${({ colours: { background } }) => background};\n`;\n"],"names":["styled","Stack","theme"],"mappings":";;;;;;;;;;;AAKa,MAAA,cAAc,GAAGA,uBAAM,CAACC,WAAK,CAAC,CAAC,KAAK,CAA4B;AAC3E,IAAA,SAAS,EAAE,YAAY;AACvB,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,OAAO,EAAE,CAAC;AACX,CAAA,CAAC,CAGoB,UAAA,CAAA,EAAA,WAAA,EAAA,qBAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,iBAAA,EAAA,CAAC,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,OAAO,kBACxCC,WAAK,CAAC,MAAM,CAAC,IAAI,CAAA,kBAAA,EAEd,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,EAAE,KAAK,UAAU;;;;"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { Stack } from '../../Stack/Stack.js';
|
|
3
|
-
import '../../Stack/types.js';
|
|
4
|
-
import { theme } from '../../../theme/index.js';
|
|
5
|
-
|
|
6
|
-
const AlertContainer = styled(Stack).attrs({
|
|
7
|
-
direction: 'horizontal',
|
|
8
|
-
alignX: 'between',
|
|
9
|
-
alignY: 'top',
|
|
10
|
-
spacing: 0,
|
|
11
|
-
}).withConfig({ displayName: "vui--AlertContainer", componentId: "vui--yb86nz" }) `border:1px solid ${({ colours: { primary } }) => primary};border-radius:${theme.radius.base};background-color:${({ colours: { background } }) => background};`;
|
|
12
|
-
|
|
13
|
-
export { AlertContainer };
|
|
14
|
-
//# sourceMappingURL=styled.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sources":["../../../../src/components/Alerts/Alert/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Stack } from '../../Stack';\nimport { AlertColours } from '../types';\nimport { theme } from '../../../theme';\n\nexport const AlertContainer = styled(Stack).attrs<{ colours: AlertColours }>({\n direction: 'horizontal',\n alignX: 'between',\n alignY: 'top',\n spacing: 0,\n})<{\n colours: AlertColours;\n}>`\n border: 1px solid ${({ colours: { primary } }) => primary};\n border-radius: ${theme.radius.base};\n\n background-color: ${({ colours: { background } }) => background};\n`;\n"],"names":[],"mappings":";;;;;AAKa,MAAA,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAA4B;AAC3E,IAAA,SAAS,EAAE,YAAY;AACvB,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,OAAO,EAAE,CAAC;AACX,CAAA,CAAC,CAGoB,UAAA,CAAA,EAAA,WAAA,EAAA,qBAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,iBAAA,EAAA,CAAC,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,OAAO,kBACxC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAA,kBAAA,EAEd,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,EAAE,KAAK,UAAU;;;;"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('../../../theme/index.cjs');
|
|
4
|
-
|
|
5
|
-
const TextColourMap = {
|
|
6
|
-
default: index.theme.colors.neutral.ink.dark,
|
|
7
|
-
error: index.theme.colors.secondary.red.darkest,
|
|
8
|
-
success: index.theme.colors.neutral.ink.dark,
|
|
9
|
-
info: index.theme.colors.neutral.ink.dark,
|
|
10
|
-
warning: index.theme.colors.neutral.ink.dark,
|
|
11
|
-
recommend: index.theme.colors.neutral.ink.dark,
|
|
12
|
-
};
|
|
13
|
-
const IconStyles = {
|
|
14
|
-
minWidth: index.theme.sizes[4],
|
|
15
|
-
minHeight: index.theme.sizes[4],
|
|
16
|
-
width: index.theme.sizes[4],
|
|
17
|
-
height: index.theme.sizes[4],
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
exports.IconStyles = IconStyles;
|
|
21
|
-
exports.TextColourMap = TextColourMap;
|
|
22
|
-
//# sourceMappingURL=constants.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","sources":["../../../../src/components/Alerts/MiniAlert/constants.ts"],"sourcesContent":["import { theme } from 'Theme';\nimport { AlertVariants } from '../types';\n\nexport const TextColourMap: Record<AlertVariants, string> = {\n default: theme.colors.neutral.ink.dark,\n error: theme.colors.secondary.red.darkest,\n success: theme.colors.neutral.ink.dark,\n info: theme.colors.neutral.ink.dark,\n warning: theme.colors.neutral.ink.dark,\n recommend: theme.colors.neutral.ink.dark,\n};\n\nexport const IconStyles = {\n minWidth: theme.sizes[4],\n minHeight: theme.sizes[4],\n width: theme.sizes[4],\n height: theme.sizes[4],\n};\n"],"names":["theme"],"mappings":";;;;AAGa,MAAA,aAAa,GAAkC;IAC1D,OAAO,EAAEA,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI;IACtC,KAAK,EAAEA,WAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO;IACzC,OAAO,EAAEA,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI;IACtC,IAAI,EAAEA,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI;IACnC,OAAO,EAAEA,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI;IACtC,SAAS,EAAEA,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI;;AAG7B,MAAA,UAAU,GAAG;AACxB,IAAA,QAAQ,EAAEA,WAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACxB,IAAA,SAAS,EAAEA,WAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACzB,IAAA,KAAK,EAAEA,WAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACrB,IAAA,MAAM,EAAEA,WAAK,CAAC,KAAK,CAAC,CAAC,CAAC;;;;;;"}
|