authscape 1.0.388 → 1.0.390

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.388",
3
+ "version": "1.0.390",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,23 @@
1
+ import React, {forwardRef, CSSProperties} from 'react';
2
+ // import classNames from 'classnames';
3
+
4
+ export const Action = forwardRef(
5
+ ({active, className, cursor, style, ...props}, ref) => {
6
+ return (
7
+ <button
8
+ ref={ref}
9
+ {...props}
10
+ className={"Action"}
11
+ tabIndex={0}
12
+ style={
13
+ {
14
+ ...style,
15
+ cursor,
16
+ '--fill': active?.fill,
17
+ '--background': active?.background,
18
+ }
19
+ }
20
+ />
21
+ );
22
+ }
23
+ );
@@ -0,0 +1,67 @@
1
+ import React, {forwardRef} from 'react';
2
+ import classNames from 'classnames';
3
+
4
+ // import { Handle } from './Handle';
5
+ // import { Remove } from './Remove';
6
+
7
+ // import styles from './dist/Container.module.css';
8
+
9
+ export const Container = forwardRef(
10
+ (
11
+ {
12
+ children,
13
+ columns = 1,
14
+ handleProps,
15
+ horizontal,
16
+ hover,
17
+ onClick,
18
+ containerStyles,
19
+ onRemove,
20
+ label,
21
+ placeholder,
22
+ style,
23
+ scrollable,
24
+ shadow,
25
+ unstyled,
26
+ ...props
27
+ },
28
+ ref
29
+ ) => {
30
+ const Component = onClick ? 'button' : 'div';
31
+
32
+ return (
33
+ <Component
34
+ {...props}
35
+ ref={ref}
36
+ style={
37
+ {
38
+ ...style,
39
+ '--columns': columns,
40
+ }
41
+ }
42
+ className={classNames(
43
+ containerStyles.Container,
44
+ unstyled && containerStyles.unstyled,
45
+ horizontal && containerStyles.horizontal,
46
+ hover && containerStyles.hover,
47
+ placeholder && containerStyles.placeholder,
48
+ scrollable && containerStyles.scrollable,
49
+ shadow && containerStyles.shadow
50
+ )}
51
+ onClick={onClick}
52
+ tabIndex={onClick ? 0 : undefined}
53
+ >
54
+ {label ? (
55
+ <div className={"Header"}>
56
+ {label}
57
+ <div className={"Actions"}>
58
+ {onRemove ? <Remove onClick={onRemove} /> : undefined}
59
+ <Handle {...handleProps} />
60
+ </div>
61
+ </div>
62
+ ) : null}
63
+ {placeholder ? children : <ul style={{paddingLeft:"10px", paddingRight:"10px", marginTop:"5px"}}>{children}</ul>}
64
+ </Component>
65
+ );
66
+ }
67
+ );
@@ -0,0 +1,20 @@
1
+ import React, {forwardRef} from 'react';
2
+
3
+ // import {Action} from './Action';
4
+
5
+ export const Handle = forwardRef(
6
+ (props, ref) => {
7
+ return (
8
+ <Action
9
+ ref={ref}
10
+ cursor="grab"
11
+ data-cypress="draggable-handle"
12
+ {...props}
13
+ >
14
+ <svg viewBox="0 0 20 20" width="12">
15
+ <path d="M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"></path>
16
+ </svg>
17
+ </Action>
18
+ );
19
+ }
20
+ );
@@ -0,0 +1,140 @@
1
+ import React, {useEffect} from 'react';
2
+ import classNames from 'classnames';
3
+
4
+ // import { Handle } from './Handle';
5
+ // import { Remove } from './Remove';
6
+
7
+ // import styles from './dist/Item.module.css';
8
+ import { Box } from '@mui/material';
9
+
10
+ export const Item = React.memo(
11
+ React.forwardRef(
12
+ (
13
+ {
14
+ color,
15
+ dragOverlay,
16
+ dragging,
17
+ disabled,
18
+ fadeIn,
19
+ name,
20
+ handle,
21
+ handleProps,
22
+ height,
23
+ itemStyles,
24
+ cardDetail,
25
+ CardTemplate,
26
+ index,
27
+ listeners,
28
+ onRemove,
29
+ renderItem,
30
+ sorting,
31
+ style,
32
+ transition,
33
+ transform,
34
+ value,
35
+ handleMoreClick,
36
+ handleMoreClose,
37
+ wrapperStyle,
38
+ ...props
39
+ },
40
+ ref
41
+ ) => {
42
+ useEffect(() => {
43
+ if (!dragOverlay) {
44
+ return;
45
+ }
46
+
47
+ document.body.style.cursor = 'grabbing';
48
+
49
+ return () => {
50
+ document.body.style.cursor = '';
51
+ };
52
+ }, [dragOverlay]);
53
+
54
+ cardDetail.moreClicked = handleMoreClick;
55
+
56
+ return renderItem ? (
57
+ renderItem({
58
+ dragOverlay: Boolean(dragOverlay),
59
+ dragging: Boolean(dragging),
60
+ sorting: Boolean(sorting),
61
+ index,
62
+ fadeIn: Boolean(fadeIn),
63
+ listeners,
64
+ ref,
65
+ style,
66
+ transform,
67
+ transition,
68
+ value,
69
+ })
70
+ ) : (
71
+ <li
72
+ className={classNames(
73
+ itemStyles.Wrapper,
74
+ fadeIn && itemStyles.fadeIn,
75
+ sorting && itemStyles.sorting,
76
+ dragOverlay && itemStyles.dragOverlay
77
+ )}
78
+ style={
79
+ {
80
+ ...wrapperStyle,
81
+ transition: [transition, wrapperStyle?.transition]
82
+ .filter(Boolean)
83
+ .join(', '),
84
+ '--translate-x': transform
85
+ ? `${Math.round(transform.x)}px`
86
+ : undefined,
87
+ '--translate-y': transform
88
+ ? `${Math.round(transform.y)}px`
89
+ : undefined,
90
+ '--scale-x': transform?.scaleX
91
+ ? `${transform.scaleX}`
92
+ : undefined,
93
+ '--scale-y': transform?.scaleY
94
+ ? `${transform.scaleY}`
95
+ : undefined,
96
+ '--index': index,
97
+ '--color': color,
98
+ paddingTop:"10px"
99
+ }
100
+ }
101
+ ref={ref}
102
+ >
103
+ <Box
104
+ className={classNames(
105
+ itemStyles.Item,
106
+ dragging && itemStyles.dragging,
107
+ handle && itemStyles.withHandle,
108
+ dragOverlay && itemStyles.dragOverlay,
109
+ disabled && itemStyles.disabled,
110
+ color && itemStyles.color
111
+ )}
112
+ style={style}
113
+ data-cypress="draggable-item"
114
+ {...(!handle ? listeners : undefined)}
115
+ {...props}
116
+ tabIndex={!handle ? 0 : undefined}>
117
+
118
+
119
+ {CardTemplate != null &&
120
+ <CardTemplate props={cardDetail} />
121
+ }
122
+
123
+ {CardTemplate == null &&
124
+ <Box>
125
+ {name}
126
+ </Box>
127
+ }
128
+
129
+ <span className={"Actions"}>
130
+ {onRemove ? (
131
+ <Remove className={"Remove"} onClick={onRemove} />
132
+ ) : null}
133
+ {handle ? <Handle {...handleProps} {...listeners} /> : null}
134
+ </span>
135
+ </Box>
136
+ </li>
137
+ );
138
+ }
139
+ )
140
+ );