@pushwoosh/dumb-components 4.10.0 → 4.10.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.
@@ -46,8 +46,8 @@ export const CHAT_CHANNELS = {
46
46
  skin: {
47
47
  headerBackground: '#06C755',
48
48
  headerText: '#FFFFFF',
49
- chatBackground: '#8CABD9',
50
- bubble: '#FFFFFF',
49
+ chatBackground: '#FFFFFF',
50
+ bubble: '#F1F2F4',
51
51
  bubbleText: '#111111',
52
52
  accent: '#06C755',
53
53
  chipBorder: '#06C755'
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Color } from '@pushwoosh/kit-constants';
3
3
  import { NotificationIcon } from '@pushwoosh/kit-icons';
4
+ import { useLang } from './polyglot';
4
5
  import { NotificationBarButton, NotificationBarIcon, NotificationBarBadge, NotificationBarText, NotificationBarBadgeText } from './styles';
5
6
  function getIconView(isOpened, filled, hasNotifications) {
6
7
  if (isOpened && !hasNotifications) return 'lined';
@@ -22,6 +23,7 @@ export function NotificationBar({
22
23
  count = 0,
23
24
  onClick
24
25
  }) {
26
+ const lang = useLang();
25
27
  const hasNotifications = count > 0 && type !== 'no-notifications';
26
28
  const shouldUseFilledIcon = !isOpened && (!read && type !== 'no-notifications' || read);
27
29
  const getIconColor = () => {
@@ -49,7 +51,9 @@ export function NotificationBar({
49
51
  color: getIconColor()
50
52
  })
51
53
  }), _jsx(NotificationBarText, {
52
- children: "Notification center"
54
+ children: lang({
55
+ message: 'DUMB.NOTIFICATION_INBOX.BAR_LABEL'
56
+ })
53
57
  }), hasNotifications && _jsx(NotificationBarBadge, {
54
58
  children: _jsx(NotificationBarBadgeText, {
55
59
  "$variant": "h4",
@@ -7,4 +7,4 @@ import type { NotificationInboxProps } from './types';
7
7
  * @example
8
8
  * <NotificationInbox notifications={items} hasMore={hasMore} onLoadMore={loadMore} onNotificationClick={open} />
9
9
  */
10
- export declare function NotificationInbox({ notifications, isLoading, hasMore, onLoadMore, onNotificationClick, onMarkAsRead, emptyStateTitle, emptyStateDescription, }: NotificationInboxProps): ReactElement;
10
+ export declare function NotificationInbox({ notifications, isLoading, hasMore, onLoadMore, onNotificationClick, onMarkAsRead, emptyStateTitle: emptyStateTitleProp, emptyStateDescription: emptyStateDescriptionProp, }: NotificationInboxProps): ReactElement;
@@ -9,7 +9,8 @@ import { useInfiniteScroll } from './useInfiniteScroll';
9
9
  import { Badge } from '../Badge';
10
10
  import { Spinner } from '../Spinner';
11
11
  import emptyNotificationsIcon from './assets/EmptyNotifications.svg?url';
12
- import { Lang } from './polyglot';
12
+ import { Lang, useLang } from './polyglot';
13
+ import { useLanguage } from '../polyglot';
13
14
  import { NotificationInboxContainer, NotificationInboxHeader, NotificationInboxTitle, NotificationInboxList, NotificationItem, NotificationIndicator, NotificationHeader, NotificationDescription, NotificationActionLink, NotificationInboxEmptyIcon } from './styles';
14
15
  /**
15
16
  * Scrollable notification list with severity indicators, read state, per-item
@@ -25,9 +26,17 @@ export function NotificationInbox({
25
26
  onLoadMore,
26
27
  onNotificationClick,
27
28
  onMarkAsRead,
28
- emptyStateTitle = 'No notifications yet',
29
- emptyStateDescription = 'You\'ll see updates and alerts here once something requires your attention.'
29
+ emptyStateTitle: emptyStateTitleProp,
30
+ emptyStateDescription: emptyStateDescriptionProp
30
31
  }) {
32
+ const lang = useLang();
33
+ const language = useLanguage();
34
+ const emptyStateTitle = emptyStateTitleProp ?? lang({
35
+ message: 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE'
36
+ });
37
+ const emptyStateDescription = emptyStateDescriptionProp ?? lang({
38
+ message: 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION'
39
+ });
31
40
  const descriptionRefs = useRef({});
32
41
  const [expandedId, setExpandedId] = useState(null);
33
42
  const [showExpandMap, setShowExpandMap] = useState({});
@@ -135,7 +144,7 @@ export function NotificationInbox({
135
144
  children: [_jsx(Text, {
136
145
  "$variant": "footnote",
137
146
  "$color": Color.LOCKED,
138
- children: formatTimestamp(notification.timestamp)
147
+ children: formatTimestamp(notification.timestamp, language)
139
148
  }), notification.projectName && _jsxs(_Fragment, {
140
149
  children: [_jsx(Text, {
141
150
  "$color": Color.LOCKED,
@@ -1 +1 @@
1
- export declare function formatTimestamp(timestamp: string | Date): string;
1
+ export declare function formatTimestamp(timestamp: string | Date, language: string): string;
@@ -1,7 +1,7 @@
1
- export function formatTimestamp(timestamp) {
1
+ export function formatTimestamp(timestamp, language) {
2
2
  const date = typeof timestamp === 'string' ? new Date(timestamp) : timestamp;
3
3
  const day = date.getDate();
4
- const month = date.toLocaleString('en-US', {
4
+ const month = date.toLocaleString(language, {
5
5
  month: 'short'
6
6
  });
7
7
  const hours = date.getHours();
@@ -4,5 +4,8 @@ export const messages = {
4
4
  'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'طي',
5
5
  'DUMB.NOTIFICATION_INBOX.EXPAND': 'توسيع',
6
6
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'جارٍ تحميل المزيد…',
7
- 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'لديك إشعارات غير مقروءة'
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'لديك إشعارات غير مقروءة',
8
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'مركز الإشعارات',
9
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'لا توجد إشعارات بعد',
10
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'ستظهر هنا التحديثات والتنبيهات عندما يتطلب أمر ما انتباهك.'
8
11
  };
@@ -4,5 +4,8 @@ export const messages = {
4
4
  'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'সংকুচিত করুন',
5
5
  'DUMB.NOTIFICATION_INBOX.EXPAND': 'প্রসারিত করুন',
6
6
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'আরও লোড হচ্ছে…',
7
- 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'আপনার অপঠিত বিজ্ঞপ্তি রয়েছে'
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'আপনার অপঠিত বিজ্ঞপ্তি রয়েছে',
8
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'নোটিফিকেশন কেন্দ্র',
9
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'এখনও কোনো নোটিফিকেশন নেই',
10
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'কোনো কিছুতে আপনার মনোযোগ প্রয়োজন হলে আপডেট ও অ্যালার্ট এখানে দেখা যাবে।'
8
11
  };
@@ -4,5 +4,8 @@ export const messages = {
4
4
  'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Einklappen',
5
5
  'DUMB.NOTIFICATION_INBOX.EXPAND': 'Ausklappen',
6
6
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Mehr wird geladen…',
7
- 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Sie haben ungelesene Benachrichtigungen'
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Sie haben ungelesene Benachrichtigungen',
8
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'Benachrichtigungszentrale',
9
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'Noch keine Benachrichtigungen',
10
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'Hier sehen Sie Updates und Warnungen, sobald etwas Ihre Aufmerksamkeit erfordert.'
8
11
  };
@@ -4,5 +4,8 @@ export const messages = {
4
4
  'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Collapse',
5
5
  'DUMB.NOTIFICATION_INBOX.EXPAND': 'Expand',
6
6
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Loading more…',
7
- 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'You have unread notifications'
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'You have unread notifications',
8
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'Notification center',
9
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'No notifications yet',
10
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'You\'ll see updates and alerts here once something requires your attention.'
8
11
  };
@@ -4,5 +4,8 @@ export const messages = {
4
4
  'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Contraer',
5
5
  'DUMB.NOTIFICATION_INBOX.EXPAND': 'Expandir',
6
6
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Cargando más…',
7
- 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Tienes notificaciones sin leer'
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Tienes notificaciones sin leer',
8
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'Centro de notificaciones',
9
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'Aún no hay notificaciones',
10
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'Aquí verás actualizaciones y alertas cuando algo requiera tu atención.'
8
11
  };
@@ -4,5 +4,8 @@ export const messages = {
4
4
  'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Réduire',
5
5
  'DUMB.NOTIFICATION_INBOX.EXPAND': 'Développer',
6
6
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Chargement de la suite…',
7
- 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Vous avez des notifications non lues'
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Vous avez des notifications non lues',
8
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'Centre de notifications',
9
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'Aucune notification pour le moment',
10
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'Vous verrez ici les mises à jour et les alertes dès que quelque chose nécessitera votre attention.'
8
11
  };
@@ -4,5 +4,8 @@ export const messages = {
4
4
  'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'כווץ',
5
5
  'DUMB.NOTIFICATION_INBOX.EXPAND': 'הרחב',
6
6
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'טוען עוד…',
7
- 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'יש לך התראות שלא נקראו'
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'יש לך התראות שלא נקראו',
8
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'מרכז התראות',
9
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'אין עדיין התראות',
10
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'עדכונים והתראות יופיעו כאן כשמשהו ידרוש את תשומת לבך.'
8
11
  };
@@ -4,5 +4,8 @@ export const messages = {
4
4
  'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'संक्षिप्त करें',
5
5
  'DUMB.NOTIFICATION_INBOX.EXPAND': 'विस्तृत करें',
6
6
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'और लोड हो रहा है…',
7
- 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'आपके पास अपठित सूचनाएँ हैं'
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'आपके पास अपठित सूचनाएँ हैं',
8
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'नोटिफिकेशन सेंटर',
9
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'अभी तक कोई सूचना नहीं',
10
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'जब किसी चीज़ पर आपका ध्यान देना ज़रूरी होगा, तो अपडेट और अलर्ट यहाँ दिखाई देंगे।'
8
11
  };
@@ -4,5 +4,8 @@ export const messages = {
4
4
  'DUMB.NOTIFICATION_INBOX.COLLAPSE': '折りたたむ',
5
5
  'DUMB.NOTIFICATION_INBOX.EXPAND': '展開する',
6
6
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'さらに読み込み中…',
7
- 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': '未読の通知があります'
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': '未読の通知があります',
8
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': '通知センター',
9
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'まだ通知はありません',
10
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': '対応が必要なことがあると、ここに更新情報やアラートが表示されます。'
8
11
  };
@@ -4,5 +4,8 @@ export const messages = {
4
4
  'DUMB.NOTIFICATION_INBOX.COLLAPSE': '접기',
5
5
  'DUMB.NOTIFICATION_INBOX.EXPAND': '펼치기',
6
6
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': '더 불러오는 중…',
7
- 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': '읽지 않은 알림이 있습니다'
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': '읽지 않은 알림이 있습니다',
8
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': '알림 센터',
9
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': '아직 알림이 없습니다',
10
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': '확인이 필요한 사항이 생기면 여기에 업데이트와 알림이 표시됩니다.'
8
11
  };
@@ -4,5 +4,8 @@ export const messages = {
4
4
  'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Recolher',
5
5
  'DUMB.NOTIFICATION_INBOX.EXPAND': 'Expandir',
6
6
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Carregando mais…',
7
- 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Você tem notificações não lidas'
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Você tem notificações não lidas',
8
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'Central de notificações',
9
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'Nenhuma notificação ainda',
10
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'Você verá atualizações e alertas aqui quando algo precisar da sua atenção.'
8
11
  };
@@ -4,5 +4,8 @@ export const messages = {
4
4
  'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Свернуть',
5
5
  'DUMB.NOTIFICATION_INBOX.EXPAND': 'Развернуть',
6
6
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Загрузка…',
7
- 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Есть непрочитанные уведомления'
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Есть непрочитанные уведомления',
8
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'Центр уведомлений',
9
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'Уведомлений пока нет',
10
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'Здесь появятся обновления и предупреждения, когда что-то потребует вашего внимания.'
8
11
  };
@@ -4,5 +4,8 @@ export const messages = {
4
4
  'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'ย่อ',
5
5
  'DUMB.NOTIFICATION_INBOX.EXPAND': 'ขยาย',
6
6
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'กำลังโหลดเพิ่มเติม…',
7
- 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'คุณมีการแจ้งเตือนที่ยังไม่ได้อ่าน'
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'คุณมีการแจ้งเตือนที่ยังไม่ได้อ่าน',
8
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': 'ศูนย์การแจ้งเตือน',
9
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': 'ยังไม่มีการแจ้งเตือน',
10
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': 'การอัปเดตและการแจ้งเตือนจะแสดงที่นี่เมื่อมีสิ่งที่ต้องให้คุณดำเนินการ'
8
11
  };
@@ -4,5 +4,8 @@ export const messages = {
4
4
  'DUMB.NOTIFICATION_INBOX.COLLAPSE': '收起',
5
5
  'DUMB.NOTIFICATION_INBOX.EXPAND': '展开',
6
6
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': '加载更多…',
7
- 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': '您有未读通知'
7
+ 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': '您有未读通知',
8
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': '通知中心',
9
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': '暂无通知',
10
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': '当有需要您关注的事项时,更新和提醒将显示在这里。'
8
11
  };
@@ -8,4 +8,7 @@ export type NotificationInboxMessages = {
8
8
  'DUMB.NOTIFICATION_INBOX.EXPAND': NoParams;
9
9
  'DUMB.NOTIFICATION_INBOX.LOADING_MORE': NoParams;
10
10
  'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': NoParams;
11
+ 'DUMB.NOTIFICATION_INBOX.BAR_LABEL': NoParams;
12
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_TITLE': NoParams;
13
+ 'DUMB.NOTIFICATION_INBOX.EMPTY_DESCRIPTION': NoParams;
11
14
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "4.10.0",
3
+ "version": "4.10.2",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",