@coveord/plasma-mantine 49.3.4 → 49.3.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/table/Table.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\ninterface TableStylesParams {\n hasHeader: boolean;\n multiRowSelectionEnabled: boolean;\n}\n\nconst useStyles = createStyles<string, TableStylesParams>((theme, {hasHeader, multiRowSelectionEnabled}) => {\n const rowBackgroundColor =\n theme.colorScheme === 'dark'\n ? theme.fn.rgba(theme.colors[theme.primaryColor][7], 0.2)\n : theme.colors[theme.primaryColor][0];\n return {\n table: {\n width: '100%',\n '& td:first-of-type, th:first-of-type > *': {\n paddingLeft: theme.spacing.xl,\n },\n '& tbody td': {\n verticalAlign: 'top',\n },\n },\n\n header: {\n position: 'sticky',\n top: hasHeader ? 69 : 0,\n backgroundColor: theme.colorScheme === 'dark' ? theme.black : theme.white,\n transition: 'box-shadow 150ms ease',\n zIndex: 12, // skeleton is 11\n\n '&::after': {\n content: '\"\"',\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: 0,\n borderBottom: `1px solid ${theme.colors.gray[2]}`,\n },\n },\n\n rowSelected: {\n backgroundColor: multiRowSelectionEnabled ? undefined : rowBackgroundColor,\n },\n\n rowCollapsibleButtonCell: {\n textAlign: 'right',\n padding: `${theme.spacing.xs / 2}px ${theme.spacing.sm}px !important`,\n },\n\n row: {\n '&:hover': {\n backgroundColor: rowBackgroundColor,\n },\n },\n };\n});\n\nexport default useStyles;\n"],"names":["createStyles","useStyles","theme","hasHeader","multiRowSelectionEnabled","rowBackgroundColor","colorScheme","fn","rgba","colors","primaryColor","table","width","paddingLeft","spacing","xl","verticalAlign","header","position","top","backgroundColor","black","white","transition","zIndex","content","left","right","bottom","borderBottom","gray","rowSelected","undefined","rowCollapsibleButtonCell","textAlign","padding","xs","sm","row"],"mappings":"AAAA,SAAQA,YAAY,QAAO,gBAAgB;AAO3C,IAAMC,YAAYD,aAAwC,SAACE,cAAiD;QAAzCC,kBAAAA,WAAWC,iCAAAA;IAC1E,IAAMC,qBACFH,MAAMI,WAAW,KAAK,SAChBJ,MAAMK,EAAE,CAACC,IAAI,CAACN,MAAMO,MAAM,CAACP,MAAMQ,YAAY,CAAC,CAAC,EAAE,EAAE,OACnDR,MAAMO,MAAM,CAACP,MAAMQ,YAAY,CAAC,CAAC,EAAE;IAC7C,OAAO;QACHC,OAAO;YACHC,OAAO;YACP,4CAA4C;gBACxCC,aAAaX,MAAMY,OAAO,CAACC,EAAE;YACjC;YACA,cAAc;gBACVC,eAAe;YACnB;QACJ;QAEAC,QAAQ;YACJC,UAAU;YACVC,KAAKhB,YAAY,KAAK,CAAC;YACvBiB,iBAAiBlB,MAAMI,WAAW,KAAK,SAASJ,MAAMmB,KAAK,GAAGnB,MAAMoB,KAAK;YACzEC,YAAY;YACZC,QAAQ;YAER,YAAY;gBACRC,SAAS;gBACTP,UAAU;gBACVQ,MAAM;gBACNC,OAAO;gBACPC,QAAQ;gBACRC,cAAc,AAAC,aAAiC,OAArB3B,MAAMO,MAAM,CAACqB,IAAI,CAAC,EAAE;YACnD;QACJ;QAEAC,aAAa;YACTX,iBAAiBhB,2BAA2B4B,YAAY3B,kBAAkB;QAC9E;QAEA4B,0BAA0B;YACtBC,WAAW;YACXC,SAAS,AAAC,GAA4BjC,OAA1BA,MAAMY,OAAO,CAACsB,EAAE,GAAG,GAAE,OAAsB,OAAjBlC,MAAMY,OAAO,CAACuB,EAAE,EAAC;QAC3D;QAEAC,KAAK;YACD,WAAW;gBACPlB,iBAAiBf;YACrB;QACJ;IACJ;AACJ;AAEA,eAAeJ,UAAU"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveord/plasma-mantine",
3
- "version": "49.3.4",
3
+ "version": "49.3.5",
4
4
  "description": "A Plasma flavoured Mantine theme",
5
5
  "keywords": [
6
6
  "plasma",
@@ -24,7 +24,7 @@
24
24
  "lodash.defaultsdeep": "4.6.1",
25
25
  "monaco-editor": "0.34.0",
26
26
  "react-beautiful-dnd": "13.1.1",
27
- "@coveord/plasma-react-icons": "49.2.2",
27
+ "@coveord/plasma-react-icons": "49.3.5",
28
28
  "@coveord/plasma-tokens": "48.25.0"
29
29
  },
30
30
  "devDependencies": {
@@ -35,7 +35,7 @@
35
35
  "@mantine/form": "5.9.2",
36
36
  "@mantine/hooks": "5.9.2",
37
37
  "@mantine/modals": "5.9.2",
38
- "@swc/cli": "0.1.57",
38
+ "@swc/cli": "0.1.61",
39
39
  "@swc/core": "1.3.31",
40
40
  "@swc/jest": "0.2.23",
41
41
  "@testing-library/dom": "8.18.1",
@@ -19,7 +19,7 @@ interface CollectionItemSharedProps extends DefaultProps<Selectors<typeof useSty
19
19
  const RemoveButton: FunctionComponent<{
20
20
  onClick: React.MouseEventHandler<HTMLButtonElement>;
21
21
  }> = ({onClick}) => (
22
- <ActionIcon variant="subtle" onClick={onClick} color="action">
22
+ <ActionIcon sx={{alignSelf: 'center'}} variant="subtle" onClick={onClick} color="action">
23
23
  <RemoveSize16Px height={16} />
24
24
  </ActionIcon>
25
25
  );
@@ -69,7 +69,7 @@ const DraggableCollectionItem: FunctionComponent<PropsWithChildren<CollectionIte
69
69
  {...provided.draggableProps}
70
70
  className={cx(classes.item, {[classes.itemDragging]: isDragging})}
71
71
  >
72
- <div {...provided.dragHandleProps}>
72
+ <div {...provided.dragHandleProps} style={{alignSelf: 'center'}}>
73
73
  <DragAndDropSize16Px height={16} />
74
74
  </div>
75
75
  {children}
@@ -0,0 +1,58 @@
1
+ import {createStyles} from '@mantine/core';
2
+
3
+ interface TableStylesParams {
4
+ hasHeader: boolean;
5
+ multiRowSelectionEnabled: boolean;
6
+ }
7
+
8
+ const useStyles = createStyles<string, TableStylesParams>((theme, {hasHeader, multiRowSelectionEnabled}) => {
9
+ const rowBackgroundColor =
10
+ theme.colorScheme === 'dark'
11
+ ? theme.fn.rgba(theme.colors[theme.primaryColor][7], 0.2)
12
+ : theme.colors[theme.primaryColor][0];
13
+ return {
14
+ table: {
15
+ width: '100%',
16
+ '& td:first-of-type, th:first-of-type > *': {
17
+ paddingLeft: theme.spacing.xl,
18
+ },
19
+ '& tbody td': {
20
+ verticalAlign: 'top',
21
+ },
22
+ },
23
+
24
+ header: {
25
+ position: 'sticky',
26
+ top: hasHeader ? 69 : 0,
27
+ backgroundColor: theme.colorScheme === 'dark' ? theme.black : theme.white,
28
+ transition: 'box-shadow 150ms ease',
29
+ zIndex: 12, // skeleton is 11
30
+
31
+ '&::after': {
32
+ content: '""',
33
+ position: 'absolute',
34
+ left: 0,
35
+ right: 0,
36
+ bottom: 0,
37
+ borderBottom: `1px solid ${theme.colors.gray[2]}`,
38
+ },
39
+ },
40
+
41
+ rowSelected: {
42
+ backgroundColor: multiRowSelectionEnabled ? undefined : rowBackgroundColor,
43
+ },
44
+
45
+ rowCollapsibleButtonCell: {
46
+ textAlign: 'right',
47
+ padding: `${theme.spacing.xs / 2}px ${theme.spacing.sm}px !important`,
48
+ },
49
+
50
+ row: {
51
+ '&:hover': {
52
+ backgroundColor: rowBackgroundColor,
53
+ },
54
+ },
55
+ };
56
+ });
57
+
58
+ export default useStyles;
@@ -1,4 +1,4 @@
1
- import {Box, Center, Collapse, createStyles, Loader, Skeleton, Table as MantineTable} from '@mantine/core';
1
+ import {Box, Center, Collapse, Loader, Skeleton, Table as MantineTable} from '@mantine/core';
2
2
  import {useForm} from '@mantine/form';
3
3
  import {useClickOutside, useDidUpdate} from '@mantine/hooks';
4
4
  import {
@@ -15,6 +15,7 @@ import debounce from 'lodash.debounce';
15
15
  import defaultsDeep from 'lodash.defaultsdeep';
16
16
  import {Children, Fragment, ReactElement, ReactNode, useCallback, useEffect, useState} from 'react';
17
17
 
18
+ import useStyles from './Table.styles';
18
19
  import {TableActions} from './TableActions';
19
20
  import {TableAccordionColumn, TableCollapsibleColumn} from './TableCollapsibleColumn';
20
21
  import {onTableChangeEvent, TableContext, TableFormType} from './TableContext';
@@ -29,61 +30,6 @@ import {TableSelectableColumn} from './TableSelectableColumn';
29
30
  import {Th} from './Th';
30
31
  import {useRowSelection} from './useRowSelection';
31
32
 
32
- interface TableStylesParams {
33
- hasHeader: boolean;
34
- multiRowSelectionEnabled: boolean;
35
- }
36
-
37
- const useStyles = createStyles<string, TableStylesParams>((theme, {hasHeader, multiRowSelectionEnabled}) => {
38
- const rowBackgroundColor =
39
- theme.colorScheme === 'dark'
40
- ? theme.fn.rgba(theme.colors[theme.primaryColor][7], 0.2)
41
- : theme.colors[theme.primaryColor][0];
42
- return {
43
- table: {
44
- width: '100%',
45
- '& td:first-of-type, th:first-of-type > *': {
46
- paddingLeft: theme.spacing.xl,
47
- },
48
- '& tbody td': {
49
- verticalAlign: 'top',
50
- },
51
- },
52
-
53
- header: {
54
- position: 'sticky',
55
- top: hasHeader ? 69 : 0,
56
- backgroundColor: theme.colorScheme === 'dark' ? theme.black : theme.white,
57
- transition: 'box-shadow 150ms ease',
58
- zIndex: 12, // skeleton is 11
59
-
60
- '&::after': {
61
- content: '""',
62
- position: 'absolute',
63
- left: 0,
64
- right: 0,
65
- bottom: 0,
66
- borderBottom: `1px solid ${theme.colors.gray[2]}`,
67
- },
68
- },
69
-
70
- rowSelected: {
71
- backgroundColor: multiRowSelectionEnabled ? undefined : rowBackgroundColor,
72
- },
73
-
74
- rowCollapsibleButtonCell: {
75
- textAlign: 'right',
76
- padding: `${theme.spacing.xs / 2}px ${theme.spacing.sm}px !important`,
77
- },
78
-
79
- row: {
80
- '&:hover': {
81
- backgroundColor: rowBackgroundColor,
82
- },
83
- },
84
- };
85
- });
86
-
87
33
  export interface TableProps<T> {
88
34
  /**
89
35
  * Data to display in the table