@trycourier/courier-ui-inbox 1.0.18 → 1.2.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/README.md +10 -315
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +149 -968
- package/dist/index.mjs.map +1 -1
- package/dist/types/courier-inbox-theme-manager.d.ts +17 -37
- package/dist/types/courier-inbox-theme.d.ts +5 -27
- package/package.json +6 -4
|
@@ -1,51 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CourierThemeManager, CourierThemeSubscription, SystemThemeMode } from '@trycourier/courier-ui-core';
|
|
2
2
|
import { CourierInboxTheme } from './courier-inbox-theme';
|
|
3
|
-
export interface CourierInboxThemeSubscription {
|
|
3
|
+
export interface CourierInboxThemeSubscription extends CourierThemeSubscription<CourierInboxTheme> {
|
|
4
4
|
manager: CourierInboxThemeManager;
|
|
5
|
-
unsubscribe: () => void;
|
|
6
5
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
private _subscriptions;
|
|
14
|
-
private _userMode;
|
|
15
|
-
private _systemMode;
|
|
16
|
-
private _systemThemeCleanup;
|
|
17
|
-
setLightTheme(theme: CourierInboxTheme): void;
|
|
18
|
-
setDarkTheme(theme: CourierInboxTheme): void;
|
|
6
|
+
/**
|
|
7
|
+
* Inbox-specific theme manager that extends the abstract CourierThemeManager.
|
|
8
|
+
* Provides inbox theme management with light/dark mode support.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CourierInboxThemeManager extends CourierThemeManager<CourierInboxTheme> {
|
|
11
|
+
protected readonly THEME_CHANGE_EVENT: string;
|
|
19
12
|
constructor(initialTheme: CourierInboxTheme);
|
|
20
13
|
/**
|
|
21
|
-
* Get the
|
|
14
|
+
* Get the default light theme for inbox
|
|
22
15
|
*/
|
|
23
|
-
|
|
16
|
+
protected getDefaultLightTheme(): CourierInboxTheme;
|
|
24
17
|
/**
|
|
25
|
-
* Get the
|
|
18
|
+
* Get the default dark theme for inbox
|
|
26
19
|
*/
|
|
27
|
-
|
|
20
|
+
protected getDefaultDarkTheme(): CourierInboxTheme;
|
|
28
21
|
/**
|
|
29
|
-
*
|
|
22
|
+
* Merge the inbox theme with defaults
|
|
30
23
|
*/
|
|
31
|
-
|
|
24
|
+
protected mergeTheme(mode: SystemThemeMode, theme: CourierInboxTheme): CourierInboxTheme;
|
|
32
25
|
/**
|
|
33
|
-
*
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Set the mode and notify all listeners
|
|
38
|
-
*/
|
|
39
|
-
setMode(mode: CourierComponentThemeMode): void;
|
|
40
|
-
get mode(): CourierComponentThemeMode;
|
|
41
|
-
/**
|
|
42
|
-
* Subscribe to theme changes
|
|
43
|
-
* @param {Function} callback - Function to run when the theme changes
|
|
44
|
-
* @returns {CourierInboxThemeSubscription} - Object with remove method to stop listening
|
|
26
|
+
* Subscribe to inbox theme changes
|
|
27
|
+
* @param callback - Function to run when the theme changes
|
|
28
|
+
* @returns Object with unsubscribe method to stop listening
|
|
45
29
|
*/
|
|
46
30
|
subscribe(callback: (theme: CourierInboxTheme) => void): CourierInboxThemeSubscription;
|
|
47
|
-
/**
|
|
48
|
-
* Clean up event listeners
|
|
49
|
-
*/
|
|
50
|
-
cleanup(): void;
|
|
51
31
|
}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { SystemThemeMode } from '@trycourier/courier-ui-core';
|
|
2
|
-
export type CourierInboxFontTheme =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
color?: string;
|
|
7
|
-
};
|
|
8
|
-
export type CourierInboxIconTheme = {
|
|
9
|
-
color?: string;
|
|
10
|
-
svg?: string;
|
|
11
|
-
};
|
|
1
|
+
import { SystemThemeMode, CourierFontTheme, CourierIconTheme, CourierButtonTheme, CourierIconButtonTheme } from '@trycourier/courier-ui-core';
|
|
2
|
+
export type CourierInboxFontTheme = CourierFontTheme;
|
|
3
|
+
export type CourierInboxIconTheme = CourierIconTheme;
|
|
4
|
+
export type CourierInboxButtonTheme = CourierButtonTheme;
|
|
5
|
+
export type CourierInboxIconButtonTheme = CourierIconButtonTheme;
|
|
12
6
|
export type CourierInboxFilterItemTheme = {
|
|
13
7
|
icon?: CourierInboxIconTheme;
|
|
14
8
|
text?: string;
|
|
@@ -25,22 +19,6 @@ export type CourierInboxUnreadCountIndicatorTheme = {
|
|
|
25
19
|
borderRadius?: string;
|
|
26
20
|
padding?: string;
|
|
27
21
|
};
|
|
28
|
-
export type CourierInboxIconButtonTheme = {
|
|
29
|
-
icon?: CourierInboxIconTheme;
|
|
30
|
-
backgroundColor?: string;
|
|
31
|
-
hoverBackgroundColor?: string;
|
|
32
|
-
activeBackgroundColor?: string;
|
|
33
|
-
};
|
|
34
|
-
export type CourierInboxButtonTheme = {
|
|
35
|
-
font?: CourierInboxFontTheme;
|
|
36
|
-
text?: string;
|
|
37
|
-
shadow?: string;
|
|
38
|
-
border?: string;
|
|
39
|
-
borderRadius?: string;
|
|
40
|
-
backgroundColor?: string;
|
|
41
|
-
hoverBackgroundColor?: string;
|
|
42
|
-
activeBackgroundColor?: string;
|
|
43
|
-
};
|
|
44
22
|
export type CourierInboxMenuButtonTheme = CourierInboxIconButtonTheme & {
|
|
45
23
|
unreadDotIndicator?: CourierInboxUnreadDotIndicatorTheme;
|
|
46
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trycourier/courier-ui-inbox",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Inbox components for the Courier web UI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -8,10 +8,12 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"dev": "vite",
|
|
10
10
|
"build": "vite build",
|
|
11
|
+
"build:ci": "yarn build && yarn generate-api-doc",
|
|
11
12
|
"watch": "vite build --watch",
|
|
12
13
|
"preview": "vite preview",
|
|
13
14
|
"prepare": "npm run build",
|
|
14
|
-
"test": "jest"
|
|
15
|
+
"test": "jest",
|
|
16
|
+
"generate-api-doc": "api-extractor run"
|
|
15
17
|
},
|
|
16
18
|
"keywords": [
|
|
17
19
|
"courier",
|
|
@@ -26,8 +28,8 @@
|
|
|
26
28
|
"dist"
|
|
27
29
|
],
|
|
28
30
|
"dependencies": {
|
|
29
|
-
"@trycourier/courier-js": "2.0
|
|
30
|
-
"@trycourier/courier-ui-core": "1.0.
|
|
31
|
+
"@trycourier/courier-js": "2.1.0",
|
|
32
|
+
"@trycourier/courier-ui-core": "1.0.14"
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
33
35
|
"@types/jest": "29.5.14",
|