@fibery/ui-kit 1.0.4 → 1.1.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.
- package/package.json +9 -3
- package/src/Button.d.ts +3 -1
- package/src/Button.js +10 -12
- package/src/Pallete.ts +16 -16
- package/src/Select/components.tsx +5 -9
- package/src/Select/styles.ts +14 -4
- package/src/ThemeProvider.tsx +131 -5
- package/src/antd/styles.ts +4 -4
- package/src/designSystem.ts +165 -193
- package/src/error-alert.tsx +55 -0
- package/src/icons/Icon.tsx +2 -2
- package/src/icons/ast/AppStoreOneColor.ts +1 -1
- package/src/icons/ast/Checked.ts +1 -1
- package/src/icons/ast/Email.ts +8 -0
- package/src/icons/ast/ExtensionAvatar.ts +1 -1
- package/src/icons/ast/Integration.ts +1 -1
- package/src/icons/ast/RicheditorImageAlignCenter.ts +1 -1
- package/src/icons/ast/RicheditorImageAlignLeft.ts +1 -1
- package/src/icons/ast/RicheditorImageAlignRight.ts +1 -1
- package/src/icons/ast/RicheditorImageUpload.ts +1 -1
- package/src/icons/ast/RicheditorImageWrapCenter.ts +1 -1
- package/src/icons/ast/RicheditorImageWrapLeft.ts +1 -1
- package/src/icons/ast/RicheditorImageWrapRight.ts +1 -1
- package/src/icons/ast/SidebarFields.ts +8 -0
- package/src/icons/ast/SidebarFieldsOpened.ts +8 -0
- package/src/icons/ast/SlackIcon.ts +8 -0
- package/src/icons/ast/SlideMenu.ts +8 -0
- package/src/icons/ast/SlideMenuOpened.ts +8 -0
- package/src/icons/ast/index.tsx +6 -0
- package/src/icons/react/Email.tsx +12 -0
- package/src/icons/react/SidebarFields.tsx +12 -0
- package/src/icons/react/SidebarFieldsOpened.tsx +12 -0
- package/src/icons/react/SlackIcon.tsx +12 -0
- package/src/icons/react/SlideMenu.tsx +12 -0
- package/src/icons/react/SlideMenuOpened.tsx +12 -0
- package/src/icons/react/index.tsx +6 -0
- package/src/loading-sausage.tsx +1 -1
- package/src/media-query-utils.ts +24 -0
- package/src/theme-settings.ts +164 -0
package/src/icons/ast/Checked.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
import { IconDefinition } from '../types';
|
|
5
5
|
|
|
6
|
-
const Checked: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"path","properties":{"
|
|
6
|
+
const Checked: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"path","properties":{"d":"M8.79 15.1c.406 0 .721-.155.936-.482l5.553-8.486c.155-.239.221-.459.221-.667 0-.56-.417-.965-.99-.965-.392 0-.637.143-.875.518L8.76 12.7 6.288 9.633c-.22-.262-.46-.38-.793-.38-.578 0-.995.41-.995.97 0 .25.077.47.292.714l3.075 3.722c.256.304.542.441.923.441Z"},"children":[]}],"metadata":""}]},"name":"checked"};
|
|
7
7
|
|
|
8
8
|
export default Checked;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const Email: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"width":20,"height":20},"children":[{"type":"element","tagName":"path","properties":{"d":"M4.74 16H15.4c1.32 0 2.1-.79 2.1-2.268V6.268C17.5 4.79 16.72 4 15.26 4H4.595C3.273 4 2.5 4.79 2.5 6.268v7.464C2.5 15.217 3.28 16 4.74 16Zm4.543-5.831L4.593 5.43c.054-.007.113-.007.173-.007h10.462c.066 0 .132 0 .191.014l-4.69 4.73c-.27.27-.488.385-.726.385-.23 0-.449-.121-.72-.384ZM3.867 6.47l3.468 3.49-3.468 3.51v-7Zm8.811 3.483 3.448-3.463v6.966l-3.448-3.503Zm-7.912 4.63a1.21 1.21 0 0 1-.225-.02l3.672-3.72.317.318c.49.492.965.702 1.473.702.515 0 .991-.21 1.473-.702l.317-.317 3.673 3.718c-.073.014-.152.02-.238.02H4.766Z"},"children":[]}],"metadata":""}]},"name":"email"};
|
|
7
|
+
|
|
8
|
+
export default Email;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
import { IconDefinition } from '../types';
|
|
5
5
|
|
|
6
|
-
const ExtensionAvatar: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{},"children":[{"type":"element","tagName":"path","properties":{"
|
|
6
|
+
const ExtensionAvatar: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{"fillRule":"evenodd","clipRule":"evenodd"},"children":[{"type":"element","tagName":"path","properties":{"d":"M6.904 8.585a3.071 3.071 0 1 1 6.143 0 3.071 3.071 0 0 1-6.143 0Zm3.072-1.57a1.571 1.571 0 1 0 0 3.141 1.571 1.571 0 0 0 0-3.142Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M5.555 3.348a8 8 0 1 1 8.89 13.304 8 8 0 0 1-8.89-13.304Zm.89 11.973a6.4 6.4 0 0 0 7.338-.159 1.571 1.571 0 0 0-1.486-1.06H7.654a1.571 1.571 0 0 0-1.475 1.032c.086.064.175.127.265.187Zm-1.4-1.27A6.402 6.402 0 0 1 8.752 3.724a6.4 6.4 0 0 1 6.175 10.363 3.07 3.07 0 0 0-2.63-1.484H7.655a3.07 3.07 0 0 0-2.608 1.45Z"},"children":[]}]}],"metadata":""}]},"name":"extension-avatar"};
|
|
7
7
|
|
|
8
8
|
export default ExtensionAvatar;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
import { IconDefinition } from '../types';
|
|
5
5
|
|
|
6
|
-
const Integration: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{},"children":[{"type":"element","tagName":"path","properties":{"
|
|
6
|
+
const Integration: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{"fillRule":"evenodd","clipRule":"evenodd"},"children":[{"type":"element","tagName":"path","properties":{"d":"m7.735 5.927.7.7-.7.699A.803.803 0 1 0 8.872 8.46l.7-.699 2.667 2.668-.7.699a.8.8 0 0 0-.006 1.142.802.802 0 0 0 1.142-.007l.7-.699.7.7a.803.803 0 0 0 1.135 0l.634-.634a5.292 5.292 0 0 0 .523-6.861l1.375-1.376a.815.815 0 0 0 .211-.318.802.802 0 0 0-1.098-1 .804.804 0 0 0-.248.183L15.23 3.634a5.283 5.283 0 0 0-6.861.523l-.634.634a.803.803 0 0 0 0 1.136Zm6.972 4.569-.066.066-4.525-4.525-.678-.678.066-.066a3.655 3.655 0 0 1 5.203 0 3.658 3.658 0 0 1 0 5.203ZM12.248 15.226a.772.772 0 0 0 .049-.05l.006-.007a.803.803 0 0 0-.053-1.082L5.912 7.75a.803.803 0 0 0-1.135 0l-.634.634a5.283 5.283 0 0 0-.523 6.862l-1.378 1.377a.804.804 0 1 0 1.136 1.136l1.377-1.378a5.292 5.292 0 0 0 6.862-.523l.63-.63ZM5.278 9.52l.066-.067 5.204 5.204-.066.066a3.658 3.658 0 0 1-5.204 0 3.658 3.658 0 0 1 0-5.203Z"},"children":[]}]}],"metadata":""}]},"name":"integration"};
|
|
7
7
|
|
|
8
8
|
export default Integration;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
import { IconDefinition } from '../types';
|
|
5
5
|
|
|
6
|
-
const RicheditorImageAlignCenter: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{},"children":[{"type":"element","tagName":"path","properties":{"
|
|
6
|
+
const RicheditorImageAlignCenter: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{"fillRule":"evenodd","clipRule":"evenodd"},"children":[{"type":"element","tagName":"path","properties":{"d":"M7.6 8.6v2.8h4.8V8.6H7.6ZM7 7a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H7ZM3 4.15c0-.47.38-.85.85-.85h12.3a.85.85 0 0 1 0 1.7H3.85A.85.85 0 0 1 3 4.15ZM3 16.15c0-.47.38-.85.85-.85h12.3a.85.85 0 0 1 0 1.7H3.85a.85.85 0 0 1-.85-.85Z"},"children":[]}]}],"metadata":""}]},"name":"richeditor-image-align-center"};
|
|
7
7
|
|
|
8
8
|
export default RicheditorImageAlignCenter;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
import { IconDefinition } from '../types';
|
|
5
5
|
|
|
6
|
-
const RicheditorImageAlignLeft: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{},"children":[{"type":"element","tagName":"path","properties":{"
|
|
6
|
+
const RicheditorImageAlignLeft: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{"fillRule":"evenodd","clipRule":"evenodd"},"children":[{"type":"element","tagName":"path","properties":{"d":"M4.5 8.5v3h5v-3h-5ZM4 7a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H4ZM3 4.15c0-.47.38-.85.85-.85h12.3a.85.85 0 0 1 0 1.7H3.85A.85.85 0 0 1 3 4.15ZM3 16.15c0-.47.38-.85.85-.85h12.3a.85.85 0 0 1 0 1.7H3.85a.85.85 0 0 1-.85-.85Z"},"children":[]}]}],"metadata":""}]},"name":"richeditor-image-align-left"};
|
|
7
7
|
|
|
8
8
|
export default RicheditorImageAlignLeft;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
import { IconDefinition } from '../types';
|
|
5
5
|
|
|
6
|
-
const RicheditorImageAlignRight: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{},"children":[{"type":"element","tagName":"path","properties":{"
|
|
6
|
+
const RicheditorImageAlignRight: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{"fillRule":"evenodd","clipRule":"evenodd"},"children":[{"type":"element","tagName":"path","properties":{"d":"M10.6 8.6v2.8h4.8V8.6h-4.8ZM10 7a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1h-6ZM3 4.15c0-.47.38-.85.85-.85h12.3a.85.85 0 0 1 0 1.7H3.85A.85.85 0 0 1 3 4.15ZM3 16.15c0-.47.38-.85.85-.85h12.3a.85.85 0 0 1 0 1.7H3.85a.85.85 0 0 1-.85-.85Z"},"children":[]}]}],"metadata":""}]},"name":"richeditor-image-align-right"};
|
|
7
7
|
|
|
8
8
|
export default RicheditorImageAlignRight;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
import { IconDefinition } from '../types';
|
|
5
5
|
|
|
6
|
-
const RicheditorImageUpload: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{},"children":[{"type":"element","tagName":"path","properties":{"
|
|
6
|
+
const RicheditorImageUpload: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{"fillRule":"evenodd","clipRule":"evenodd"},"children":[{"type":"element","tagName":"path","properties":{"d":"M5.232 7.172a1.94 1.94 0 1 1 3.88 0 1.94 1.94 0 0 1-3.88 0Zm1.94-.485a.485.485 0 1 0 0 .97.485.485 0 0 0 0-.97Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M18 12.419V4.343A2.343 2.343 0 0 0 15.657 2H4.343A2.343 2.343 0 0 0 2 4.343v11.314A2.343 2.343 0 0 0 4.343 18h11.314A2.343 2.343 0 0 0 18 15.657v-3.238ZM4.343 3.455a.889.889 0 0 0-.888.888v11.314c0 .4.263.737.626.85l8.637-8.637a.727.727 0 0 1 1.029 0l2.799 2.798V4.343a.889.889 0 0 0-.89-.888H4.344Zm12.203 9.27-3.314-3.313L6.1 16.545h9.558c.49 0 .889-.398.889-.888v-2.932Z"},"children":[]}]}],"metadata":""}]},"name":"richeditor-image-upload"};
|
|
7
7
|
|
|
8
8
|
export default RicheditorImageUpload;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
import { IconDefinition } from '../types';
|
|
5
5
|
|
|
6
|
-
const RicheditorImageWrapCenter: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{},"children":[{"type":"element","tagName":"path","properties":{"
|
|
6
|
+
const RicheditorImageWrapCenter: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{"fillRule":"evenodd","clipRule":"evenodd"},"children":[{"type":"element","tagName":"path","properties":{"d":"M8.2 8.6v2.8h3.6V8.6H8.2ZM8 7c-.5 0-1 .448-1 1v4c0 .552.5 1 1 1h4c.5 0 1-.448 1-1V8c0-.552-.5-1-1-1H8ZM3 4.15c0-.47.38-.85.85-.85h12.3a.85.85 0 0 1 0 1.7H3.85A.85.85 0 0 1 3 4.15ZM3 16.15c0-.47.38-.85.85-.85h12.3a.85.85 0 0 1 0 1.7H3.85a.85.85 0 0 1-.85-.85ZM3 12c0-.552.5-1 1-1s1 .448 1 1-.5 1-1 1-1-.448-1-1ZM3 8c0-.552.5-1 1-1s1 .448 1 1-.5 1-1 1-1-.448-1-1ZM15 8c0-.552.5-1 1-1s1 .448 1 1-.5 1-1 1-1-.448-1-1ZM15 12c0-.552.5-1 1-1s1 .448 1 1-.5 1-1 1-1-.448-1-1Z"},"children":[]}]}],"metadata":""}]},"name":"richeditor-image-wrap-center"};
|
|
7
7
|
|
|
8
8
|
export default RicheditorImageWrapCenter;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
import { IconDefinition } from '../types';
|
|
5
5
|
|
|
6
|
-
const RicheditorImageWrapLeft: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{},"children":[{"type":"element","tagName":"path","properties":{"
|
|
6
|
+
const RicheditorImageWrapLeft: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{"fillRule":"evenodd","clipRule":"evenodd"},"children":[{"type":"element","tagName":"path","properties":{"d":"M4.6 8.6v2.8h4.8V8.6H4.6ZM4 7a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H4ZM3 4.15c0-.47.38-.85.85-.85h12.3a.85.85 0 0 1 0 1.7H3.85A.85.85 0 0 1 3 4.15ZM3 16.15c0-.47.38-.85.85-.85h12.3a.85.85 0 0 1 0 1.7H3.85a.85.85 0 0 1-.85-.85ZM13 8c0-.552.5-1 1-1h2c.5 0 1 .448 1 1s-.5 1-1 1h-2c-.5 0-1-.448-1-1ZM13 12c0-.552.5-1 1-1h2c.5 0 1 .448 1 1s-.5 1-1 1h-2c-.5 0-1-.448-1-1Z"},"children":[]}]}],"metadata":""}]},"name":"richeditor-image-wrap-left"};
|
|
7
7
|
|
|
8
8
|
export default RicheditorImageWrapLeft;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
import { IconDefinition } from '../types';
|
|
5
5
|
|
|
6
|
-
const RicheditorImageWrapRight: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{},"children":[{"type":"element","tagName":"path","properties":{"
|
|
6
|
+
const RicheditorImageWrapRight: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{"fillRule":"evenodd","clipRule":"evenodd"},"children":[{"type":"element","tagName":"path","properties":{"d":"M10.6 8.6v2.8h4.8V8.6h-4.8ZM10 7a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1h-6ZM3 4.15c0-.47.38-.85.85-.85h12.3a.85.85 0 0 1 0 1.7H3.85A.85.85 0 0 1 3 4.15ZM3 16.15c0-.47.38-.85.85-.85h12.3a.85.85 0 0 1 0 1.7H3.85a.85.85 0 0 1-.85-.85ZM3 8c0-.552.5-1 1-1h2c.5 0 1 .448 1 1s-.5 1-1 1H4c-.5 0-1-.448-1-1ZM3 12c0-.552.5-1 1-1h2c.5 0 1 .448 1 1s-.5 1-1 1H4c-.5 0-1-.448-1-1Z"},"children":[]}]}],"metadata":""}]},"name":"richeditor-image-wrap-right"};
|
|
7
7
|
|
|
8
8
|
export default RicheditorImageWrapRight;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const SidebarFields: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"width":20,"height":20},"children":[{"type":"element","tagName":"path","properties":{"d":"M15.237 7.492h-1.601a.516.516 0 0 1-.508-.5c0-.265.234-.492.508-.492h1.601a.51.51 0 0 1 .516.492c0 .266-.234.5-.516.5ZM15.237 9.586h-1.601a.516.516 0 0 1-.508-.5c0-.266.234-.492.508-.492h1.601a.51.51 0 0 1 .516.492c0 .266-.234.5-.516.5ZM13.636 11.672h1.601a.51.51 0 0 0 .516-.492.51.51 0 0 0-.516-.492h-1.601a.509.509 0 0 0-.508.492c0 .265.234.492.508.492Z"},"children":[]},{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M15.447 17H4.553C2.872 17 2 16.143 2 14.492V5.508C2 3.857 2.872 3 4.553 3h10.894C17.128 3 18 3.857 18 5.508v8.984C18 16.136 17.128 17 15.447 17ZM3.525 14.36c0 .75.397 1.127 1.121 1.127h6.233V4.513H4.646c-.724 0-1.12.37-1.12 1.119v8.729Zm12.95-8.728c0-.749-.405-1.12-1.121-1.12h-3.027v10.975h3.027c.716 0 1.12-.378 1.12-1.127V5.633Z"},"children":[]}],"metadata":""}]},"name":"sidebar-fields"};
|
|
7
|
+
|
|
8
|
+
export default SidebarFields;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const SidebarFieldsOpened: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"width":20,"height":20},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M4.553 17h10.894C17.128 17 18 16.136 18 14.492V5.508C18 3.857 17.128 3 15.447 3H4.553C2.872 3 2 3.857 2 5.508v8.984C2 16.143 2.872 17 4.553 17Zm.093-1.513c-.724 0-1.12-.378-1.12-1.127V5.633c0-.749.396-1.12 1.12-1.12h6.233v10.975H4.646Zm10.591-7.995h-1.601a.516.516 0 0 1-.508-.5c0-.265.234-.492.508-.492h1.601a.51.51 0 0 1 .516.492c0 .266-.234.5-.516.5Zm0 2.094h-1.601a.516.516 0 0 1-.508-.5c0-.266.234-.492.508-.492h1.601a.51.51 0 0 1 .516.492c0 .266-.234.5-.516.5Zm0 2.086h-1.601a.509.509 0 0 1-.508-.492c0-.266.234-.492.508-.492h1.601a.51.51 0 0 1 .516.492.51.51 0 0 1-.516.492Z"},"children":[]}],"metadata":""}]},"name":"sidebar-fields-opened"};
|
|
7
|
+
|
|
8
|
+
export default SidebarFieldsOpened;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const SlackIcon: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"width":20,"height":20},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M7.597 3.107a1.404 1.404 0 0 1 1.527.304 1.398 1.398 0 0 1 .41.99V5.8h-1.4a1.404 1.404 0 0 1-1.4-1.4 1.396 1.396 0 0 1 .863-1.293ZM4.4 6.733h3.733a1.404 1.404 0 0 1 1.4 1.4 1.396 1.396 0 0 1-.863 1.293c-.17.07-.353.107-.537.107H4.4a1.404 1.404 0 0 1-1.294-.864 1.396 1.396 0 0 1 .304-1.525 1.402 1.402 0 0 1 .99-.41Zm12.494.865a1.395 1.395 0 0 1 0 1.07 1.398 1.398 0 0 1-1.294.865h-1.4v-1.4a1.395 1.395 0 0 1 .864-1.293 1.404 1.404 0 0 1 1.526.304c.13.13.234.284.304.454ZM13.267 4.4v3.733a1.397 1.397 0 0 1-1.4 1.4 1.403 1.403 0 0 1-1.4-1.4V4.4a1.395 1.395 0 0 1 .864-1.293 1.403 1.403 0 0 1 1.526.304 1.398 1.398 0 0 1 .41.99Zm-1.4 12.6a1.404 1.404 0 0 0 1.4-1.4 1.397 1.397 0 0 0-1.4-1.4h-1.4v1.4a1.395 1.395 0 0 0 .864 1.293c.17.07.352.107.536.107Zm0-3.733H15.6a1.405 1.405 0 0 0 1.294-.865 1.395 1.395 0 0 0 0-1.07 1.4 1.4 0 0 0-1.294-.865h-3.733a1.403 1.403 0 0 0-1.4 1.4 1.397 1.397 0 0 0 1.4 1.4Zm-8.76-.865a1.396 1.396 0 0 1 .302-1.525 1.402 1.402 0 0 1 .991-.41h1.4v1.4a1.396 1.396 0 0 1-1.4 1.4 1.405 1.405 0 0 1-1.294-.865ZM3 11.867ZM6.733 15.6v-3.733a1.396 1.396 0 0 1 1.4-1.4 1.402 1.402 0 0 1 1.4 1.4V15.6a1.396 1.396 0 0 1-1.4 1.4 1.403 1.403 0 0 1-1.4-1.4Z"},"children":[]}],"metadata":""}]},"name":"slack-icon"};
|
|
7
|
+
|
|
8
|
+
export default SlackIcon;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const SlideMenu: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"width":20,"height":20},"children":[{"type":"element","tagName":"path","properties":{"d":"M6.331 7.877H4.984c-.233 0-.384-.143-.384-.368V6.176c0-.233.143-.376.384-.376H6.33c.226 0 .369.143.369.376V7.51c0 .225-.15.368-.369.368ZM6.331 10.956H4.984c-.233 0-.384-.15-.384-.369v-1.34c0-.225.143-.376.384-.376H6.33c.226 0 .369.15.369.376v1.34c0 .218-.15.369-.369.369ZM4.984 14.02H6.33c.218 0 .369-.144.369-.37v-1.332c0-.226-.143-.376-.369-.376H4.984c-.241 0-.384.15-.384.376v1.333c0 .225.15.368.384.368Z"},"children":[]},{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M15.447 17H4.553C2.872 17 2 16.136 2 14.492V5.508C2 3.857 2.872 3 4.553 3h10.894C17.128 3 18 3.857 18 5.508v8.984C18 16.143 17.128 17 15.447 17Zm-.093-1.513c.724 0 1.12-.378 1.12-1.127V5.633c0-.749-.396-1.12-1.12-1.12H9.12v10.975h6.233ZM4.646 4.513c-.716 0-1.12.37-1.12 1.119v8.729c0 .748.404 1.126 1.12 1.126h3.028V4.513H4.646Z"},"children":[]}],"metadata":""}]},"name":"slide-menu"};
|
|
7
|
+
|
|
8
|
+
export default SlideMenu;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const SlideMenuOpened: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"width":20,"height":20},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M4.553 17h10.894C17.128 17 18 16.143 18 14.492V5.508C18 3.857 17.128 3 15.447 3H4.553C2.872 3 2 3.857 2 5.508v8.984C2 16.136 2.872 17 4.553 17Zm11.922-2.64c0 .75-.397 1.127-1.121 1.127H9.12V4.513h6.233c.724 0 1.12.37 1.12 1.119v8.729ZM6.33 7.878H4.984c-.233 0-.384-.143-.384-.368V6.176c0-.233.143-.376.384-.376H6.33c.226 0 .369.143.369.376V7.51c0 .225-.15.368-.369.368Zm0 3.079H4.984c-.233 0-.384-.15-.384-.369v-1.34c0-.225.143-.376.384-.376H6.33c.226 0 .369.15.369.376v1.34c0 .218-.15.369-.369.369Zm0 3.063H4.984c-.233 0-.384-.143-.384-.368v-1.333c0-.226.143-.376.384-.376H6.33c.226 0 .369.15.369.376v1.333c0 .225-.15.368-.369.368Z"},"children":[]}],"metadata":""}]},"name":"slide-menu-opened"};
|
|
7
|
+
|
|
8
|
+
export default SlideMenuOpened;
|
package/src/icons/ast/index.tsx
CHANGED
|
@@ -40,6 +40,7 @@ export { default as DoubleArrowLeft } from './DoubleArrowLeft';
|
|
|
40
40
|
export { default as DoubleArrowRight } from './DoubleArrowRight';
|
|
41
41
|
export { default as DragBlockHandle } from './DragBlockHandle';
|
|
42
42
|
export { default as DragHandle } from './DragHandle';
|
|
43
|
+
export { default as Email } from './Email';
|
|
43
44
|
export { default as ExtensionAssignments } from './ExtensionAssignments';
|
|
44
45
|
export { default as ExtensionAvatar } from './ExtensionAvatar';
|
|
45
46
|
export { default as ExtensionComments } from './ExtensionComments';
|
|
@@ -131,8 +132,13 @@ export { default as SelfReferenceOn } from './SelfReferenceOn';
|
|
|
131
132
|
export { default as Settings } from './Settings';
|
|
132
133
|
export { default as Share } from './Share';
|
|
133
134
|
export { default as Shared } from './Shared';
|
|
135
|
+
export { default as SidebarFieldsOpened } from './SidebarFieldsOpened';
|
|
136
|
+
export { default as SidebarFields } from './SidebarFields';
|
|
134
137
|
export { default as Sidebar } from './Sidebar';
|
|
138
|
+
export { default as SlackIcon } from './SlackIcon';
|
|
135
139
|
export { default as Slack } from './Slack';
|
|
140
|
+
export { default as SlideMenuOpened } from './SlideMenuOpened';
|
|
141
|
+
export { default as SlideMenu } from './SlideMenu';
|
|
136
142
|
export { default as SmartFolder } from './SmartFolder';
|
|
137
143
|
export { default as SortOnBottom } from './SortOnBottom';
|
|
138
144
|
export { default as SortOnTop } from './SortOnTop';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import EmailSvg from '../ast/Email';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const Email = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={EmailSvg} />;
|
|
10
|
+
|
|
11
|
+
Email.displayName = 'Email';
|
|
12
|
+
export default Email;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import SidebarFieldsSvg from '../ast/SidebarFields';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const SidebarFields = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={SidebarFieldsSvg} />;
|
|
10
|
+
|
|
11
|
+
SidebarFields.displayName = 'SidebarFields';
|
|
12
|
+
export default SidebarFields;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import SidebarFieldsOpenedSvg from '../ast/SidebarFieldsOpened';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const SidebarFieldsOpened = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={SidebarFieldsOpenedSvg} />;
|
|
10
|
+
|
|
11
|
+
SidebarFieldsOpened.displayName = 'SidebarFieldsOpened';
|
|
12
|
+
export default SidebarFieldsOpened;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import SlackIconSvg from '../ast/SlackIcon';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const SlackIcon = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={SlackIconSvg} />;
|
|
10
|
+
|
|
11
|
+
SlackIcon.displayName = 'SlackIcon';
|
|
12
|
+
export default SlackIcon;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import SlideMenuSvg from '../ast/SlideMenu';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const SlideMenu = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={SlideMenuSvg} />;
|
|
10
|
+
|
|
11
|
+
SlideMenu.displayName = 'SlideMenu';
|
|
12
|
+
export default SlideMenu;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import SlideMenuOpenedSvg from '../ast/SlideMenuOpened';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const SlideMenuOpened = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={SlideMenuOpenedSvg} />;
|
|
10
|
+
|
|
11
|
+
SlideMenuOpened.displayName = 'SlideMenuOpened';
|
|
12
|
+
export default SlideMenuOpened;
|
|
@@ -40,6 +40,7 @@ export { default as DoubleArrowLeft } from './DoubleArrowLeft';
|
|
|
40
40
|
export { default as DoubleArrowRight } from './DoubleArrowRight';
|
|
41
41
|
export { default as DragBlockHandle } from './DragBlockHandle';
|
|
42
42
|
export { default as DragHandle } from './DragHandle';
|
|
43
|
+
export { default as Email } from './Email';
|
|
43
44
|
export { default as ExtensionAssignments } from './ExtensionAssignments';
|
|
44
45
|
export { default as ExtensionAvatar } from './ExtensionAvatar';
|
|
45
46
|
export { default as ExtensionComments } from './ExtensionComments';
|
|
@@ -131,8 +132,13 @@ export { default as SelfReferenceOn } from './SelfReferenceOn';
|
|
|
131
132
|
export { default as Settings } from './Settings';
|
|
132
133
|
export { default as Share } from './Share';
|
|
133
134
|
export { default as Shared } from './Shared';
|
|
135
|
+
export { default as SidebarFieldsOpened } from './SidebarFieldsOpened';
|
|
136
|
+
export { default as SidebarFields } from './SidebarFields';
|
|
134
137
|
export { default as Sidebar } from './Sidebar';
|
|
138
|
+
export { default as SlackIcon } from './SlackIcon';
|
|
135
139
|
export { default as Slack } from './Slack';
|
|
140
|
+
export { default as SlideMenuOpened } from './SlideMenuOpened';
|
|
141
|
+
export { default as SlideMenu } from './SlideMenu';
|
|
136
142
|
export { default as SmartFolder } from './SmartFolder';
|
|
137
143
|
export { default as SortOnBottom } from './SortOnBottom';
|
|
138
144
|
export { default as SortOnTop } from './SortOnTop';
|
package/src/loading-sausage.tsx
CHANGED
|
@@ -139,7 +139,7 @@ type SausageListProps = {
|
|
|
139
139
|
amount?: number;
|
|
140
140
|
minAmount?: number;
|
|
141
141
|
maxAmount?: number;
|
|
142
|
-
WrapperComponent?: ({children}: {children: JSX.Element}) => JSX.Element;
|
|
142
|
+
WrapperComponent?: ({children}: {children: JSX.Element}) => JSX.Element | null;
|
|
143
143
|
} & Omit<Props, "index">;
|
|
144
144
|
export const LoadingSausageList = memo<SausageListProps>(function LoadingSausageList({
|
|
145
145
|
amount,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2
|
+
const noop = () => {};
|
|
3
|
+
export function getMediaQueryList(query: string) {
|
|
4
|
+
// need for test
|
|
5
|
+
return typeof window !== undefined && window.matchMedia
|
|
6
|
+
? window.matchMedia(query)
|
|
7
|
+
: ({matches: false, addEventListener: noop, removeEventListener: noop} as unknown as MediaQueryList);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function subscribeOnChange(mediaQueryList: MediaQueryList, cb: (evt: MediaQueryListEvent) => void): () => void {
|
|
11
|
+
// Safari 13 doesn't support addEventListener here
|
|
12
|
+
if (mediaQueryList.addEventListener) {
|
|
13
|
+
mediaQueryList.addEventListener("change", cb);
|
|
14
|
+
return () => {
|
|
15
|
+
mediaQueryList.removeEventListener("change", cb);
|
|
16
|
+
};
|
|
17
|
+
} else if (mediaQueryList.addListener) {
|
|
18
|
+
mediaQueryList.addListener(cb);
|
|
19
|
+
return () => {
|
|
20
|
+
mediaQueryList.removeListener(cb);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return noop;
|
|
24
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import {getMediaQueryList, subscribeOnChange as subscribeOnMediaQueryChange} from "./media-query-utils";
|
|
2
|
+
|
|
3
|
+
const listenersThemeMode = new Map();
|
|
4
|
+
const listenersThemePreference = new Map();
|
|
5
|
+
const listenersThemeMenuPreference = new Map();
|
|
6
|
+
|
|
7
|
+
const themePreferenceKey = "theme-preference";
|
|
8
|
+
const themeMenuPreferenceKey = "theme-menu-preference";
|
|
9
|
+
|
|
10
|
+
export type ThemePreference = "dark" | "light" | "auto";
|
|
11
|
+
export type ThemeMenuPreference = "dark" | "auto";
|
|
12
|
+
|
|
13
|
+
export type ThemeMode = "dark" | "light" | "light2";
|
|
14
|
+
|
|
15
|
+
export function getThemePreference(): ThemePreference {
|
|
16
|
+
try {
|
|
17
|
+
const item = localStorage.getItem(themePreferenceKey);
|
|
18
|
+
if (item === "auto") {
|
|
19
|
+
return "auto";
|
|
20
|
+
} else if (item === "dark") {
|
|
21
|
+
return "dark";
|
|
22
|
+
} else if (item === "light") {
|
|
23
|
+
return "light";
|
|
24
|
+
}
|
|
25
|
+
} catch (e) {
|
|
26
|
+
return "light";
|
|
27
|
+
}
|
|
28
|
+
return "light";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function getThemeMenuPreference(): ThemeMenuPreference {
|
|
32
|
+
try {
|
|
33
|
+
const item = localStorage.getItem(themeMenuPreferenceKey);
|
|
34
|
+
if (item === "dark") {
|
|
35
|
+
return "dark";
|
|
36
|
+
}
|
|
37
|
+
} catch (e) {
|
|
38
|
+
return "auto";
|
|
39
|
+
}
|
|
40
|
+
return "auto";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const darkModeQuery = "(prefers-color-scheme: dark)";
|
|
44
|
+
|
|
45
|
+
function getDarkMediaQuery() {
|
|
46
|
+
return getMediaQueryList(darkModeQuery);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function getThemeMode(): ThemeMode {
|
|
50
|
+
const preference = getThemePreference();
|
|
51
|
+
const menuPreference = getThemeMenuPreference();
|
|
52
|
+
|
|
53
|
+
if (preference === "auto") {
|
|
54
|
+
const matches = getDarkMediaQuery().matches;
|
|
55
|
+
if (matches) {
|
|
56
|
+
return "dark";
|
|
57
|
+
}
|
|
58
|
+
if (menuPreference === "dark") {
|
|
59
|
+
return "light2";
|
|
60
|
+
}
|
|
61
|
+
return "light";
|
|
62
|
+
} else if (preference === "dark") {
|
|
63
|
+
return "dark";
|
|
64
|
+
}
|
|
65
|
+
if (menuPreference === "dark") {
|
|
66
|
+
return "light2";
|
|
67
|
+
}
|
|
68
|
+
return "light";
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function setThemeMenuPreference(menuPreference: ThemeMenuPreference) {
|
|
72
|
+
try {
|
|
73
|
+
if (getThemeMenuPreference() !== menuPreference) {
|
|
74
|
+
localStorage.setItem(themeMenuPreferenceKey, menuPreference);
|
|
75
|
+
listenersThemeMode.forEach((cb) => {
|
|
76
|
+
cb(getThemeMode());
|
|
77
|
+
});
|
|
78
|
+
listenersThemeMenuPreference.forEach((cb) => {
|
|
79
|
+
cb(menuPreference);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
} catch (e) {
|
|
83
|
+
// skip error
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function setThemePreference(preference: ThemePreference) {
|
|
88
|
+
try {
|
|
89
|
+
if (getThemePreference() !== preference) {
|
|
90
|
+
localStorage.setItem(themePreferenceKey, preference);
|
|
91
|
+
listenersThemeMode.forEach((cb) => {
|
|
92
|
+
cb(getThemeMode());
|
|
93
|
+
});
|
|
94
|
+
listenersThemePreference.forEach((cb) => {
|
|
95
|
+
cb(preference);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
} catch (e) {
|
|
99
|
+
// skip error
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function subscribeOnThemeMenuPreferenceChange(
|
|
104
|
+
cb: (themeMenuPreference: ThemeMenuPreference) => void
|
|
105
|
+
): () => void {
|
|
106
|
+
listenersThemeMenuPreference.set(cb, cb);
|
|
107
|
+
let currentPref = getThemeMenuPreference();
|
|
108
|
+
const storageListener = () => {
|
|
109
|
+
const newMenuPref = getThemeMenuPreference();
|
|
110
|
+
if (currentPref !== newMenuPref) {
|
|
111
|
+
currentPref = newMenuPref;
|
|
112
|
+
cb(newMenuPref);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
window.addEventListener("storage", storageListener);
|
|
116
|
+
return () => {
|
|
117
|
+
listenersThemeMenuPreference.delete(cb);
|
|
118
|
+
window.removeEventListener("storage", storageListener);
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function subscribeOnThemePreferenceChange(cb: (themePreference: ThemePreference) => void): () => void {
|
|
123
|
+
listenersThemePreference.set(cb, cb);
|
|
124
|
+
let currentPref = getThemePreference();
|
|
125
|
+
const storageListener = () => {
|
|
126
|
+
const newPref = getThemePreference();
|
|
127
|
+
if (currentPref !== newPref) {
|
|
128
|
+
currentPref = newPref;
|
|
129
|
+
cb(newPref);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
window.addEventListener("storage", storageListener);
|
|
133
|
+
return () => {
|
|
134
|
+
listenersThemePreference.delete(cb);
|
|
135
|
+
window.removeEventListener("storage", storageListener);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function subscribeOnThemeModeChange(cb: (themeMode: ThemeMode) => void): () => void {
|
|
140
|
+
listenersThemeMode.set(cb, cb);
|
|
141
|
+
let currentPref = getThemePreference();
|
|
142
|
+
let currentMenuPref = getThemeMenuPreference();
|
|
143
|
+
const darkMediaQuery = getDarkMediaQuery();
|
|
144
|
+
const storageListener = () => {
|
|
145
|
+
const newPref = getThemePreference();
|
|
146
|
+
const newMenuPref = getThemeMenuPreference();
|
|
147
|
+
if (currentPref !== newPref || currentMenuPref !== newMenuPref) {
|
|
148
|
+
currentPref = newPref;
|
|
149
|
+
currentMenuPref = newMenuPref;
|
|
150
|
+
cb(getThemeMode());
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
window.addEventListener("storage", storageListener);
|
|
154
|
+
const unsubscribe = subscribeOnMediaQueryChange(darkMediaQuery, () => {
|
|
155
|
+
if (getThemePreference() === "auto") {
|
|
156
|
+
cb(getThemeMode());
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
return () => {
|
|
160
|
+
listenersThemeMode.delete(cb);
|
|
161
|
+
unsubscribe();
|
|
162
|
+
window.removeEventListener("storage", storageListener);
|
|
163
|
+
};
|
|
164
|
+
}
|