@rpcbase/client 0.214.0 → 0.216.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.
Files changed (30) hide show
  1. package/access-control/ACLForm/components/GrantField/OpSelector.tsx +129 -0
  2. package/access-control/ACLForm/components/GrantField/ResourceSelector.tsx +86 -0
  3. package/access-control/ACLForm/components/GrantField/UsersSelector.tsx +96 -0
  4. package/access-control/ACLForm/components/GrantField/grant-field.scss +26 -0
  5. package/access-control/ACLForm/components/GrantField/icons/CheckMark.tsx +16 -0
  6. package/access-control/ACLForm/components/GrantField/icons/CollapseArrow.tsx +14 -0
  7. package/access-control/ACLForm/components/GrantField/icons/ExpandArrow.tsx +14 -0
  8. package/access-control/ACLForm/components/GrantField/index.tsx +91 -0
  9. package/access-control/ACLForm/components/GrantsList.tsx +48 -0
  10. package/access-control/ACLForm/components/RoleForm.tsx +134 -0
  11. package/access-control/ACLForm/components/RoleView.tsx +115 -0
  12. package/access-control/ACLForm/components/RolesList.tsx +79 -0
  13. package/access-control/ACLForm/components/constants.tsx +1 -0
  14. package/access-control/ACLForm/components/resolver.ts +57 -0
  15. package/access-control/ACLForm/components/role-form.scss +19 -0
  16. package/access-control/ACLForm/index.tsx +48 -0
  17. package/access-control/ACLModal/acl-modal.scss +7 -0
  18. package/access-control/ACLModal/index.tsx +66 -0
  19. package/access-control/PolicyEditor/TargetSelector/QueryBuilder.tsx +48 -0
  20. package/access-control/PolicyEditor/TargetSelector/index.tsx +5 -0
  21. package/access-control/PolicyEditor/TargetSelector/query-builder.scss +9 -0
  22. package/access-control/PolicyEditor/index.tsx +70 -0
  23. package/access-control/index.ts +3 -0
  24. package/firebase/index.js +1 -1
  25. package/firebase/sw.js +1 -1
  26. package/package.json +10 -10
  27. package/ui/SelectPills/index.tsx +96 -0
  28. package/ui/SelectPills/select-pills.scss +66 -0
  29. package/ui/icons/Close.tsx +14 -0
  30. package/ui/icons/index.tsx +1 -0
@@ -0,0 +1,96 @@
1
+ import "./select-pills.scss"
2
+
3
+
4
+ type Props = {
5
+ direction?: "row" | "col";
6
+ size?: "md" | "sm";
7
+ items: Array<{ key: string; icon?: string; name: string; description?: string }>;
8
+ onChange: (key: string) => void;
9
+ activeKey?: string;
10
+ };
11
+
12
+ export const SelectPills= ({
13
+ direction = "row",
14
+ size = "md",
15
+ items,
16
+ onChange,
17
+ activeKey,
18
+ }: Props) => {
19
+ const handleSelectType = (type: string) => () => {
20
+ onChange(type)
21
+ }
22
+
23
+ const renderRow = () => {
24
+ const iconSize = size === "sm" ? "24px" : "32px"
25
+
26
+ return (
27
+ <div className={`select-pills mb-3 card-group direction-row`}>
28
+ {items.map((item, index) => (
29
+ <div
30
+ key={`pill-${index}`}
31
+ id={`select-pill-${item.key}`}
32
+ className={`card select-pill ${activeKey === item.key ? "active" : ""}`}
33
+ onClick={handleSelectType(item.key)}
34
+ >
35
+ <div className={`card-body d-flex p-2 ${item.description ? "flex-row" : "flex-column"}`}>
36
+ {item.icon && (
37
+ <img
38
+ className="d-flex mx-auto align-self-center"
39
+ width={iconSize}
40
+ height={iconSize}
41
+ src={item.icon}
42
+ />
43
+ )}
44
+ <div className={`flex-column ${item.description ? "ms-3" : "text-center mt-2"}`}>
45
+ <h6 className="card-title mb-1 fw-bold">{item.name}</h6>
46
+ {item.description && (<p className="card-text">{item.description}</p>)}
47
+ </div>
48
+ </div>
49
+ </div>
50
+ ))}
51
+ </div>
52
+ )
53
+ }
54
+
55
+ const renderCol = () => {
56
+ const iconSize = size === "sm" ? "24px" : "32px"
57
+
58
+ return (
59
+ <div className="select-pills">
60
+ {items.map((item, index) => (
61
+ <div
62
+ key={`pill-${index}`}
63
+ id={`select-pill-${item.key}`}
64
+ className={`card select-pill direction-col ${activeKey === item.key ? "active" : ""}`}
65
+ onClick={handleSelectType(item.key)}
66
+ >
67
+ <div className="card-body d-flex flex-row px-2 py-3">
68
+ {item.icon && (
69
+ <img
70
+ className="d-flex align-self-center me-2"
71
+ style={{width: iconSize, height: iconSize}}
72
+ src={item.icon}
73
+ />
74
+ )}
75
+
76
+ {size === "md" && (
77
+ <div className="flex-column">
78
+ <h6 className="card-title mb-1 fw-bold">{item.name}</h6>
79
+ <p className="card-text">{item.description}</p>
80
+ </div>
81
+ )}
82
+ {size === "sm" && (
83
+ <div className="">
84
+ <h6 className="card-title my-0 d-inline-block me-1 fw-bold">{item.name}</h6>
85
+ <span className="card-text">{item.description}</span>
86
+ </div>
87
+ )}
88
+ </div>
89
+ </div>
90
+ ))}
91
+ </div>
92
+ )
93
+ }
94
+
95
+ return direction === "row" ? renderRow() : renderCol()
96
+ }
@@ -0,0 +1,66 @@
1
+ @import "helpers";
2
+
3
+ .select-pills {
4
+ .card.select-pill {
5
+ cursor: pointer;
6
+ user-select: none;
7
+
8
+ &:hover {
9
+ background: $light;
10
+ }
11
+
12
+ &:active {
13
+ background: $gray-300;
14
+ }
15
+
16
+ &.active {
17
+ background: $blue-300;
18
+ color: $white;
19
+ }
20
+ }
21
+
22
+ .select-pill {
23
+ .card-text {
24
+ color: $gray-600;
25
+ }
26
+
27
+ &.active,
28
+ &:active {
29
+ .card-text {
30
+ color: $gray-200;
31
+ }
32
+ }
33
+ }
34
+
35
+ .card.select-pill.direction-col {
36
+ cursor: pointer;
37
+ user-select: none;
38
+ border-radius: 0;
39
+ border-bottom: none;
40
+
41
+ &:first-child {
42
+ border-top-left-radius: 3px;
43
+ border-top-right-radius: 3px;
44
+ }
45
+
46
+ &:last-child {
47
+ border-bottom-left-radius: 3px;
48
+ border-bottom-right-radius: 3px;
49
+ border-bottom: 1px solid rgba(0, 0, 0, 0.125);
50
+ }
51
+
52
+ &:hover {
53
+ background: $light;
54
+ }
55
+
56
+ &:active {
57
+ background: $gray-300;
58
+ }
59
+
60
+ &.active {
61
+ background: $primary;
62
+ border-color: darken($primary, 15%);
63
+ color: $white;
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,14 @@
1
+
2
+ export const CloseIcon = ({size = 16}) => {
3
+ return (
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 0 16 16"
7
+ fill="currentColor"
8
+ width={size}
9
+ height={size}
10
+ >
11
+ <path d="M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z" />
12
+ </svg>
13
+ )
14
+ }
@@ -1,5 +1,6 @@
1
1
 
2
2
  export * from "./AddAccount"
3
3
  export * from "./Billing"
4
+ export * from "./Close"
4
5
  export * from "./Organization"
5
6
  export * from "./Signout"