@coveord/plasma-mantine 49.2.3 → 49.2.5
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/.turbo/turbo-build.log +3 -3
- package/.turbo/turbo-test.log +28 -28
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/components/table/Th.js +8 -11
- package/dist/cjs/components/table/Th.js.map +1 -1
- package/dist/cjs/theme/Theme.js +13 -13
- package/dist/cjs/theme/Theme.js.map +1 -1
- package/dist/definitions/components/table/Th.d.ts.map +1 -1
- package/dist/esm/components/table/Th.js +9 -12
- package/dist/esm/components/table/Th.js.map +1 -1
- package/dist/esm/theme/Theme.js +13 -13
- package/dist/esm/theme/Theme.js.map +1 -1
- package/package.json +1 -1
- package/src/components/header/__tests__/Header.spec.tsx +10 -10
- package/src/components/table/Th.tsx +9 -7
- package/src/components/table/__tests__/Th.spec.tsx +5 -14
- package/src/theme/Theme.tsx +6 -6
|
@@ -31,12 +31,14 @@ var useStyles = (0, _core.createStyles)(function(theme) {
|
|
|
31
31
|
};
|
|
32
32
|
});
|
|
33
33
|
var SortingIcons = {
|
|
34
|
-
asc: _plasmaReactIcons.
|
|
35
|
-
desc: _plasmaReactIcons.
|
|
34
|
+
asc: _plasmaReactIcons.ArrowUpSize16Px,
|
|
35
|
+
desc: _plasmaReactIcons.ArrowDownSize16Px,
|
|
36
|
+
none: _plasmaReactIcons.DoubleArrowHeadVSize16Px
|
|
36
37
|
};
|
|
37
38
|
var SortingLabels = {
|
|
38
39
|
asc: "ascending",
|
|
39
|
-
desc: "descending"
|
|
40
|
+
desc: "descending",
|
|
41
|
+
none: "none"
|
|
40
42
|
};
|
|
41
43
|
var Th = function(param) {
|
|
42
44
|
var header = param.header;
|
|
@@ -61,14 +63,14 @@ var Th = function(param) {
|
|
|
61
63
|
});
|
|
62
64
|
}
|
|
63
65
|
var onSort = header.column.getToggleSortingHandler();
|
|
64
|
-
var sortingOrder = header.column.getIsSorted();
|
|
65
|
-
var Icon = SortingIcons[sortingOrder
|
|
66
|
+
var sortingOrder = header.column.getIsSorted() || "none";
|
|
67
|
+
var Icon = SortingIcons[sortingOrder];
|
|
66
68
|
return /*#__PURE__*/ (0, _jsxRuntime.jsx)("th", {
|
|
67
69
|
className: classes.th,
|
|
68
70
|
style: {
|
|
69
71
|
width: width
|
|
70
72
|
},
|
|
71
|
-
"aria-sort":
|
|
73
|
+
"aria-sort": SortingLabels[sortingOrder],
|
|
72
74
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.UnstyledButton, {
|
|
73
75
|
onClick: onSort,
|
|
74
76
|
className: classes.control,
|
|
@@ -81,11 +83,6 @@ var Th = function(param) {
|
|
|
81
83
|
children: (0, _reactTable.flexRender)(header.column.columnDef.header, header.getContext())
|
|
82
84
|
}),
|
|
83
85
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Center, {
|
|
84
|
-
sx: function(theme) {
|
|
85
|
-
return {
|
|
86
|
-
color: sortingOrder ? theme.colors.action[8] : undefined
|
|
87
|
-
};
|
|
88
|
-
},
|
|
89
86
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(Icon, {
|
|
90
87
|
height: 14
|
|
91
88
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/table/Th.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/table/Th.tsx"],"sourcesContent":["import {ArrowDownSize16Px, ArrowUpSize16Px, DoubleArrowHeadVSize16Px} from '@coveord/plasma-react-icons';\nimport {Center, createStyles, Group, Text, UnstyledButton} from '@mantine/core';\nimport {defaultColumnSizing, flexRender, Header} from '@tanstack/react-table';\n\nconst useStyles = createStyles((theme) => ({\n th: {\n fontWeight: '400 !important' as any,\n padding: '0 !important',\n color: theme.black + '!important',\n verticalAlign: 'middle',\n },\n\n control: {\n width: '100%',\n padding: `${theme.spacing.xs}px ${theme.spacing.sm}px`,\n whiteSpace: 'nowrap',\n\n '&:hover': {\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.gray[6] : theme.colors.gray[2],\n },\n },\n}));\n\ninterface ThProps<T> {\n header: Header<T, unknown>;\n}\n\nconst SortingIcons = {\n asc: ArrowUpSize16Px,\n desc: ArrowDownSize16Px,\n none: DoubleArrowHeadVSize16Px,\n};\n\nconst SortingLabels = {\n asc: 'ascending',\n desc: 'descending',\n none: 'none',\n} as const;\n\nexport const Th = <T,>({header}: ThProps<T>) => {\n const {classes} = useStyles();\n const size = header.column.getSize();\n const width = size !== defaultColumnSizing.size ? size : undefined;\n\n if (header.isPlaceholder) {\n return null;\n }\n\n if (!header.column.getCanSort()) {\n return (\n <th className={classes.th} style={{width}}>\n <Text size=\"xs\" py=\"xs\" px=\"sm\">\n {flexRender(header.column.columnDef.header, header.getContext())}\n </Text>\n </th>\n );\n }\n\n const onSort = header.column.getToggleSortingHandler();\n const sortingOrder = header.column.getIsSorted() || 'none';\n const Icon = SortingIcons[sortingOrder];\n\n return (\n <th className={classes.th} style={{width}} aria-sort={SortingLabels[sortingOrder]}>\n <UnstyledButton onClick={onSort} className={classes.control}>\n <Group position=\"apart\" noWrap>\n <Text size=\"xs\">{flexRender(header.column.columnDef.header, header.getContext())}</Text>\n <Center>\n <Icon height={14} />\n </Center>\n </Group>\n </UnstyledButton>\n </th>\n );\n};\n"],"names":["Th","useStyles","createStyles","theme","th","fontWeight","padding","color","black","verticalAlign","control","width","spacing","xs","sm","whiteSpace","backgroundColor","colorScheme","colors","gray","SortingIcons","asc","ArrowUpSize16Px","desc","ArrowDownSize16Px","none","DoubleArrowHeadVSize16Px","SortingLabels","header","classes","size","column","getSize","defaultColumnSizing","undefined","isPlaceholder","getCanSort","className","style","Text","py","px","flexRender","columnDef","getContext","onSort","getToggleSortingHandler","sortingOrder","getIsSorted","Icon","aria-sort","UnstyledButton","onClick","Group","position","noWrap","Center","height"],"mappings":";;;;+BAuCaA;;;eAAAA;;;;gCAvC8D;oBACX;0BACV;A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AAMC,eAAenB,OAAOG,MAAM,CAACiB,WAAW,MAAM;IACpD,IAAMC,OAAO7B,YAAY,CAAC2B,aAAa;IAEvC,qBACI,qBAAC3C;QAAGiC,WAAWR,QAAQzB,EAAE;QAAEkC,OAAO;YAAC3B,OAAAA;QAAK;QAAGuC,aAAWvB,aAAa,CAACoB,aAAa;kBAC7E,cAAA,qBAACI,oBAAc;YAACC,SAASP;YAAQR,WAAWR,QAAQnB,OAAO;sBACvD,cAAA,sBAAC2C,WAAK;gBAACC,UAAS;gBAAQC,MAAM;;kCAC1B,qBAAChB,UAAI;wBAACT,MAAK;kCAAMY,IAAAA,sBAAU,EAACd,OAAOG,MAAM,CAACY,SAAS,CAACf,MAAM,EAAEA,OAAOgB,UAAU;;kCAC7E,qBAACY,YAAM;kCACH,cAAA,qBAACP;4BAAKQ,QAAQ;;;;;;;AAMtC"}
|
package/dist/cjs/theme/Theme.js
CHANGED
|
@@ -34,32 +34,32 @@ var plasmaTheme = {
|
|
|
34
34
|
h1: {
|
|
35
35
|
fontSize: 48,
|
|
36
36
|
lineHeight: "56px",
|
|
37
|
-
fontWeight:
|
|
37
|
+
fontWeight: 300
|
|
38
38
|
},
|
|
39
39
|
h2: {
|
|
40
40
|
fontSize: 32,
|
|
41
41
|
lineHeight: "40px",
|
|
42
|
-
fontWeight:
|
|
42
|
+
fontWeight: 500
|
|
43
43
|
},
|
|
44
44
|
h3: {
|
|
45
|
-
fontSize: 28,
|
|
46
|
-
lineHeight: "40px",
|
|
47
|
-
fontWeight: undefined
|
|
48
|
-
},
|
|
49
|
-
h4: {
|
|
50
45
|
fontSize: 24,
|
|
51
46
|
lineHeight: "32px",
|
|
52
|
-
fontWeight:
|
|
47
|
+
fontWeight: 500
|
|
53
48
|
},
|
|
54
|
-
|
|
49
|
+
h4: {
|
|
55
50
|
fontSize: 18,
|
|
56
51
|
lineHeight: "28px",
|
|
57
|
-
fontWeight:
|
|
52
|
+
fontWeight: 300
|
|
53
|
+
},
|
|
54
|
+
h5: {
|
|
55
|
+
fontSize: 14,
|
|
56
|
+
lineHeight: "20px",
|
|
57
|
+
fontWeight: 500
|
|
58
58
|
},
|
|
59
59
|
h6: {
|
|
60
|
-
fontSize:
|
|
61
|
-
lineHeight: "
|
|
62
|
-
fontWeight:
|
|
60
|
+
fontSize: 12,
|
|
61
|
+
lineHeight: "16px",
|
|
62
|
+
fontWeight: 500
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/theme/Theme.tsx"],"sourcesContent":["import {ArrowHeadRightSize24Px, InfoSize24Px} from '@coveord/plasma-react-icons';\nimport {color} from '@coveord/plasma-tokens';\nimport {ButtonStylesParams, MantineThemeOverride, ModalStylesParams} from '@mantine/core';\n\nimport {PlasmaColors} from './PlasmaColors';\n\nexport const plasmaTheme: MantineThemeOverride = {\n // These are overrides over https://github.com/mantinedev/mantine/blob/master/src/mantine-styles/src/theme/default-theme.ts\n colorScheme: 'light',\n fontFamily: 'canada-type-gibson, sans-serif',\n black: color.primary.gray[9],\n defaultRadius: 8,\n spacing: {\n xs: 8,\n sm: 16,\n md: 24,\n lg: 32,\n xl: 40,\n },\n primaryColor: 'action',\n headings: {\n fontFamily: 'canada-type-gibson, sans-serif',\n fontWeight: 500,\n sizes: {\n h1: {fontSize: 48, lineHeight: '56px', fontWeight: undefined},\n h2: {fontSize: 32, lineHeight: '40px', fontWeight: undefined},\n h3: {fontSize: 28, lineHeight: '40px', fontWeight: undefined},\n h4: {fontSize: 24, lineHeight: '32px', fontWeight: undefined},\n h5: {fontSize: 18, lineHeight: '28px', fontWeight: undefined},\n h6: {fontSize: 16, lineHeight: '24px', fontWeight: undefined},\n },\n },\n shadows: {\n xs: '0px 1px 0px rgba(4, 8, 31, 0.08)',\n sm: '0px 2px 4px rgba(4, 8, 31, 0.12)',\n md: '0px 4px 8px rgba(4, 8, 31, 0.08)',\n lg: '0px 8px 16px rgba(7, 12, 41, 0.06)',\n xl: '0px 16px 24px rgba(4, 8, 31, 0.06)',\n },\n colors: PlasmaColors,\n components: {\n Alert: {\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'navy',\n },\n styles: {\n title: {\n fontWeight: 500,\n },\n },\n },\n Title: {\n styles: (theme) => ({\n root: {\n '&:is(h1,h2,h3,h4,h5,h6)': {letterSpacing: '0.011em', color: theme.colors.gray[9]},\n },\n }),\n },\n Button: {\n styles: (theme, params: ButtonStylesParams) => ({\n root: {\n fontWeight: 400,\n backgroundColor: params.variant === 'outline' ? 'white' : undefined,\n },\n }),\n },\n Modal: {\n styles: (theme, {size, fullScreen}: ModalStylesParams) => ({\n modal: {\n width: fullScreen\n ? undefined\n : theme.fn.size({size, sizes: {xs: 440, sm: 550, md: 800, lg: 1334, xl: '85%'}}),\n },\n }),\n defaultProps: {\n overlayColor: color.primary.navy[9],\n overlayOpacity: 0.9,\n },\n },\n InputWrapper: {\n defaultProps: {\n withAsterisk: false,\n },\n styles: (theme) => ({\n label: {\n marginBottom: theme.spacing.xs,\n lineHeight: '20px',\n },\n description: {\n lineHeight: '20px',\n fontSize: theme.fontSizes.sm,\n color: theme.colors.gray[7],\n marginBottom: theme.spacing.xs,\n },\n invalid: {\n color: theme.colors.red[9],\n borderColor: theme.colors.red[6],\n },\n error: {\n color: theme.colors.red[9],\n },\n }),\n },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: true,\n multiline: true,\n },\n },\n Breadcrumbs: {\n defaultProps: {\n separator: <ArrowHeadRightSize24Px height={24} />,\n },\n },\n Loader: {\n defaultProps: {\n variant: 'dots',\n color: 'action',\n },\n },\n DateRangePicker: {\n styles: {\n cell: {\n textAlign: 'center',\n },\n },\n },\n Anchor: {\n defaultProps: {\n color: 'action',\n },\n styles: (theme) => ({\n root: {\n ...theme.fn.hover({\n textDecoration: 'underline',\n color: theme.colors.action[8],\n }),\n },\n }),\n },\n Checkbox: {\n defaultProps: {\n radius: 'sm',\n },\n },\n List: {\n styles: () => ({\n root: {\n listStyleType: 'disc',\n },\n }),\n },\n Radio: {\n styles: {\n labelWrapper: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n },\n },\n Popover: {\n defaultProps: {\n shadow: 'md',\n withArrow: true,\n },\n },\n Badge: {\n styles: {\n root: {\n textTransform: 'none',\n padding: '4px 8px',\n fontWeight: 500,\n },\n },\n },\n ColorSwatch: {\n defaultProps: {\n size: 8,\n withShadow: false,\n },\n },\n MenuItem: {\n defaultProps: {\n fw: 300,\n },\n },\n },\n};\n"],"names":["plasmaTheme","colorScheme","fontFamily","black","color","primary","gray","defaultRadius","spacing","xs","sm","md","lg","xl","primaryColor","headings","fontWeight","sizes","h1","fontSize","lineHeight","undefined","h2","h3","h4","h5","h6","shadows","colors","PlasmaColors","components","Alert","defaultProps","icon","InfoSize24Px","height","styles","title","Title","theme","root","letterSpacing","Button","params","backgroundColor","variant","Modal","size","fullScreen","modal","width","fn","overlayColor","navy","overlayOpacity","InputWrapper","withAsterisk","label","marginBottom","description","fontSizes","invalid","red","borderColor","error","TextInput","radius","Tooltip","withArrow","withinPortal","multiline","Breadcrumbs","separator","ArrowHeadRightSize24Px","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","padding","ColorSwatch","withShadow","MenuItem","fw"],"mappings":";;;;+BAMaA;;;eAAAA;;;;;gCANsC;4BAC/B;4BAGO;AAEpB,IAAMA,cAAoC;IAC7C,2HAA2H;IAC3HC,aAAa;IACbC,YAAY;IACZC,OAAOC,mBAAK,CAACC,OAAO,CAACC,IAAI,CAAC,EAAE;IAC5BC,eAAe;IACfC,SAAS;QACLC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;IACR;IACAC,cAAc;IACdC,UAAU;QACNb,YAAY;QACZc,YAAY;QACZC,O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AAK,CAAC;wBACdC,gBAAgB;wBAChB5E,OAAOmC,MAAMX,MAAM,CAACqD,MAAM,CAAC,EAAE;oBACjC;gBAER;;QACJ;QACAC,UAAU;YACNlD,cAAc;gBACVkC,QAAQ;YACZ;QACJ;QACAiB,MAAM;YACF/C,QAAQ;uBAAO;oBACXI,MAAM;wBACF4C,eAAe;oBACnB;gBACJ;;QACJ;QACAC,OAAO;YACHjD,QAAQ;gBACJkD,cAAc;oBACVC,SAAS;oBACTC,YAAY;gBAChB;YACJ;QACJ;QACAC,SAAS;YACLzD,cAAc;gBACV0D,QAAQ;gBACRtB,WAAW,IAAI;YACnB;QACJ;QACAuB,OAAO;YACHvD,QAAQ;gBACJI,MAAM;oBACFoD,eAAe;oBACfC,SAAS;oBACT7E,YAAY;gBAChB;YACJ;QACJ;QACA8E,aAAa;YACT9D,cAAc;gBACVe,MAAM;gBACNgD,YAAY,KAAK;YACrB;QACJ;QACAC,UAAU;YACNhE,cAAc;gBACViE,IAAI;YACR;QACJ;IACJ;AACJ"}
|
|
1
|
+
{"version":3,"sources":["../../../src/theme/Theme.tsx"],"sourcesContent":["import {ArrowHeadRightSize24Px, InfoSize24Px} from '@coveord/plasma-react-icons';\nimport {color} from '@coveord/plasma-tokens';\nimport {ButtonStylesParams, MantineThemeOverride, ModalStylesParams} from '@mantine/core';\n\nimport {PlasmaColors} from './PlasmaColors';\n\nexport const plasmaTheme: MantineThemeOverride = {\n // These are overrides over https://github.com/mantinedev/mantine/blob/master/src/mantine-styles/src/theme/default-theme.ts\n colorScheme: 'light',\n fontFamily: 'canada-type-gibson, sans-serif',\n black: color.primary.gray[9],\n defaultRadius: 8,\n spacing: {\n xs: 8,\n sm: 16,\n md: 24,\n lg: 32,\n xl: 40,\n },\n primaryColor: 'action',\n headings: {\n fontFamily: 'canada-type-gibson, sans-serif',\n fontWeight: 500,\n sizes: {\n h1: {fontSize: 48, lineHeight: '56px', fontWeight: 300},\n h2: {fontSize: 32, lineHeight: '40px', fontWeight: 500},\n h3: {fontSize: 24, lineHeight: '32px', fontWeight: 500},\n h4: {fontSize: 18, lineHeight: '28px', fontWeight: 300},\n h5: {fontSize: 14, lineHeight: '20px', fontWeight: 500},\n h6: {fontSize: 12, lineHeight: '16px', fontWeight: 500},\n },\n },\n shadows: {\n xs: '0px 1px 0px rgba(4, 8, 31, 0.08)',\n sm: '0px 2px 4px rgba(4, 8, 31, 0.12)',\n md: '0px 4px 8px rgba(4, 8, 31, 0.08)',\n lg: '0px 8px 16px rgba(7, 12, 41, 0.06)',\n xl: '0px 16px 24px rgba(4, 8, 31, 0.06)',\n },\n colors: PlasmaColors,\n components: {\n Alert: {\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'navy',\n },\n styles: {\n title: {\n fontWeight: 500,\n },\n },\n },\n Title: {\n styles: (theme) => ({\n root: {\n '&:is(h1,h2,h3,h4,h5,h6)': {letterSpacing: '0.011em', color: theme.colors.gray[9]},\n },\n }),\n },\n Button: {\n styles: (theme, params: ButtonStylesParams) => ({\n root: {\n fontWeight: 400,\n backgroundColor: params.variant === 'outline' ? 'white' : undefined,\n },\n }),\n },\n Modal: {\n styles: (theme, {size, fullScreen}: ModalStylesParams) => ({\n modal: {\n width: fullScreen\n ? undefined\n : theme.fn.size({size, sizes: {xs: 440, sm: 550, md: 800, lg: 1334, xl: '85%'}}),\n },\n }),\n defaultProps: {\n overlayColor: color.primary.navy[9],\n overlayOpacity: 0.9,\n },\n },\n InputWrapper: {\n defaultProps: {\n withAsterisk: false,\n },\n styles: (theme) => ({\n label: {\n marginBottom: theme.spacing.xs,\n lineHeight: '20px',\n },\n description: {\n lineHeight: '20px',\n fontSize: theme.fontSizes.sm,\n color: theme.colors.gray[7],\n marginBottom: theme.spacing.xs,\n },\n invalid: {\n color: theme.colors.red[9],\n borderColor: theme.colors.red[6],\n },\n error: {\n color: theme.colors.red[9],\n },\n }),\n },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: true,\n multiline: true,\n },\n },\n Breadcrumbs: {\n defaultProps: {\n separator: <ArrowHeadRightSize24Px height={24} />,\n },\n },\n Loader: {\n defaultProps: {\n variant: 'dots',\n color: 'action',\n },\n },\n DateRangePicker: {\n styles: {\n cell: {\n textAlign: 'center',\n },\n },\n },\n Anchor: {\n defaultProps: {\n color: 'action',\n },\n styles: (theme) => ({\n root: {\n ...theme.fn.hover({\n textDecoration: 'underline',\n color: theme.colors.action[8],\n }),\n },\n }),\n },\n Checkbox: {\n defaultProps: {\n radius: 'sm',\n },\n },\n List: {\n styles: () => ({\n root: {\n listStyleType: 'disc',\n },\n }),\n },\n Radio: {\n styles: {\n labelWrapper: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n },\n },\n Popover: {\n defaultProps: {\n shadow: 'md',\n withArrow: true,\n },\n },\n Badge: {\n styles: {\n root: {\n textTransform: 'none',\n padding: '4px 8px',\n fontWeight: 500,\n },\n },\n },\n ColorSwatch: {\n defaultProps: {\n size: 8,\n withShadow: false,\n },\n },\n MenuItem: {\n defaultProps: {\n fw: 300,\n },\n },\n },\n};\n"],"names":["plasmaTheme","colorScheme","fontFamily","black","color","primary","gray","defaultRadius","spacing","xs","sm","md","lg","xl","primaryColor","headings","fontWeight","sizes","h1","fontSize","lineHeight","h2","h3","h4","h5","h6","shadows","colors","PlasmaColors","components","Alert","defaultProps","icon","InfoSize24Px","height","styles","title","Title","theme","root","letterSpacing","Button","params","backgroundColor","variant","undefined","Modal","size","fullScreen","modal","width","fn","overlayColor","navy","overlayOpacity","InputWrapper","withAsterisk","label","marginBottom","description","fontSizes","invalid","red","borderColor","error","TextInput","radius","Tooltip","withArrow","withinPortal","multiline","Breadcrumbs","separator","ArrowHeadRightSize24Px","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","padding","ColorSwatch","withShadow","MenuItem","fw"],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AACC,wCAAsB;oBAACvC,QAAQ;;YAC/C;QACJ;QACAwC,QAAQ;YACJ3C,cAAc;gBACVa,SAAS;gBACTxC,OAAO;YACX;QACJ;QACAuE,iBAAiB;YACbxC,QAAQ;gBACJyC,MAAM;oBACFC,WAAW;gBACf;YACJ;QACJ;QACAC,QAAQ;YACJ/C,cAAc;gBACV3B,OAAO;YACX;YACA+B,QAAQ,SAACG;uBAAW;oBAChBC,MAAM,kBACCD,MAAMa,EAAE,CAAC4B,KAAK,CAAC;wBACdC,gBAAgB;wBAChB5E,OAAOkC,MAAMX,MAAM,CAACsD,MAAM,CAAC,EAAE;oBACjC;gBAER;;QACJ;QACAC,UAAU;YACNnD,cAAc;gBACVmC,QAAQ;YACZ;QACJ;QACAiB,MAAM;YACFhD,QAAQ;uBAAO;oBACXI,MAAM;wBACF6C,eAAe;oBACnB;gBACJ;;QACJ;QACAC,OAAO;YACHlD,QAAQ;gBACJmD,cAAc;oBACVC,SAAS;oBACTC,YAAY;gBAChB;YACJ;QACJ;QACAC,SAAS;YACL1D,cAAc;gBACV2D,QAAQ;gBACRtB,WAAW,IAAI;YACnB;QACJ;QACAuB,OAAO;YACHxD,QAAQ;gBACJI,MAAM;oBACFqD,eAAe;oBACfC,SAAS;oBACT7E,YAAY;gBAChB;YACJ;QACJ;QACA8E,aAAa;YACT/D,cAAc;gBACVgB,MAAM;gBACNgD,YAAY,KAAK;YACrB;QACJ;QACAC,UAAU;YACNjE,cAAc;gBACVkE,IAAI;YACR;QACJ;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Th.d.ts","sourceRoot":"","sources":["../../../../src/components/table/Th.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAkC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAqB9E,UAAU,OAAO,CAAC,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;CAC9B;
|
|
1
|
+
{"version":3,"file":"Th.d.ts","sourceRoot":"","sources":["../../../../src/components/table/Th.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAkC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAqB9E,UAAU,OAAO,CAAC,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;CAC9B;AAcD,eAAO,MAAM,EAAE,4CAmCd,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { ArrowDownSize16Px, ArrowUpSize16Px, DoubleArrowHeadVSize16Px } from "@coveord/plasma-react-icons";
|
|
3
3
|
import { Center, createStyles, Group, Text, UnstyledButton } from "@mantine/core";
|
|
4
4
|
import { defaultColumnSizing, flexRender } from "@tanstack/react-table";
|
|
5
5
|
var useStyles = createStyles(function(theme) {
|
|
@@ -21,12 +21,14 @@ var useStyles = createStyles(function(theme) {
|
|
|
21
21
|
};
|
|
22
22
|
});
|
|
23
23
|
var SortingIcons = {
|
|
24
|
-
asc:
|
|
25
|
-
desc:
|
|
24
|
+
asc: ArrowUpSize16Px,
|
|
25
|
+
desc: ArrowDownSize16Px,
|
|
26
|
+
none: DoubleArrowHeadVSize16Px
|
|
26
27
|
};
|
|
27
28
|
var SortingLabels = {
|
|
28
29
|
asc: "ascending",
|
|
29
|
-
desc: "descending"
|
|
30
|
+
desc: "descending",
|
|
31
|
+
none: "none"
|
|
30
32
|
};
|
|
31
33
|
export var Th = function(param) {
|
|
32
34
|
var header = param.header;
|
|
@@ -51,14 +53,14 @@ export var Th = function(param) {
|
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
55
|
var onSort = header.column.getToggleSortingHandler();
|
|
54
|
-
var sortingOrder = header.column.getIsSorted();
|
|
55
|
-
var Icon = SortingIcons[sortingOrder
|
|
56
|
+
var sortingOrder = header.column.getIsSorted() || "none";
|
|
57
|
+
var Icon = SortingIcons[sortingOrder];
|
|
56
58
|
return /*#__PURE__*/ _jsx("th", {
|
|
57
59
|
className: classes.th,
|
|
58
60
|
style: {
|
|
59
61
|
width: width
|
|
60
62
|
},
|
|
61
|
-
"aria-sort":
|
|
63
|
+
"aria-sort": SortingLabels[sortingOrder],
|
|
62
64
|
children: /*#__PURE__*/ _jsx(UnstyledButton, {
|
|
63
65
|
onClick: onSort,
|
|
64
66
|
className: classes.control,
|
|
@@ -71,11 +73,6 @@ export var Th = function(param) {
|
|
|
71
73
|
children: flexRender(header.column.columnDef.header, header.getContext())
|
|
72
74
|
}),
|
|
73
75
|
/*#__PURE__*/ _jsx(Center, {
|
|
74
|
-
sx: function(theme) {
|
|
75
|
-
return {
|
|
76
|
-
color: sortingOrder ? theme.colors.action[8] : undefined
|
|
77
|
-
};
|
|
78
|
-
},
|
|
79
76
|
children: /*#__PURE__*/ _jsx(Icon, {
|
|
80
77
|
height: 14
|
|
81
78
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/table/Th.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/table/Th.tsx"],"sourcesContent":["import {ArrowDownSize16Px, ArrowUpSize16Px, DoubleArrowHeadVSize16Px} from '@coveord/plasma-react-icons';\nimport {Center, createStyles, Group, Text, UnstyledButton} from '@mantine/core';\nimport {defaultColumnSizing, flexRender, Header} from '@tanstack/react-table';\n\nconst useStyles = createStyles((theme) => ({\n th: {\n fontWeight: '400 !important' as any,\n padding: '0 !important',\n color: theme.black + '!important',\n verticalAlign: 'middle',\n },\n\n control: {\n width: '100%',\n padding: `${theme.spacing.xs}px ${theme.spacing.sm}px`,\n whiteSpace: 'nowrap',\n\n '&:hover': {\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.gray[6] : theme.colors.gray[2],\n },\n },\n}));\n\ninterface ThProps<T> {\n header: Header<T, unknown>;\n}\n\nconst SortingIcons = {\n asc: ArrowUpSize16Px,\n desc: ArrowDownSize16Px,\n none: DoubleArrowHeadVSize16Px,\n};\n\nconst SortingLabels = {\n asc: 'ascending',\n desc: 'descending',\n none: 'none',\n} as const;\n\nexport const Th = <T,>({header}: ThProps<T>) => {\n const {classes} = useStyles();\n const size = header.column.getSize();\n const width = size !== defaultColumnSizing.size ? size : undefined;\n\n if (header.isPlaceholder) {\n return null;\n }\n\n if (!header.column.getCanSort()) {\n return (\n <th className={classes.th} style={{width}}>\n <Text size=\"xs\" py=\"xs\" px=\"sm\">\n {flexRender(header.column.columnDef.header, header.getContext())}\n </Text>\n </th>\n );\n }\n\n const onSort = header.column.getToggleSortingHandler();\n const sortingOrder = header.column.getIsSorted() || 'none';\n const Icon = SortingIcons[sortingOrder];\n\n return (\n <th className={classes.th} style={{width}} aria-sort={SortingLabels[sortingOrder]}>\n <UnstyledButton onClick={onSort} className={classes.control}>\n <Group position=\"apart\" noWrap>\n <Text size=\"xs\">{flexRender(header.column.columnDef.header, header.getContext())}</Text>\n <Center>\n <Icon height={14} />\n </Center>\n </Group>\n </UnstyledButton>\n </th>\n );\n};\n"],"names":["ArrowDownSize16Px","ArrowUpSize16Px","DoubleArrowHeadVSize16Px","Center","createStyles","Group","Text","UnstyledButton","defaultColumnSizing","flexRender","useStyles","theme","th","fontWeight","padding","color","black","verticalAlign","control","width","spacing","xs","sm","whiteSpace","backgroundColor","colorScheme","colors","gray","SortingIcons","asc","desc","none","SortingLabels","Th","header","classes","size","column","getSize","undefined","isPlaceholder","getCanSort","className","style","py","px","columnDef","getContext","onSort","getToggleSortingHandler","sortingOrder","getIsSorted","Icon","aria-sort","onClick","position","noWrap","height"],"mappings":";AAAA,SAAQA,iBAAiB,EAAEC,eAAe,EAAEC,wBAAwB,QAAO,8BAA8B;AACzG,SAAQC,MAAM,EAAEC,YAAY,EAAEC,KAAK,EAAEC,IAAI,EAAEC,cAAc,QAAO,gBAAgB;AAChF,SAAQC,mBAAmB,EAAEC,UAAU,QAAe,wBAAwB;AAE9E,IAAMC,YAAYN,aAAa,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aAAa;IAEvC,qBACI,KAACtC;QAAG8B,WAAWP,QAAQvB,EAAE;QAAE+B,OAAO;YAACxB,OAAAA;QAAK;QAAGkC,aAAWrB,aAAa,CAACkB,aAAa;kBAC7E,cAAA,KAAC3C;YAAe+C,SAASN;YAAQN,WAAWP,QAAQjB,OAAO;sBACvD,cAAA,MAACb;gBAAMkD,UAAS;gBAAQC,MAAM;;kCAC1B,KAAClD;wBAAK8B,MAAK;kCAAM3B,WAAWyB,OAAOG,MAAM,CAACS,SAAS,CAACZ,MAAM,EAAEA,OAAOa,UAAU;;kCAC7E,KAAC5C;kCACG,cAAA,KAACiD;4BAAKK,QAAQ;;;;;;;AAMtC,EAAE"}
|
package/dist/esm/theme/Theme.js
CHANGED
|
@@ -24,32 +24,32 @@ export var plasmaTheme = {
|
|
|
24
24
|
h1: {
|
|
25
25
|
fontSize: 48,
|
|
26
26
|
lineHeight: "56px",
|
|
27
|
-
fontWeight:
|
|
27
|
+
fontWeight: 300
|
|
28
28
|
},
|
|
29
29
|
h2: {
|
|
30
30
|
fontSize: 32,
|
|
31
31
|
lineHeight: "40px",
|
|
32
|
-
fontWeight:
|
|
32
|
+
fontWeight: 500
|
|
33
33
|
},
|
|
34
34
|
h3: {
|
|
35
|
-
fontSize: 28,
|
|
36
|
-
lineHeight: "40px",
|
|
37
|
-
fontWeight: undefined
|
|
38
|
-
},
|
|
39
|
-
h4: {
|
|
40
35
|
fontSize: 24,
|
|
41
36
|
lineHeight: "32px",
|
|
42
|
-
fontWeight:
|
|
37
|
+
fontWeight: 500
|
|
43
38
|
},
|
|
44
|
-
|
|
39
|
+
h4: {
|
|
45
40
|
fontSize: 18,
|
|
46
41
|
lineHeight: "28px",
|
|
47
|
-
fontWeight:
|
|
42
|
+
fontWeight: 300
|
|
43
|
+
},
|
|
44
|
+
h5: {
|
|
45
|
+
fontSize: 14,
|
|
46
|
+
lineHeight: "20px",
|
|
47
|
+
fontWeight: 500
|
|
48
48
|
},
|
|
49
49
|
h6: {
|
|
50
|
-
fontSize:
|
|
51
|
-
lineHeight: "
|
|
52
|
-
fontWeight:
|
|
50
|
+
fontSize: 12,
|
|
51
|
+
lineHeight: "16px",
|
|
52
|
+
fontWeight: 500
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/theme/Theme.tsx"],"sourcesContent":["import {ArrowHeadRightSize24Px, InfoSize24Px} from '@coveord/plasma-react-icons';\nimport {color} from '@coveord/plasma-tokens';\nimport {ButtonStylesParams, MantineThemeOverride, ModalStylesParams} from '@mantine/core';\n\nimport {PlasmaColors} from './PlasmaColors';\n\nexport const plasmaTheme: MantineThemeOverride = {\n // These are overrides over https://github.com/mantinedev/mantine/blob/master/src/mantine-styles/src/theme/default-theme.ts\n colorScheme: 'light',\n fontFamily: 'canada-type-gibson, sans-serif',\n black: color.primary.gray[9],\n defaultRadius: 8,\n spacing: {\n xs: 8,\n sm: 16,\n md: 24,\n lg: 32,\n xl: 40,\n },\n primaryColor: 'action',\n headings: {\n fontFamily: 'canada-type-gibson, sans-serif',\n fontWeight: 500,\n sizes: {\n h1: {fontSize: 48, lineHeight: '56px', fontWeight: undefined},\n h2: {fontSize: 32, lineHeight: '40px', fontWeight: undefined},\n h3: {fontSize: 28, lineHeight: '40px', fontWeight: undefined},\n h4: {fontSize: 24, lineHeight: '32px', fontWeight: undefined},\n h5: {fontSize: 18, lineHeight: '28px', fontWeight: undefined},\n h6: {fontSize: 16, lineHeight: '24px', fontWeight: undefined},\n },\n },\n shadows: {\n xs: '0px 1px 0px rgba(4, 8, 31, 0.08)',\n sm: '0px 2px 4px rgba(4, 8, 31, 0.12)',\n md: '0px 4px 8px rgba(4, 8, 31, 0.08)',\n lg: '0px 8px 16px rgba(7, 12, 41, 0.06)',\n xl: '0px 16px 24px rgba(4, 8, 31, 0.06)',\n },\n colors: PlasmaColors,\n components: {\n Alert: {\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'navy',\n },\n styles: {\n title: {\n fontWeight: 500,\n },\n },\n },\n Title: {\n styles: (theme) => ({\n root: {\n '&:is(h1,h2,h3,h4,h5,h6)': {letterSpacing: '0.011em', color: theme.colors.gray[9]},\n },\n }),\n },\n Button: {\n styles: (theme, params: ButtonStylesParams) => ({\n root: {\n fontWeight: 400,\n backgroundColor: params.variant === 'outline' ? 'white' : undefined,\n },\n }),\n },\n Modal: {\n styles: (theme, {size, fullScreen}: ModalStylesParams) => ({\n modal: {\n width: fullScreen\n ? undefined\n : theme.fn.size({size, sizes: {xs: 440, sm: 550, md: 800, lg: 1334, xl: '85%'}}),\n },\n }),\n defaultProps: {\n overlayColor: color.primary.navy[9],\n overlayOpacity: 0.9,\n },\n },\n InputWrapper: {\n defaultProps: {\n withAsterisk: false,\n },\n styles: (theme) => ({\n label: {\n marginBottom: theme.spacing.xs,\n lineHeight: '20px',\n },\n description: {\n lineHeight: '20px',\n fontSize: theme.fontSizes.sm,\n color: theme.colors.gray[7],\n marginBottom: theme.spacing.xs,\n },\n invalid: {\n color: theme.colors.red[9],\n borderColor: theme.colors.red[6],\n },\n error: {\n color: theme.colors.red[9],\n },\n }),\n },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: true,\n multiline: true,\n },\n },\n Breadcrumbs: {\n defaultProps: {\n separator: <ArrowHeadRightSize24Px height={24} />,\n },\n },\n Loader: {\n defaultProps: {\n variant: 'dots',\n color: 'action',\n },\n },\n DateRangePicker: {\n styles: {\n cell: {\n textAlign: 'center',\n },\n },\n },\n Anchor: {\n defaultProps: {\n color: 'action',\n },\n styles: (theme) => ({\n root: {\n ...theme.fn.hover({\n textDecoration: 'underline',\n color: theme.colors.action[8],\n }),\n },\n }),\n },\n Checkbox: {\n defaultProps: {\n radius: 'sm',\n },\n },\n List: {\n styles: () => ({\n root: {\n listStyleType: 'disc',\n },\n }),\n },\n Radio: {\n styles: {\n labelWrapper: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n },\n },\n Popover: {\n defaultProps: {\n shadow: 'md',\n withArrow: true,\n },\n },\n Badge: {\n styles: {\n root: {\n textTransform: 'none',\n padding: '4px 8px',\n fontWeight: 500,\n },\n },\n },\n ColorSwatch: {\n defaultProps: {\n size: 8,\n withShadow: false,\n },\n },\n MenuItem: {\n defaultProps: {\n fw: 300,\n },\n },\n },\n};\n"],"names":["ArrowHeadRightSize24Px","InfoSize24Px","color","PlasmaColors","plasmaTheme","colorScheme","fontFamily","black","primary","gray","defaultRadius","spacing","xs","sm","md","lg","xl","primaryColor","headings","fontWeight","sizes","h1","fontSize","lineHeight","undefined","h2","h3","h4","h5","h6","shadows","colors","components","Alert","defaultProps","icon","height","styles","title","Title","theme","root","letterSpacing","Button","params","backgroundColor","variant","Modal","size","fullScreen","modal","width","fn","overlayColor","navy","overlayOpacity","InputWrapper","withAsterisk","label","marginBottom","description","fontSizes","invalid","red","borderColor","error","TextInput","radius","Tooltip","withArrow","withinPortal","multiline","Breadcrumbs","separator","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","padding","ColorSwatch","withShadow","MenuItem","fw"],"mappings":";;AAAA,SAAQA,sBAAsB,EAAEC,YAAY,QAAO,8BAA8B;AACjF,SAAQC,KAAK,QAAO,yBAAyB;AAG7C,SAAQC,YAAY,QAAO,iBAAiB;AAE5C,OAAO,IAAMC,cAAoC;IAC7C,2HAA2H;IAC3HC,aAAa;IACbC,YAAY;IACZC,OAAOL,MAAMM,OAAO,CAACC,IAAI,CAAC,EAAE;IAC5BC,eAAe;IACfC,SAAS;QACLC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;IACR;IACAC,cAAc;IACdC,UAAU;QACNZ,YAAY;QACZa,YAAY;QACZC,OAAO;YACHC,IAAI;gBAACC,UAAU;gBAAIC,YA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,MAAM,CAAC,EAAE;oBACjC;gBAER;;QACJ;QACAC,UAAU;YACNhD,cAAc;gBACViC,QAAQ;YACZ;QACJ;QACAgB,MAAM;YACF9C,QAAQ;uBAAO;oBACXI,MAAM;wBACF2C,eAAe;oBACnB;gBACJ;;QACJ;QACAC,OAAO;YACHhD,QAAQ;gBACJiD,cAAc;oBACVC,SAAS;oBACTC,YAAY;gBAChB;YACJ;QACJ;QACAC,SAAS;YACLvD,cAAc;gBACVwD,QAAQ;gBACRrB,WAAW,IAAI;YACnB;QACJ;QACAsB,OAAO;YACHtD,QAAQ;gBACJI,MAAM;oBACFmD,eAAe;oBACfC,SAAS;oBACT1E,YAAY;gBAChB;YACJ;QACJ;QACA2E,aAAa;YACT5D,cAAc;gBACVc,MAAM;gBACN+C,YAAY,KAAK;YACrB;QACJ;QACAC,UAAU;YACN9D,cAAc;gBACV+D,IAAI;YACR;QACJ;IACJ;AACJ,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../src/theme/Theme.tsx"],"sourcesContent":["import {ArrowHeadRightSize24Px, InfoSize24Px} from '@coveord/plasma-react-icons';\nimport {color} from '@coveord/plasma-tokens';\nimport {ButtonStylesParams, MantineThemeOverride, ModalStylesParams} from '@mantine/core';\n\nimport {PlasmaColors} from './PlasmaColors';\n\nexport const plasmaTheme: MantineThemeOverride = {\n // These are overrides over https://github.com/mantinedev/mantine/blob/master/src/mantine-styles/src/theme/default-theme.ts\n colorScheme: 'light',\n fontFamily: 'canada-type-gibson, sans-serif',\n black: color.primary.gray[9],\n defaultRadius: 8,\n spacing: {\n xs: 8,\n sm: 16,\n md: 24,\n lg: 32,\n xl: 40,\n },\n primaryColor: 'action',\n headings: {\n fontFamily: 'canada-type-gibson, sans-serif',\n fontWeight: 500,\n sizes: {\n h1: {fontSize: 48, lineHeight: '56px', fontWeight: 300},\n h2: {fontSize: 32, lineHeight: '40px', fontWeight: 500},\n h3: {fontSize: 24, lineHeight: '32px', fontWeight: 500},\n h4: {fontSize: 18, lineHeight: '28px', fontWeight: 300},\n h5: {fontSize: 14, lineHeight: '20px', fontWeight: 500},\n h6: {fontSize: 12, lineHeight: '16px', fontWeight: 500},\n },\n },\n shadows: {\n xs: '0px 1px 0px rgba(4, 8, 31, 0.08)',\n sm: '0px 2px 4px rgba(4, 8, 31, 0.12)',\n md: '0px 4px 8px rgba(4, 8, 31, 0.08)',\n lg: '0px 8px 16px rgba(7, 12, 41, 0.06)',\n xl: '0px 16px 24px rgba(4, 8, 31, 0.06)',\n },\n colors: PlasmaColors,\n components: {\n Alert: {\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'navy',\n },\n styles: {\n title: {\n fontWeight: 500,\n },\n },\n },\n Title: {\n styles: (theme) => ({\n root: {\n '&:is(h1,h2,h3,h4,h5,h6)': {letterSpacing: '0.011em', color: theme.colors.gray[9]},\n },\n }),\n },\n Button: {\n styles: (theme, params: ButtonStylesParams) => ({\n root: {\n fontWeight: 400,\n backgroundColor: params.variant === 'outline' ? 'white' : undefined,\n },\n }),\n },\n Modal: {\n styles: (theme, {size, fullScreen}: ModalStylesParams) => ({\n modal: {\n width: fullScreen\n ? undefined\n : theme.fn.size({size, sizes: {xs: 440, sm: 550, md: 800, lg: 1334, xl: '85%'}}),\n },\n }),\n defaultProps: {\n overlayColor: color.primary.navy[9],\n overlayOpacity: 0.9,\n },\n },\n InputWrapper: {\n defaultProps: {\n withAsterisk: false,\n },\n styles: (theme) => ({\n label: {\n marginBottom: theme.spacing.xs,\n lineHeight: '20px',\n },\n description: {\n lineHeight: '20px',\n fontSize: theme.fontSizes.sm,\n color: theme.colors.gray[7],\n marginBottom: theme.spacing.xs,\n },\n invalid: {\n color: theme.colors.red[9],\n borderColor: theme.colors.red[6],\n },\n error: {\n color: theme.colors.red[9],\n },\n }),\n },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: true,\n multiline: true,\n },\n },\n Breadcrumbs: {\n defaultProps: {\n separator: <ArrowHeadRightSize24Px height={24} />,\n },\n },\n Loader: {\n defaultProps: {\n variant: 'dots',\n color: 'action',\n },\n },\n DateRangePicker: {\n styles: {\n cell: {\n textAlign: 'center',\n },\n },\n },\n Anchor: {\n defaultProps: {\n color: 'action',\n },\n styles: (theme) => ({\n root: {\n ...theme.fn.hover({\n textDecoration: 'underline',\n color: theme.colors.action[8],\n }),\n },\n }),\n },\n Checkbox: {\n defaultProps: {\n radius: 'sm',\n },\n },\n List: {\n styles: () => ({\n root: {\n listStyleType: 'disc',\n },\n }),\n },\n Radio: {\n styles: {\n labelWrapper: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n },\n },\n Popover: {\n defaultProps: {\n shadow: 'md',\n withArrow: true,\n },\n },\n Badge: {\n styles: {\n root: {\n textTransform: 'none',\n padding: '4px 8px',\n fontWeight: 500,\n },\n },\n },\n ColorSwatch: {\n defaultProps: {\n size: 8,\n withShadow: false,\n },\n },\n MenuItem: {\n defaultProps: {\n fw: 300,\n },\n },\n },\n};\n"],"names":["ArrowHeadRightSize24Px","InfoSize24Px","color","PlasmaColors","plasmaTheme","colorScheme","fontFamily","black","primary","gray","defaultRadius","spacing","xs","sm","md","lg","xl","primaryColor","headings","fontWeight","sizes","h1","fontSize","lineHeight","h2","h3","h4","h5","h6","shadows","colors","components","Alert","defaultProps","icon","height","styles","title","Title","theme","root","letterSpacing","Button","params","backgroundColor","variant","undefined","Modal","size","fullScreen","modal","width","fn","overlayColor","navy","overlayOpacity","InputWrapper","withAsterisk","label","marginBottom","description","fontSizes","invalid","red","borderColor","error","TextInput","radius","Tooltip","withArrow","withinPortal","multiline","Breadcrumbs","separator","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","padding","ColorSwatch","withShadow","MenuItem","fw"],"mappings":";;AAAA,SAAQA,sBAAsB,EAAEC,YAAY,QAAO,8BAA8B;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E;oBAAuBmC,QAAQ;;YAC/C;QACJ;QACAuC,QAAQ;YACJzC,cAAc;gBACVY,SAAS;gBACT3C,OAAO;YACX;QACJ;QACAyE,iBAAiB;YACbvC,QAAQ;gBACJwC,MAAM;oBACFC,WAAW;gBACf;YACJ;QACJ;QACAC,QAAQ;YACJ7C,cAAc;gBACV/B,OAAO;YACX;YACAkC,QAAQ,SAACG;uBAAW;oBAChBC,MAAM,mBACCD,MAAMa,EAAE,CAAC2B,KAAK,CAAC;wBACdC,gBAAgB;wBAChB9E,OAAOqC,MAAMT,MAAM,CAACmD,MAAM,CAAC,EAAE;oBACjC;gBAER;;QACJ;QACAC,UAAU;YACNjD,cAAc;gBACVkC,QAAQ;YACZ;QACJ;QACAgB,MAAM;YACF/C,QAAQ;uBAAO;oBACXI,MAAM;wBACF4C,eAAe;oBACnB;gBACJ;;QACJ;QACAC,OAAO;YACHjD,QAAQ;gBACJkD,cAAc;oBACVC,SAAS;oBACTC,YAAY;gBAChB;YACJ;QACJ;QACAC,SAAS;YACLxD,cAAc;gBACVyD,QAAQ;gBACRrB,WAAW,IAAI;YACnB;QACJ;QACAsB,OAAO;YACHvD,QAAQ;gBACJI,MAAM;oBACFoD,eAAe;oBACfC,SAAS;oBACT1E,YAAY;gBAChB;YACJ;QACJ;QACA2E,aAAa;YACT7D,cAAc;gBACVe,MAAM;gBACN+C,YAAY,KAAK;YACrB;QACJ;QACAC,UAAU;YACN/D,cAAc;gBACVgE,IAAI;YACR;QACJ;IACJ;AACJ,EAAE"}
|
package/package.json
CHANGED
|
@@ -8,23 +8,23 @@ describe('Header', () => {
|
|
|
8
8
|
|
|
9
9
|
const header = screen.getByRole('heading');
|
|
10
10
|
expect(header).toMatchInlineSnapshot(`
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
<h4
|
|
12
|
+
class="mantine-Text-root mantine-Title-root mantine-xv5lu6"
|
|
13
|
+
>
|
|
14
|
+
<div
|
|
15
|
+
class="mantine-Group-root mantine-fila1z"
|
|
13
16
|
>
|
|
14
17
|
<div
|
|
15
|
-
class="mantine-
|
|
18
|
+
class="mantine-Breadcrumbs-root mantine-16ttirm"
|
|
16
19
|
>
|
|
17
20
|
<div
|
|
18
|
-
class="mantine-
|
|
21
|
+
class="mantine-1iqrsug mantine-Breadcrumbs-breadcrumb"
|
|
19
22
|
>
|
|
20
|
-
|
|
21
|
-
class="mantine-1iqrsug mantine-Breadcrumbs-breadcrumb"
|
|
22
|
-
>
|
|
23
|
-
child 1
|
|
24
|
-
</div>
|
|
23
|
+
child 1
|
|
25
24
|
</div>
|
|
26
25
|
</div>
|
|
27
|
-
</
|
|
26
|
+
</div>
|
|
27
|
+
</h4>
|
|
28
28
|
`);
|
|
29
29
|
});
|
|
30
30
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {ArrowDownSize16Px, ArrowUpSize16Px, DoubleArrowHeadVSize16Px} from '@coveord/plasma-react-icons';
|
|
2
2
|
import {Center, createStyles, Group, Text, UnstyledButton} from '@mantine/core';
|
|
3
3
|
import {defaultColumnSizing, flexRender, Header} from '@tanstack/react-table';
|
|
4
4
|
|
|
@@ -26,13 +26,15 @@ interface ThProps<T> {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const SortingIcons = {
|
|
29
|
-
asc:
|
|
30
|
-
desc:
|
|
29
|
+
asc: ArrowUpSize16Px,
|
|
30
|
+
desc: ArrowDownSize16Px,
|
|
31
|
+
none: DoubleArrowHeadVSize16Px,
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
const SortingLabels = {
|
|
34
35
|
asc: 'ascending',
|
|
35
36
|
desc: 'descending',
|
|
37
|
+
none: 'none',
|
|
36
38
|
} as const;
|
|
37
39
|
|
|
38
40
|
export const Th = <T,>({header}: ThProps<T>) => {
|
|
@@ -55,15 +57,15 @@ export const Th = <T,>({header}: ThProps<T>) => {
|
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
const onSort = header.column.getToggleSortingHandler();
|
|
58
|
-
const sortingOrder = header.column.getIsSorted();
|
|
59
|
-
const Icon = SortingIcons[sortingOrder
|
|
60
|
+
const sortingOrder = header.column.getIsSorted() || 'none';
|
|
61
|
+
const Icon = SortingIcons[sortingOrder];
|
|
60
62
|
|
|
61
63
|
return (
|
|
62
|
-
<th className={classes.th} style={{width}} aria-sort={
|
|
64
|
+
<th className={classes.th} style={{width}} aria-sort={SortingLabels[sortingOrder]}>
|
|
63
65
|
<UnstyledButton onClick={onSort} className={classes.control}>
|
|
64
66
|
<Group position="apart" noWrap>
|
|
65
67
|
<Text size="xs">{flexRender(header.column.columnDef.header, header.getContext())}</Text>
|
|
66
|
-
<Center
|
|
68
|
+
<Center>
|
|
67
69
|
<Icon height={14} />
|
|
68
70
|
</Center>
|
|
69
71
|
</Group>
|
|
@@ -22,15 +22,11 @@ describe('Th', () => {
|
|
|
22
22
|
];
|
|
23
23
|
render(<Table data={data} columns={columns} />);
|
|
24
24
|
|
|
25
|
-
// icons are loadable, wait for them to load
|
|
26
|
-
await screen.findByRole('img', {name: 'arrowHeadDown'});
|
|
27
|
-
await screen.findByRole('img', {name: 'arrowHeadUp'});
|
|
28
|
-
|
|
29
25
|
const headers = screen.getAllByRole('button');
|
|
30
26
|
expect(headers.length).toBe(2);
|
|
31
27
|
|
|
32
|
-
expect(headers[0]).toHaveAccessibleName(
|
|
33
|
-
expect(headers[1]).toHaveAccessibleName(
|
|
28
|
+
expect(headers[0]).toHaveAccessibleName(/name doubleArrowHead/i);
|
|
29
|
+
expect(headers[1]).toHaveAccessibleName(/type doubleArrowHead/i);
|
|
34
30
|
});
|
|
35
31
|
|
|
36
32
|
it('changes the sort icon when clicking on a table header', async () => {
|
|
@@ -41,22 +37,17 @@ describe('Th', () => {
|
|
|
41
37
|
const onChange = vi.fn();
|
|
42
38
|
render(<Table data={data} columns={columns} onChange={onChange} />);
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
await screen.findAllByRole('img', {name: 'arrowHeadDown'});
|
|
46
|
-
await screen.findAllByRole('img', {name: 'arrowHeadUp'});
|
|
47
|
-
|
|
48
|
-
userEvent.click(screen.getByRole('button', {name: /name arrowheaddown/i}));
|
|
40
|
+
userEvent.click(screen.getByRole('button', {name: /name doubleArrowHead/i}));
|
|
49
41
|
await waitFor(() => {
|
|
50
42
|
expect(onChange).toHaveBeenCalledWith(expect.objectContaining({sorting: [{id: 'name', desc: false}]}));
|
|
51
43
|
});
|
|
52
44
|
|
|
53
|
-
userEvent.click(screen.getByRole('button', {name:
|
|
45
|
+
userEvent.click(screen.getByRole('button', {name: /name arrowUp/i}));
|
|
54
46
|
await waitFor(() => {
|
|
55
47
|
expect(onChange).toHaveBeenCalledWith(expect.objectContaining({sorting: [{id: 'name', desc: true}]}));
|
|
56
48
|
});
|
|
57
49
|
|
|
58
|
-
|
|
59
|
-
userEvent.click(screen.getByRole('button', {name: 'name arrowHeadUp'}));
|
|
50
|
+
userEvent.click(screen.getByRole('button', {name: /name arrowDown/i}));
|
|
60
51
|
await waitFor(() => {
|
|
61
52
|
expect(onChange).toHaveBeenCalledWith(expect.objectContaining({sorting: [{id: 'name', desc: false}]}));
|
|
62
53
|
});
|
package/src/theme/Theme.tsx
CHANGED
|
@@ -22,12 +22,12 @@ export const plasmaTheme: MantineThemeOverride = {
|
|
|
22
22
|
fontFamily: 'canada-type-gibson, sans-serif',
|
|
23
23
|
fontWeight: 500,
|
|
24
24
|
sizes: {
|
|
25
|
-
h1: {fontSize: 48, lineHeight: '56px', fontWeight:
|
|
26
|
-
h2: {fontSize: 32, lineHeight: '40px', fontWeight:
|
|
27
|
-
h3: {fontSize:
|
|
28
|
-
h4: {fontSize:
|
|
29
|
-
h5: {fontSize:
|
|
30
|
-
h6: {fontSize:
|
|
25
|
+
h1: {fontSize: 48, lineHeight: '56px', fontWeight: 300},
|
|
26
|
+
h2: {fontSize: 32, lineHeight: '40px', fontWeight: 500},
|
|
27
|
+
h3: {fontSize: 24, lineHeight: '32px', fontWeight: 500},
|
|
28
|
+
h4: {fontSize: 18, lineHeight: '28px', fontWeight: 300},
|
|
29
|
+
h5: {fontSize: 14, lineHeight: '20px', fontWeight: 500},
|
|
30
|
+
h6: {fontSize: 12, lineHeight: '16px', fontWeight: 500},
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
shadows: {
|