@saleor/macaw-ui 0.2.3 → 0.2.7
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/README.md +7 -0
- package/dist/ActionBar/ActionBar.d.ts +8 -0
- package/dist/ActionBar/context.d.ts +9 -0
- package/dist/ActionBar/index.d.ts +2 -0
- package/dist/ActionBar/styles.d.ts +2 -0
- package/dist/Alert/Alert.d.ts +1 -1
- package/dist/Alert/styles.d.ts +1 -1
- package/dist/Notification/styles.d.ts +1 -1
- package/dist/Savebar/index.d.ts +0 -1
- package/dist/Savebar/styles.d.ts +1 -1
- package/dist/icons/ArrowDropdownIcon.d.ts +2 -0
- package/dist/icons/CheckboxCheckedIcon.d.ts +1 -0
- package/dist/icons/CheckboxIcon.d.ts +1 -0
- package/dist/icons/CheckboxIndeterminateIcon.d.ts +1 -0
- package/dist/icons/CompleteIcon.d.ts +2 -0
- package/dist/icons/{Checkbox.d.ts → EditIcon.d.ts} +1 -1
- package/dist/icons/InfoIcon.d.ts +2 -0
- package/dist/icons/Logo.d.ts +1 -1
- package/dist/icons/LogoLight.d.ts +2 -0
- package/dist/icons/NotAllowedIcon.d.ts +2 -0
- package/dist/icons/NotAllowedInvertedIcon.d.ts +2 -0
- package/dist/icons/SearchIcon.d.ts +1 -0
- package/dist/icons/WarningIcon.d.ts +2 -0
- package/dist/icons/index.d.ts +11 -0
- package/dist/index.d.ts +2 -0
- package/dist/macaw-ui.cjs.development.js +419 -190
- package/dist/macaw-ui.cjs.development.js.map +1 -1
- package/dist/macaw-ui.cjs.production.min.js +1 -1
- package/dist/macaw-ui.cjs.production.min.js.map +1 -1
- package/dist/macaw-ui.esm.js +406 -188
- package/dist/macaw-ui.esm.js.map +1 -1
- package/dist/theme/createSaleorTheme/overrides/buttons.d.ts +2 -2
- package/dist/theme/createSaleorTheme/overrides/index.d.ts +2 -2
- package/dist/theme/createSaleorTheme/overrides/inputs.d.ts +2 -2
- package/dist/theme/createSaleorTheme/overrides/tables.d.ts +2 -2
- package/dist/theme/createSaleorTheme/shadows.d.ts +2 -2
- package/dist/theme/createSaleorTheme/types.d.ts +3 -7
- package/package.json +1 -1
- package/src/ActionBar/ActionBar.stories.tsx +34 -0
- package/src/ActionBar/ActionBar.tsx +58 -0
- package/src/ActionBar/context.tsx +32 -0
- package/src/ActionBar/index.ts +2 -0
- package/src/ActionBar/styles.ts +27 -0
- package/src/Alert/Alert.stories.tsx +10 -0
- package/src/Alert/Alert.tsx +10 -15
- package/src/Alert/styles.ts +0 -1
- package/src/Notification/Notification.tsx +7 -13
- package/src/Notification/styles.ts +0 -1
- package/src/Savebar/Savebar.stories.tsx +8 -7
- package/src/Savebar/Savebar.tsx +37 -69
- package/src/Savebar/index.ts +0 -1
- package/src/Savebar/styles.ts +0 -18
- package/src/Sidebar/MenuItem.tsx +0 -1
- package/src/Sidebar/Sidebar.tsx +8 -2
- package/src/SidebarDrawer/SidebarDrawer.tsx +4 -1
- package/src/UserChipMenu/UserChipMenu.tsx +2 -2
- package/src/icons/{ArrowDropdown.tsx → ArrowDropdownIcon.tsx} +3 -3
- package/src/icons/{CheckboxChecked.tsx → CheckboxCheckedIcon.tsx} +2 -2
- package/src/icons/{Checkbox.tsx → CheckboxIcon.tsx} +2 -2
- package/src/icons/{CheckboxIndeterminate.tsx → CheckboxIndeterminateIcon.tsx} +2 -2
- package/src/icons/CompleteIcon.tsx +25 -0
- package/src/icons/EditIcon.tsx +12 -0
- package/src/icons/InfoIcon.tsx +23 -0
- package/src/icons/Logo.tsx +3 -8
- package/src/icons/LogoLight.tsx +27 -0
- package/src/icons/NotAllowedIcon.tsx +25 -0
- package/src/icons/NotAllowedInvertedIcon.tsx +25 -0
- package/src/icons/SearchIcon.tsx +12 -0
- package/src/icons/WarningIcon.tsx +23 -0
- package/src/icons/index.ts +11 -0
- package/src/index.tsx +2 -0
- package/src/theme/ThemeProvider.tsx +3 -3
- package/src/theme/createSaleorTheme/createSaleorTheme.ts +7 -1
- package/src/theme/createSaleorTheme/overrides/buttons.ts +4 -2
- package/src/theme/createSaleorTheme/overrides/index.ts +2 -2
- package/src/theme/createSaleorTheme/overrides/inputs.ts +4 -3
- package/src/theme/createSaleorTheme/overrides/tables.ts +2 -3
- package/src/theme/createSaleorTheme/shadows.ts +2 -2
- package/src/theme/createSaleorTheme/types.ts +4 -10
- package/dist/Savebar/context.d.ts +0 -9
- package/dist/icons/ArrowDropdown.d.ts +0 -2
- package/dist/icons/CheckboxChecked.d.ts +0 -1
- package/dist/icons/CheckboxIndeterminate.d.ts +0 -1
- package/src/Savebar/context.tsx +0 -32
- package/src/assets/alert_icon.svg +0 -5
- package/src/assets/error_icon.svg +0 -5
- package/src/assets/info_icon.svg +0 -5
- package/src/assets/success_icon.svg +0 -5
|
@@ -10,7 +10,7 @@ import Typography from "@material-ui/core/Typography";
|
|
|
10
10
|
import clsx from "clsx";
|
|
11
11
|
import React from "react";
|
|
12
12
|
|
|
13
|
-
import
|
|
13
|
+
import ArrowDropdownIcon from "../icons/ArrowDropdownIcon";
|
|
14
14
|
import { UserChipMenuContext } from "./context";
|
|
15
15
|
import useStyles from "./styles";
|
|
16
16
|
|
|
@@ -69,7 +69,7 @@ export const UserChipMenu: React.FC<UserChipProps> = ({
|
|
|
69
69
|
)}
|
|
70
70
|
</div>
|
|
71
71
|
</Hidden>
|
|
72
|
-
<
|
|
72
|
+
<ArrowDropdownIcon
|
|
73
73
|
className={clsx(classes.arrow, {
|
|
74
74
|
[classes.rotate]: isMenuOpened,
|
|
75
75
|
})}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createSvgIcon } from "@material-ui/core/utils";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const ArrowDropdownIcon = createSvgIcon(
|
|
5
5
|
<g style={{ fillRule: "evenodd" }}>
|
|
6
6
|
<path d="M7 10l5 5 5-5z" />
|
|
7
7
|
</g>,
|
|
8
|
-
"
|
|
8
|
+
"ArrowDropdownIcon"
|
|
9
9
|
);
|
|
10
10
|
|
|
11
|
-
export default
|
|
11
|
+
export default ArrowDropdownIcon;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSvgIcon } from "@material-ui/core/utils";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const CheckboxCheckedIcon = createSvgIcon(
|
|
5
5
|
<>
|
|
6
6
|
<rect x="5" y="5" width="14" height="14" fill="currentColor" />
|
|
7
7
|
<path
|
|
@@ -11,5 +11,5 @@ export const CheckboxChecked = createSvgIcon(
|
|
|
11
11
|
fill="white"
|
|
12
12
|
/>
|
|
13
13
|
</>,
|
|
14
|
-
"
|
|
14
|
+
"CheckboxCheckedIcon"
|
|
15
15
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSvgIcon } from "@material-ui/core/utils";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const CheckboxIcon = createSvgIcon(
|
|
5
5
|
<rect x="5" y="5" width="14" height="14" stroke="currentColor" fill="none" />,
|
|
6
|
-
"
|
|
6
|
+
"CheckboxIcon"
|
|
7
7
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSvgIcon } from "@material-ui/core/utils";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const CheckboxIndeterminateIcon = createSvgIcon(
|
|
5
5
|
<>
|
|
6
6
|
<rect
|
|
7
7
|
x="5"
|
|
@@ -13,5 +13,5 @@ export const CheckboxIndeterminate = createSvgIcon(
|
|
|
13
13
|
/>
|
|
14
14
|
<rect x="8" y="11" width="8" height="2" fill="currentColor" />
|
|
15
15
|
</>,
|
|
16
|
-
"
|
|
16
|
+
"CheckboxIndeterminateIcon"
|
|
17
17
|
);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const CompleteIcon: React.FC<React.SVGProps<SVGSVGElement>> = (
|
|
4
|
+
props
|
|
5
|
+
) => (
|
|
6
|
+
<svg
|
|
7
|
+
width="40"
|
|
8
|
+
height="40"
|
|
9
|
+
viewBox="0 0 40 40"
|
|
10
|
+
fill="none"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
<circle cx="20" cy="20" r="20" fill="white" />
|
|
15
|
+
<circle cx="20" cy="20" r="14" stroke="#5DC292" strokeWidth="4" />
|
|
16
|
+
<path
|
|
17
|
+
fillRule="evenodd"
|
|
18
|
+
clipRule="evenodd"
|
|
19
|
+
d="M28.7678 13.7678C29.3536 14.3536 29.3536 15.3033 28.7678 15.8891L17.4142 27.2426L12.0607 21.8891C11.4749 21.3033 11.4749 20.3536 12.0607 19.7678L12.7678 19.0607C13.3536 18.4749 14.3033 18.4749 14.8891 19.0607L17.4142 21.5858L25.9393 13.0607C26.5251 12.4749 27.4749 12.4749 28.0607 13.0607L28.7678 13.7678Z"
|
|
20
|
+
fill="#5DC292"
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
CompleteIcon.displayName = "CompleteIcon";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createSvgIcon } from "@material-ui/core/utils";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
export const EditIcon = createSvgIcon(
|
|
5
|
+
<path
|
|
6
|
+
fillRule="evenodd"
|
|
7
|
+
clipRule="evenodd"
|
|
8
|
+
d="M20.0445 2.90731C18.8236 1.69756 16.8544 1.69756 15.6336 2.90731L14.7077 3.82479L7.00549 11.4569C6.63843 11.8206 6.41956 12.3074 6.39126 12.8231L6.24246 15.535C6.17315 16.7984 7.23704 17.8317 8.4994 17.7272L11.1564 17.5073C11.646 17.4668 12.1055 17.2551 12.4543 16.9096L21.0739 8.36838C22.3086 7.14491 22.3086 5.15086 21.0739 3.92738L20.0445 2.90731ZM8.47578 12.9372L15.4428 6.03358L17.9544 8.52227L10.984 15.4292L8.32698 15.6492L8.47578 12.9372ZM16.9249 4.56496L19.4365 7.05365L19.6036 6.88805C20.0152 6.48022 20.0152 5.81554 19.6036 5.40772L18.5742 4.38765C18.1672 3.9844 17.5108 3.9844 17.1039 4.38765L16.9249 4.56496ZM5.13147 3.23318C3.40201 3.23318 2 4.63355 2 6.36099V18.8722C2 20.5997 3.40201 22 5.13147 22H17.6573C19.3868 22 20.7888 20.5997 20.7888 18.8722V14.2848C20.7888 13.709 20.3215 13.2422 19.745 13.2422C19.1685 13.2422 18.7012 13.709 18.7012 14.2848V18.8722C18.7012 19.4481 18.2338 19.9148 17.6573 19.9148H5.13147C4.55498 19.9148 4.08765 19.4481 4.08765 18.8722V6.36099C4.08765 5.78518 4.55498 5.31839 5.13147 5.31839H9.72429C10.3008 5.31839 10.7681 4.8516 10.7681 4.27578C10.7681 3.69997 10.3008 3.23318 9.72429 3.23318H5.13147Z"
|
|
9
|
+
fill="currentColor"
|
|
10
|
+
/>,
|
|
11
|
+
"EditIcon"
|
|
12
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const InfoIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
|
|
4
|
+
<svg
|
|
5
|
+
width="40"
|
|
6
|
+
height="40"
|
|
7
|
+
viewBox="0 0 40 40"
|
|
8
|
+
fill="none"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
<circle cx="20" cy="20" r="20" fill="white" />
|
|
13
|
+
<circle cx="20" cy="20" r="14" stroke="#28234A" strokeWidth="4" />
|
|
14
|
+
<path
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
clipRule="evenodd"
|
|
17
|
+
d="M19.5 11C18.6716 11 18 11.6716 18 12.5V20.5C18 21.3284 18.6716 22 19.5 22H20.5C21.3284 22 22 21.3284 22 20.5V12.5C22 11.6716 21.3284 11 20.5 11H19.5ZM19.5 25C18.6716 25 18 25.6716 18 26.5V27.5C18 28.3284 18.6716 29 19.5 29H20.5C21.3284 29 22 28.3284 22 27.5V26.5C22 25.6716 21.3284 25 20.5 25H19.5Z"
|
|
18
|
+
fill="#28234A"
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
InfoIcon.displayName = "InfoIcon";
|
package/src/icons/Logo.tsx
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
export const Logo: React.FC = () => (
|
|
3
|
+
export const Logo: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
|
|
4
4
|
<svg
|
|
5
5
|
width="36"
|
|
6
6
|
height="33"
|
|
7
7
|
viewBox="0 0 36 33"
|
|
8
8
|
fill="none"
|
|
9
9
|
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
{...props}
|
|
10
11
|
>
|
|
11
|
-
<path
|
|
12
|
-
fillRule="evenodd"
|
|
13
|
-
clipRule="evenodd"
|
|
14
|
-
d="M16.6072 33C22.4977 33 23.9789 30.6214 23.9789 27.3629C23.9789 23.3549 20.3772 22.6056 17.3814 22.1167C15.0924 21.7258 14.0489 21.5304 14.0489 20.1292C14.0489 19.0867 14.9577 18.6954 16.4389 18.6954C18.2566 18.6954 18.7614 19.2168 18.9298 20.7482L23.7097 20.0314C23.3055 16.7404 21.4542 15.0787 16.5735 15.0787C11.2216 15.0787 9.33654 17.2293 9.33654 20.6504C9.30299 25.082 13.4768 25.5382 16.5735 26.0594C18.492 26.418 19.2328 26.7437 19.2328 28.0146C19.2328 29.0573 18.5933 29.5135 16.6745 29.5135C14.5539 29.5135 13.9144 29.1551 13.6451 27.4281L9 28.1124C9.43753 31.599 11.4908 33 16.6072 33Z"
|
|
15
|
-
fill="#28234A"
|
|
16
|
-
/>
|
|
17
12
|
<path
|
|
18
13
|
fillRule="evenodd"
|
|
19
14
|
clipRule="evenodd"
|
|
@@ -23,7 +18,7 @@ export const Logo: React.FC = () => (
|
|
|
23
18
|
<path
|
|
24
19
|
fillRule="evenodd"
|
|
25
20
|
clipRule="evenodd"
|
|
26
|
-
d="M6.
|
|
21
|
+
d="M6.59759 2.13062C6.4332 2.13062 6.27552 2.1958 6.15911 2.31187L0.182532 8.27133C0.00456112 8.44879 -0.0488948 8.71603 0.0471181 8.94829C0.143131 9.18056 0.369679 9.33205 0.621008 9.33205H21.3482C21.5126 9.33205 21.6703 9.26687 21.7867 9.1508L27.7632 3.19134C27.9412 3.01388 27.9947 2.74664 27.8987 2.51437C27.8026 2.28211 27.5761 2.13062 27.3248 2.13062H6.59759ZM2.12325 8.09007L6.85429 3.37259H25.8225L21.0915 8.09007H2.12325ZM23.9789 27.3629C23.9789 30.6214 22.4977 33 16.6072 33C11.4908 33 9.43754 31.599 9 28.1124L13.6451 27.4281C13.9144 29.1551 14.5539 29.5135 16.6745 29.5135C18.5933 29.5135 19.2328 29.0573 19.2328 28.0146C19.2328 26.7437 18.492 26.418 16.5735 26.0594C16.4207 26.0337 16.2653 26.0082 16.1079 25.9823C13.0752 25.4835 9.30464 24.8634 9.33654 20.6504C9.33654 17.2293 11.2216 15.0787 16.5735 15.0787C21.4542 15.0787 23.3055 16.7404 23.7097 20.0314L18.9298 20.7482C18.7614 19.2168 18.2566 18.6954 16.4389 18.6954C14.9577 18.6954 14.0489 19.0867 14.0489 20.1292C14.0489 21.5304 15.0924 21.7258 17.3814 22.1167C20.3772 22.6056 23.9789 23.3549 23.9789 27.3629Z"
|
|
27
22
|
fill="#28234A"
|
|
28
23
|
/>
|
|
29
24
|
</svg>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const LogoLight: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
|
|
4
|
+
<svg
|
|
5
|
+
width="36"
|
|
6
|
+
height="33"
|
|
7
|
+
viewBox="0 0 36 33"
|
|
8
|
+
fill="none"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
fillRule="evenodd"
|
|
14
|
+
clipRule="evenodd"
|
|
15
|
+
d="M19.7838 0L13.4043 6.64709H29.1638L35.5433 0H19.7838Z"
|
|
16
|
+
fill="#8AC4EB"
|
|
17
|
+
/>
|
|
18
|
+
<path
|
|
19
|
+
fillRule="evenodd"
|
|
20
|
+
clipRule="evenodd"
|
|
21
|
+
d="M6.59759 2.13062C6.4332 2.13062 6.27552 2.1958 6.15911 2.31187L0.182532 8.27133C0.00456112 8.44879 -0.0488948 8.71603 0.0471181 8.94829C0.143131 9.18056 0.369679 9.33205 0.621008 9.33205H21.3482C21.5126 9.33205 21.6703 9.26687 21.7867 9.1508L27.7632 3.19134C27.9412 3.01388 27.9947 2.74664 27.8987 2.51437C27.8026 2.28211 27.5761 2.13062 27.3248 2.13062H6.59759ZM2.12325 8.09007L6.85429 3.37259H25.8225L21.0915 8.09007H2.12325ZM23.9789 27.3629C23.9789 30.6214 22.4977 33 16.6072 33C11.4908 33 9.43754 31.599 9 28.1124L13.6451 27.4281C13.9144 29.1551 14.5539 29.5135 16.6745 29.5135C18.5933 29.5135 19.2328 29.0573 19.2328 28.0146C19.2328 26.7437 18.492 26.418 16.5735 26.0594C16.4207 26.0337 16.2653 26.0082 16.1079 25.9823C13.0752 25.4835 9.30464 24.8634 9.33654 20.6504C9.33654 17.2293 11.2216 15.0787 16.5735 15.0787C21.4542 15.0787 23.3055 16.7404 23.7097 20.0314L18.9298 20.7482C18.7614 19.2168 18.2566 18.6954 16.4389 18.6954C14.9577 18.6954 14.0489 19.0867 14.0489 20.1292C14.0489 21.5304 15.0924 21.7258 17.3814 22.1167C20.3772 22.6056 23.9789 23.3549 23.9789 27.3629Z"
|
|
22
|
+
fill="#FAFAFA"
|
|
23
|
+
/>
|
|
24
|
+
</svg>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
LogoLight.displayName = "LogoLight";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const NotAllowedIcon: React.FC<React.SVGProps<SVGSVGElement>> = (
|
|
4
|
+
props
|
|
5
|
+
) => (
|
|
6
|
+
<svg
|
|
7
|
+
width="40"
|
|
8
|
+
height="40"
|
|
9
|
+
viewBox="0 0 40 40"
|
|
10
|
+
fill="none"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
<circle cx="20" cy="20" r="16" fill="#F5FAFB" />
|
|
15
|
+
<circle cx="20" cy="20" r="20" fill="white" />
|
|
16
|
+
<path
|
|
17
|
+
fillRule="evenodd"
|
|
18
|
+
clipRule="evenodd"
|
|
19
|
+
d="M26.9531 29.7815C24.9914 31.1784 22.5917 32 20 32C13.3726 32 8 26.6274 8 20C8 17.4083 8.82158 15.0086 10.2185 13.0469L26.9531 29.7815ZM29.7815 26.9531L13.0469 10.2185C15.0086 8.82158 17.4083 8 20 8C26.6274 8 32 13.3726 32 20C32 22.5917 31.1784 24.9914 29.7815 26.9531ZM36 20C36 28.8366 28.8366 36 20 36C11.1634 36 4 28.8366 4 20C4 11.1634 11.1634 4 20 4C28.8366 4 36 11.1634 36 20Z"
|
|
20
|
+
fill="#FE6E76"
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
NotAllowedIcon.displayName = "NotAllowedIcon";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const NotAllowedInvertedIcon: React.FC<React.SVGProps<SVGSVGElement>> = (
|
|
4
|
+
props
|
|
5
|
+
) => (
|
|
6
|
+
<svg
|
|
7
|
+
width="40"
|
|
8
|
+
height="40"
|
|
9
|
+
viewBox="0 0 40 40"
|
|
10
|
+
fill="none"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
<circle cx="20" cy="20" r="16" fill="#F5FAFB" />
|
|
15
|
+
<circle cx="20" cy="20" r="20" fill="#FE6E76" />
|
|
16
|
+
<path
|
|
17
|
+
fillRule="evenodd"
|
|
18
|
+
clipRule="evenodd"
|
|
19
|
+
d="M26.9531 29.7815C24.9914 31.1784 22.5917 32 20 32C13.3726 32 8 26.6274 8 20C8 17.4083 8.82158 15.0086 10.2185 13.0469L26.9531 29.7815ZM29.7815 26.9531L13.0469 10.2185C15.0086 8.82158 17.4083 8 20 8C26.6274 8 32 13.3726 32 20C32 22.5917 31.1784 24.9914 29.7815 26.9531ZM36 20C36 28.8366 28.8366 36 20 36C11.1634 36 4 28.8366 4 20C4 11.1634 11.1634 4 20 4C28.8366 4 36 11.1634 36 20Z"
|
|
20
|
+
fill="white"
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
NotAllowedInvertedIcon.displayName = "NotAllowedInvertedIcon";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createSvgIcon } from "@material-ui/core/utils";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
export const SearchIcon = createSvgIcon(
|
|
5
|
+
<path
|
|
6
|
+
fillRule="evenodd"
|
|
7
|
+
clipRule="evenodd"
|
|
8
|
+
d="M17 10.5C17 14.0899 14.0899 17 10.5 17C6.91015 17 4 14.0899 4 10.5C4 6.91015 6.91015 4 10.5 4C14.0899 4 17 6.91015 17 10.5ZM15.7618 17.176C14.3145 18.3183 12.4869 19 10.5 19C5.80558 19 2 15.1944 2 10.5C2 5.80558 5.80558 2 10.5 2C15.1944 2 19 5.80558 19 10.5C19 12.4869 18.3183 14.3145 17.176 15.7618L21.7071 20.2929C22.0976 20.6834 22.0976 21.3166 21.7071 21.7071C21.3166 22.0976 20.6834 22.0976 20.2929 21.7071L15.7618 17.176Z"
|
|
9
|
+
fill="currentColor"
|
|
10
|
+
/>,
|
|
11
|
+
"SearchIcon"
|
|
12
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const WarningIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
|
|
4
|
+
<svg
|
|
5
|
+
width="40"
|
|
6
|
+
height="40"
|
|
7
|
+
viewBox="0 0 40 40"
|
|
8
|
+
fill="none"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
<circle cx="20" cy="20" r="20" fill="white" />
|
|
13
|
+
<circle cx="20" cy="20" r="14" stroke="#FFB84E" strokeWidth="4" />
|
|
14
|
+
<path
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
clipRule="evenodd"
|
|
17
|
+
d="M19.5 11C18.6716 11 18 11.6716 18 12.5V20.5C18 21.3284 18.6716 22 19.5 22H20.5C21.3284 22 22 21.3284 22 20.5V12.5C22 11.6716 21.3284 11 20.5 11H19.5ZM19.5 25C18.6716 25 18 25.6716 18 26.5V27.5C18 28.3284 18.6716 29 19.5 29H20.5C21.3284 29 22 28.3284 22 27.5V26.5C22 25.6716 21.3284 25 20.5 25H19.5Z"
|
|
18
|
+
fill="#FFB84E"
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
WarningIcon.displayName = "WarningIcon";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./CompleteIcon";
|
|
2
|
+
export * from "./InfoIcon";
|
|
3
|
+
export * from "./NotAllowedIcon";
|
|
4
|
+
export * from "./NotAllowedInvertedIcon";
|
|
5
|
+
export * from "./WarningIcon";
|
|
6
|
+
export * from "./ArrowDropdownIcon";
|
|
7
|
+
export * from "./CheckboxIcon";
|
|
8
|
+
export * from "./CheckboxCheckedIcon";
|
|
9
|
+
export * from "./CheckboxIndeterminateIcon";
|
|
10
|
+
export * from "./SearchIcon";
|
|
11
|
+
export * from "./EditIcon";
|
package/src/index.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./theme";
|
|
2
2
|
export * from "./extensions";
|
|
3
|
+
export * from "./icons";
|
|
3
4
|
export * from "./Savebar";
|
|
4
5
|
export * from "./Backlink";
|
|
5
6
|
export * from "./ConfirmButton";
|
|
@@ -11,3 +12,4 @@ export * from "./Notification";
|
|
|
11
12
|
export * from "./UserChipMenu";
|
|
12
13
|
export * from "./ResponsiveTable";
|
|
13
14
|
export * from "./Tooltip";
|
|
15
|
+
export * from "./ActionBar";
|
|
@@ -3,6 +3,7 @@ import { MuiThemeProvider } from "@material-ui/core/styles";
|
|
|
3
3
|
import { merge } from "lodash";
|
|
4
4
|
import React, { useEffect } from "react";
|
|
5
5
|
|
|
6
|
+
import { ActionBarProvider } from "../ActionBar/context";
|
|
6
7
|
import { BacklinkProvider } from "../Backlink/context";
|
|
7
8
|
import {
|
|
8
9
|
ExtensionMessageType,
|
|
@@ -10,7 +11,6 @@ import {
|
|
|
10
11
|
ThemeChangeMessage,
|
|
11
12
|
} from "../extensions";
|
|
12
13
|
import { localStorageKeys } from "../localStorageKeys";
|
|
13
|
-
import { SavebarProvider } from "../Savebar/context";
|
|
14
14
|
import useLocalStorage from "../tools/useLocalStorage";
|
|
15
15
|
import { Baseline } from "./Baseline";
|
|
16
16
|
import { ThemeContext } from "./context";
|
|
@@ -72,12 +72,12 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({
|
|
|
72
72
|
}}
|
|
73
73
|
>
|
|
74
74
|
<MuiThemeProvider theme={theme}>
|
|
75
|
-
<
|
|
75
|
+
<ActionBarProvider>
|
|
76
76
|
<BacklinkProvider>
|
|
77
77
|
<Baseline />
|
|
78
78
|
{children}
|
|
79
79
|
</BacklinkProvider>
|
|
80
|
-
</
|
|
80
|
+
</ActionBarProvider>
|
|
81
81
|
</MuiThemeProvider>
|
|
82
82
|
</ThemeContext.Provider>
|
|
83
83
|
);
|
|
@@ -58,6 +58,11 @@ export const createTheme = (colors: SaleorThemeColors): SaleorTheme =>
|
|
|
58
58
|
fontSize: "1.3rem",
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
|
+
MuiDialog: {
|
|
62
|
+
paper: {
|
|
63
|
+
overflowY: undefined,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
61
66
|
MuiDialogActions: {
|
|
62
67
|
root: {
|
|
63
68
|
borderTop: `1px solid ${colors.divider}`,
|
|
@@ -66,7 +71,8 @@ export const createTheme = (colors: SaleorThemeColors): SaleorTheme =>
|
|
|
66
71
|
},
|
|
67
72
|
MuiDialogContent: {
|
|
68
73
|
root: {
|
|
69
|
-
overflowX:
|
|
74
|
+
overflowX: undefined,
|
|
75
|
+
overflowY: undefined,
|
|
70
76
|
padding: `24px 0px`,
|
|
71
77
|
margin: `0px 24px`,
|
|
72
78
|
},
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { ThemeOptions } from "@material-ui/core/styles";
|
|
1
2
|
import { darken, fade } from "@material-ui/core/styles";
|
|
2
|
-
import type { Overrides } from "@material-ui/core/styles/overrides";
|
|
3
3
|
|
|
4
4
|
import { SaleorThemeColors } from "../types";
|
|
5
5
|
|
|
6
|
-
export const buttonOverrides = (
|
|
6
|
+
export const buttonOverrides = (
|
|
7
|
+
colors: SaleorThemeColors
|
|
8
|
+
): ThemeOptions["overrides"] => ({
|
|
7
9
|
MuiButton: {
|
|
8
10
|
contained: {
|
|
9
11
|
"&$disabled": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ThemeOptions } from "@material-ui/core/styles";
|
|
2
2
|
|
|
3
3
|
import { SaleorThemeColors } from "../types";
|
|
4
4
|
import { buttonOverrides } from "./buttons";
|
|
@@ -8,7 +8,7 @@ import { tableOverrides } from "./tables";
|
|
|
8
8
|
export const overrides = (
|
|
9
9
|
colors: SaleorThemeColors,
|
|
10
10
|
fontFamily: string
|
|
11
|
-
):
|
|
11
|
+
): ThemeOptions["overrides"] => ({
|
|
12
12
|
...inputOverrides(colors),
|
|
13
13
|
...tableOverrides(colors, fontFamily),
|
|
14
14
|
...buttonOverrides(colors),
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { fade } from "@material-ui/core/styles";
|
|
2
|
-
import type { Overrides } from "@material-ui/core/styles/overrides";
|
|
1
|
+
import { fade, ThemeOptions } from "@material-ui/core/styles";
|
|
3
2
|
|
|
4
3
|
import { SaleorThemeColors } from "../types";
|
|
5
4
|
|
|
6
|
-
export const inputOverrides = (
|
|
5
|
+
export const inputOverrides = (
|
|
6
|
+
colors: SaleorThemeColors
|
|
7
|
+
): ThemeOptions["overrides"] => ({
|
|
7
8
|
MuiInput: {
|
|
8
9
|
input: {
|
|
9
10
|
"&:-webkit-autofill": {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { fade } from "@material-ui/core/styles";
|
|
2
|
-
import type { Overrides } from "@material-ui/core/styles/overrides";
|
|
1
|
+
import { fade, ThemeOptions } from "@material-ui/core/styles";
|
|
3
2
|
|
|
4
3
|
import { SaleorThemeColors } from "../types";
|
|
5
4
|
|
|
6
5
|
export const tableOverrides = (
|
|
7
6
|
colors: SaleorThemeColors,
|
|
8
7
|
fontFamily: string
|
|
9
|
-
):
|
|
8
|
+
): ThemeOptions["overrides"] => ({
|
|
10
9
|
MuiTable: {
|
|
11
10
|
root: {
|
|
12
11
|
fontFamily,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ThemeOptions } from "@material-ui/core/styles";
|
|
2
2
|
|
|
3
3
|
const createShadow = (
|
|
4
4
|
pv: number,
|
|
@@ -17,7 +17,7 @@ const createShadow = (
|
|
|
17
17
|
`0 ${av}px ${ab}px ${as}px rgba(0, 0, 0, 0.12)`,
|
|
18
18
|
].join(",");
|
|
19
19
|
|
|
20
|
-
export const shadows:
|
|
20
|
+
export const shadows: ThemeOptions["shadows"] = [
|
|
21
21
|
"none",
|
|
22
22
|
createShadow(1, 1, 0, 2, 1, -2, 1, 3, 0),
|
|
23
23
|
createShadow(2, 2, 0, 3, 1, -2, 1, 5, 0),
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/unified-signatures */
|
|
2
|
-
import type { Theme } from "@material-ui/core/styles";
|
|
3
|
-
import type { ThemeOptions } from "@material-ui/core/styles/createMuiTheme";
|
|
4
|
-
import type {
|
|
5
|
-
Palette,
|
|
6
|
-
PaletteOptions,
|
|
7
|
-
} from "@material-ui/core/styles/createPalette";
|
|
2
|
+
import type { Theme, ThemeOptions } from "@material-ui/core/styles";
|
|
8
3
|
|
|
9
4
|
export type AlertPalette = Record<
|
|
10
5
|
"success" | "error" | "warning" | "info",
|
|
@@ -20,11 +15,10 @@ interface ExtraPalette {
|
|
|
20
15
|
}
|
|
21
16
|
type ExtraPaletteOptions = Partial<ExtraPalette>;
|
|
22
17
|
|
|
23
|
-
export
|
|
18
|
+
export type SaleorPalette = Theme["palette"] & ExtraPalette;
|
|
24
19
|
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
ExtraPaletteOptions {}
|
|
20
|
+
export type SaleorPaletteOptions = ThemeOptions["palette"] &
|
|
21
|
+
ExtraPaletteOptions;
|
|
28
22
|
|
|
29
23
|
export interface SaleorSpacing {
|
|
30
24
|
(): string;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export interface SavebarContextType {
|
|
3
|
-
anchor: React.RefObject<HTMLDivElement>;
|
|
4
|
-
docked: boolean;
|
|
5
|
-
setDocked: (docked: boolean) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const SavebarContext: React.Context<SavebarContextType | undefined>;
|
|
8
|
-
export declare const useSavebar: () => SavebarContextType;
|
|
9
|
-
export declare const SavebarProvider: React.FC;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CheckboxChecked: import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").SvgIconTypeMap<{}, "svg">>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CheckboxIndeterminate: import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").SvgIconTypeMap<{}, "svg">>;
|
package/src/Savebar/context.tsx
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
export interface SavebarContextType {
|
|
4
|
-
anchor: React.RefObject<HTMLDivElement>;
|
|
5
|
-
docked: boolean;
|
|
6
|
-
setDocked: (docked: boolean) => void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const SavebarContext = React.createContext<
|
|
10
|
-
SavebarContextType | undefined
|
|
11
|
-
>(undefined);
|
|
12
|
-
SavebarContext.displayName = "SavebarContext";
|
|
13
|
-
|
|
14
|
-
export const useSavebar = () => {
|
|
15
|
-
const ctx = React.useContext(SavebarContext);
|
|
16
|
-
if (ctx === undefined) {
|
|
17
|
-
throw new Error("useSavebar must be used within a SavebarContext");
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return ctx;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const SavebarProvider: React.FC = ({ children }) => {
|
|
24
|
-
const [docked, setDocked] = React.useState(true);
|
|
25
|
-
const anchor = React.useRef<HTMLDivElement | null>(null);
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<SavebarContext.Provider value={{ anchor, docked, setDocked }}>
|
|
29
|
-
{children}
|
|
30
|
-
</SavebarContext.Provider>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<circle cx="20" cy="20" r="20" fill="white"/>
|
|
3
|
-
<circle cx="20" cy="20" r="14" stroke="#FFB84E" stroke-width="4"/>
|
|
4
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 11C18.6716 11 18 11.6716 18 12.5V20.5C18 21.3284 18.6716 22 19.5 22H20.5C21.3284 22 22 21.3284 22 20.5V12.5C22 11.6716 21.3284 11 20.5 11H19.5ZM19.5 25C18.6716 25 18 25.6716 18 26.5V27.5C18 28.3284 18.6716 29 19.5 29H20.5C21.3284 29 22 28.3284 22 27.5V26.5C22 25.6716 21.3284 25 20.5 25H19.5Z" fill="#FFB84E"/>
|
|
5
|
-
</svg>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<circle cx="20" cy="20" r="16" fill="#F5FAFB"/>
|
|
3
|
-
<circle cx="20" cy="20" r="20" fill="white"/>
|
|
4
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M26.9531 29.7815C24.9914 31.1784 22.5917 32 20 32C13.3726 32 8 26.6274 8 20C8 17.4083 8.82158 15.0086 10.2185 13.0469L26.9531 29.7815ZM29.7815 26.9531L13.0469 10.2185C15.0086 8.82158 17.4083 8 20 8C26.6274 8 32 13.3726 32 20C32 22.5917 31.1784 24.9914 29.7815 26.9531ZM36 20C36 28.8366 28.8366 36 20 36C11.1634 36 4 28.8366 4 20C4 11.1634 11.1634 4 20 4C28.8366 4 36 11.1634 36 20Z" fill="#FE6E76"/>
|
|
5
|
-
</svg>
|
package/src/assets/info_icon.svg
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<circle cx="20" cy="20" r="20" fill="white"/>
|
|
3
|
-
<circle cx="20" cy="20" r="14" stroke="#28234A" stroke-width="4"/>
|
|
4
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 11C18.6716 11 18 11.6716 18 12.5V20.5C18 21.3284 18.6716 22 19.5 22H20.5C21.3284 22 22 21.3284 22 20.5V12.5C22 11.6716 21.3284 11 20.5 11H19.5ZM19.5 25C18.6716 25 18 25.6716 18 26.5V27.5C18 28.3284 18.6716 29 19.5 29H20.5C21.3284 29 22 28.3284 22 27.5V26.5C22 25.6716 21.3284 25 20.5 25H19.5Z" fill="#28234A"/>
|
|
5
|
-
</svg>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<circle cx="20" cy="20" r="20" fill="white"/>
|
|
3
|
-
<circle cx="20" cy="20" r="14" stroke="#5DC292" stroke-width="4"/>
|
|
4
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M28.7678 13.7678C29.3536 14.3536 29.3536 15.3033 28.7678 15.8891L17.4142 27.2426L12.0607 21.8891C11.4749 21.3033 11.4749 20.3536 12.0607 19.7678L12.7678 19.0607C13.3536 18.4749 14.3033 18.4749 14.8891 19.0607L17.4142 21.5858L25.9393 13.0607C26.5251 12.4749 27.4749 12.4749 28.0607 13.0607L28.7678 13.7678Z" fill="#5DC292"/>
|
|
5
|
-
</svg>
|