@saleor/macaw-ui 0.3.1 → 0.3.2
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/dist/ActionBar/styles.d.ts +1 -1
- package/dist/Alert/Alert.d.ts +2 -1
- package/dist/Button/Button.d.ts +1 -3
- package/dist/Pagination/Pagination.d.ts +2 -2
- package/dist/Savebar/styles.d.ts +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +3 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +3 -3
- package/dist/icons/Logo.d.ts +1 -1
- package/dist/icons/LogoLight.d.ts +2 -2
- package/dist/icons/index.d.ts +1 -4
- package/dist/index.d.ts +0 -3
- package/dist/index.js +1 -4
- package/dist/index.js.map +3 -3
- package/dist/mjs/index.js +5 -0
- package/dist/mjs/index.js.map +7 -0
- 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 +4 -8
- package/dist/types/CircleIndicator/CircleIndicator.d.ts +7 -0
- package/dist/types/CircleIndicator/CircleIndicator.stories.d.ts +4 -0
- package/dist/types/CircleIndicator/index.d.ts +1 -0
- package/dist/types/CircleIndicator/styles.d.ts +2 -0
- package/dist/types/ConfirmButton/ConfirmButton.d.ts +1 -1
- package/dist/types/Pill/Pill.d.ts +1 -1
- package/dist/types/StatusChip/styles.d.ts +3 -0
- package/dist/types/icons/CircleIndicatorIcon.d.ts +1 -0
- package/dist/types/icons/SuccessCircleIndicatorIcon.d.ts +1 -0
- package/dist/types/icons/index.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +3 -1
- package/src/ActionBar/styles.ts +1 -1
- package/src/Alert/Alert.tsx +2 -2
- package/src/Backlink/Backlink.stories.tsx +0 -1
- package/src/Backlink/Backlink.tsx +1 -1
- package/src/BaseList/BaseList.tsx +1 -0
- package/src/BaseList/context.ts +1 -0
- package/src/BaseList/styles.ts +1 -0
- package/src/CircleIndicator/CircleIndicator.stories.tsx +48 -0
- package/src/CircleIndicator/CircleIndicator.tsx +34 -0
- package/src/CircleIndicator/index.ts +1 -0
- package/src/CircleIndicator/styles.ts +31 -0
- package/src/ConfirmButton/ConfirmButton.tsx +1 -1
- package/src/Filter/Filter.tsx +1 -3
- package/src/Filter/FilterBar.tsx +0 -1
- package/src/LayoutButton/LayoutButton.tsx +1 -2
- package/src/List/List.stories.tsx +4 -2
- package/src/List/List.tsx +1 -0
- package/src/List/styles.ts +1 -0
- package/src/NavigationCard/NavigationCard.stories.tsx +2 -2
- package/src/NavigationCard/NavigationCard.tsx +1 -1
- package/src/Notification/Notification.tsx +3 -3
- package/src/OffsettedList/OffsettedList.stories.tsx +2 -2
- package/src/OffsettedList/OffsettedList.tsx +1 -0
- package/src/Pill/Pill.stories.tsx +3 -3
- package/src/Pill/Pill.tsx +3 -2
- package/src/PillLink/PillLink.tsx +1 -0
- package/src/Savebar/Savebar.tsx +1 -1
- package/src/Sidebar/ExpandButton.tsx +1 -1
- package/src/StatusChip/StatusChip.tsx +1 -1
- package/src/UserChipMenu/UserChipMenu.tsx +1 -1
- package/src/consts.ts +1 -0
- package/src/icons/CircleIndicatorIcon.tsx +10 -0
- package/src/icons/SuccessCircleIndicatorIcon.tsx +16 -0
- package/src/icons/index.ts +2 -0
- package/src/index.tsx +1 -0
- package/src/theme/ThemeProvider.tsx +0 -1
- package/src/theme/createSaleorTheme/createSaleorTheme.tsx +2 -2
- package/src/theme/createSaleorTheme/overrides/inputs.ts +1 -1
- package/src/theme/utils.test.ts +4 -4
- package/src/theme/utils.ts +1 -1
- package/src/tools/useLocalStorage.ts +16 -9
- package/dist/macaw-ui.cjs.development.js +0 -2626
- package/dist/macaw-ui.cjs.development.js.map +0 -1
- package/dist/macaw-ui.cjs.production.min.js +0 -2
- package/dist/macaw-ui.cjs.production.min.js.map +0 -1
- package/dist/macaw-ui.esm.js +0 -2578
- package/dist/macaw-ui.esm.js.map +0 -1
- package/dist/types/Button/Button.stories.d.ts +0 -5
|
@@ -86,8 +86,8 @@ export const createTheme = (colors: SaleorThemeColors): SaleorTheme =>
|
|
|
86
86
|
root: {
|
|
87
87
|
overflowX: undefined,
|
|
88
88
|
overflowY: undefined,
|
|
89
|
-
padding:
|
|
90
|
-
margin:
|
|
89
|
+
padding: "24px 0px",
|
|
90
|
+
margin: "0px 24px",
|
|
91
91
|
},
|
|
92
92
|
},
|
|
93
93
|
MuiDialogContentText: {
|
|
@@ -122,7 +122,7 @@ export const inputOverrides = (
|
|
|
122
122
|
backgroundColor: colors.background.default,
|
|
123
123
|
color: colors.main[3],
|
|
124
124
|
},
|
|
125
|
-
boxShadow:
|
|
125
|
+
boxShadow: "0 0 0 0 transparent !important",
|
|
126
126
|
backgroundColor: colors.background.default,
|
|
127
127
|
},
|
|
128
128
|
"&$error": {
|
package/src/theme/utils.test.ts
CHANGED
|
@@ -12,11 +12,11 @@ describe("Changing color meta tag", () => {
|
|
|
12
12
|
|
|
13
13
|
// Then
|
|
14
14
|
expect(
|
|
15
|
-
document.querySelector(
|
|
15
|
+
document.querySelector('head meta[name="tag1"]')?.getAttribute("content")
|
|
16
16
|
).toBe("value1");
|
|
17
17
|
expect(
|
|
18
18
|
document
|
|
19
|
-
.querySelector(
|
|
19
|
+
.querySelector('head meta[name="theme-color"]')
|
|
20
20
|
?.getAttribute("content")
|
|
21
21
|
).toBe("#FF0000");
|
|
22
22
|
});
|
|
@@ -32,11 +32,11 @@ describe("Changing color meta tag", () => {
|
|
|
32
32
|
|
|
33
33
|
// Then
|
|
34
34
|
expect(
|
|
35
|
-
document.querySelector(
|
|
35
|
+
document.querySelector('head meta[name="tag1"]')?.getAttribute("content")
|
|
36
36
|
).toBe("value1");
|
|
37
37
|
expect(
|
|
38
38
|
document
|
|
39
|
-
.querySelector(
|
|
39
|
+
.querySelector('head meta[name="theme-color"]')
|
|
40
40
|
?.getAttribute("content")
|
|
41
41
|
).toBe("#FF0000");
|
|
42
42
|
});
|
package/src/theme/utils.ts
CHANGED
|
@@ -4,7 +4,7 @@ export function changeColorMeta(color: string) {
|
|
|
4
4
|
themeColorTag.setAttribute("name", "theme-color");
|
|
5
5
|
|
|
6
6
|
const existingColorTag = document.head.querySelector(
|
|
7
|
-
|
|
7
|
+
'meta[name="theme-color"]'
|
|
8
8
|
);
|
|
9
9
|
if (existingColorTag) {
|
|
10
10
|
existingColorTag.remove();
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { useCallback, useEffect, useState } from "react";
|
|
6
6
|
|
|
7
|
+
import { isWindowDefined } from "../consts";
|
|
8
|
+
|
|
7
9
|
// FIXME: We also had to tweak return signature because tuples were bugging
|
|
8
10
|
// typescript parser
|
|
9
11
|
// https://stackoverflow.com/questions/62079477/line-0-parsing-error-cannot-read-property-map-of-undefined
|
|
@@ -18,19 +20,22 @@ export default function useLocalStorage(
|
|
|
18
20
|
initialValue: string = ""
|
|
19
21
|
): UseLocalStorage {
|
|
20
22
|
const [value, setValue] = useState(
|
|
21
|
-
() => window.localStorage.getItem(key) || initialValue
|
|
23
|
+
() => (isWindowDefined && window.localStorage.getItem(key)) || initialValue
|
|
22
24
|
);
|
|
23
25
|
|
|
24
26
|
const setItem = (newValue: string) => {
|
|
25
27
|
setValue(newValue);
|
|
26
|
-
|
|
28
|
+
if (isWindowDefined) {
|
|
29
|
+
window.localStorage.setItem(key, newValue);
|
|
30
|
+
}
|
|
27
31
|
};
|
|
28
32
|
|
|
29
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30
33
|
useEffect(() => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
if (isWindowDefined) {
|
|
35
|
+
const newValue = window.localStorage.getItem(key);
|
|
36
|
+
if (value !== newValue) {
|
|
37
|
+
setValue(newValue || initialValue);
|
|
38
|
+
}
|
|
34
39
|
}
|
|
35
40
|
});
|
|
36
41
|
|
|
@@ -40,13 +45,15 @@ export default function useLocalStorage(
|
|
|
40
45
|
setValue(event.newValue || initialValue);
|
|
41
46
|
}
|
|
42
47
|
},
|
|
43
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
44
48
|
[value, key]
|
|
45
49
|
);
|
|
46
50
|
|
|
47
51
|
useEffect(() => {
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
if (isWindowDefined) {
|
|
53
|
+
window.addEventListener("storage", handleStorage);
|
|
54
|
+
return () => window.removeEventListener("storage", handleStorage);
|
|
55
|
+
}
|
|
56
|
+
return;
|
|
50
57
|
}, [handleStorage]);
|
|
51
58
|
|
|
52
59
|
return {
|