@open-mercato/ui 0.4.6-develop-18ffe6bc13 → 0.4.6-develop-06c0791dc9

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.
@@ -6,9 +6,9 @@ import { useT } from "@open-mercato/shared/lib/i18n/context";
6
6
  import { cn } from "@open-mercato/shared/lib/utils";
7
7
  import { Button } from "../../primitives/button.js";
8
8
  import { useMessagesPoll } from "./useMessagesPoll.js";
9
- function MessagesIcon({ className, canViewMessages = true }) {
9
+ function MessagesIcon({ className }) {
10
10
  const t = useT();
11
- const { unreadCount, hasNew } = useMessagesPoll({ enabled: canViewMessages });
11
+ const { unreadCount, hasNew } = useMessagesPoll();
12
12
  const ariaLabel = unreadCount > 0 ? t("messages.badge.unread", "{count} unread messages", { count: unreadCount }) : t("messages.nav.inbox", "Messages");
13
13
  return /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", asChild: true, className: cn("relative", className), children: /* @__PURE__ */ jsxs(Link, { href: "/backend/messages", "aria-label": ariaLabel, children: [
14
14
  /* @__PURE__ */ jsx(Mail, { className: cn("h-5 w-5", hasNew && "animate-pulse") }),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/backend/messages/MessagesIcon.tsx"],
4
- "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport Link from 'next/link'\nimport { Mail } from 'lucide-react'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { cn } from '@open-mercato/shared/lib/utils'\nimport { Button } from '../../primitives/button'\nimport { useMessagesPoll } from './useMessagesPoll'\n\nexport type MessagesIconProps = {\n className?: string\n canViewMessages?: boolean\n}\n\nexport function MessagesIcon({ className, canViewMessages = true }: MessagesIconProps) {\n const t = useT()\n const { unreadCount, hasNew } = useMessagesPoll({ enabled: canViewMessages })\n\n const ariaLabel = unreadCount > 0\n ? t('messages.badge.unread', '{count} unread messages', { count: unreadCount })\n : t('messages.nav.inbox', 'Messages')\n\n return (\n <Button variant=\"ghost\" size=\"icon\" asChild className={cn('relative', className)}>\n <Link href=\"/backend/messages\" aria-label={ariaLabel}>\n <Mail className={cn('h-5 w-5', hasNew && 'animate-pulse')} />\n {unreadCount > 0 ? (\n <span className=\"absolute -top-1 -right-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-orange-500 px-1 text-[10px] font-medium text-white dark:bg-destructive dark:text-destructive-foreground\">\n {unreadCount > 99 ? '99+' : unreadCount}\n </span>\n ) : null}\n </Link>\n </Button>\n )\n}\n"],
5
- "mappings": ";AAyBM,SACE,KADF;AAtBN,OAAO,UAAU;AACjB,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,uBAAuB;AAOzB,SAAS,aAAa,EAAE,WAAW,kBAAkB,KAAK,GAAsB;AACrF,QAAM,IAAI,KAAK;AACf,QAAM,EAAE,aAAa,OAAO,IAAI,gBAAgB,EAAE,SAAS,gBAAgB,CAAC;AAE5E,QAAM,YAAY,cAAc,IAC5B,EAAE,yBAAyB,2BAA2B,EAAE,OAAO,YAAY,CAAC,IAC5E,EAAE,sBAAsB,UAAU;AAEtC,SACE,oBAAC,UAAO,SAAQ,SAAQ,MAAK,QAAO,SAAO,MAAC,WAAW,GAAG,YAAY,SAAS,GAC7E,+BAAC,QAAK,MAAK,qBAAoB,cAAY,WACzC;AAAA,wBAAC,QAAK,WAAW,GAAG,WAAW,UAAU,eAAe,GAAG;AAAA,IAC1D,cAAc,IACb,oBAAC,UAAK,WAAU,iMACb,wBAAc,KAAK,QAAQ,aAC9B,IACE;AAAA,KACN,GACF;AAEJ;",
4
+ "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport Link from 'next/link'\nimport { Mail } from 'lucide-react'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { cn } from '@open-mercato/shared/lib/utils'\nimport { Button } from '../../primitives/button'\nimport { useMessagesPoll } from './useMessagesPoll'\n\nexport type MessagesIconProps = {\n className?: string\n}\n\nexport function MessagesIcon({ className }: MessagesIconProps) {\n const t = useT()\n const { unreadCount, hasNew } = useMessagesPoll()\n\n const ariaLabel = unreadCount > 0\n ? t('messages.badge.unread', '{count} unread messages', { count: unreadCount })\n : t('messages.nav.inbox', 'Messages')\n\n return (\n <Button variant=\"ghost\" size=\"icon\" asChild className={cn('relative', className)}>\n <Link href=\"/backend/messages\" aria-label={ariaLabel}>\n <Mail className={cn('h-5 w-5', hasNew && 'animate-pulse')} />\n {unreadCount > 0 ? (\n <span className=\"absolute -top-1 -right-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-orange-500 px-1 text-[10px] font-medium text-white dark:bg-destructive dark:text-destructive-foreground\">\n {unreadCount > 99 ? '99+' : unreadCount}\n </span>\n ) : null}\n </Link>\n </Button>\n )\n}\n"],
5
+ "mappings": ";AAwBM,SACE,KADF;AArBN,OAAO,UAAU;AACjB,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,uBAAuB;AAMzB,SAAS,aAAa,EAAE,UAAU,GAAsB;AAC7D,QAAM,IAAI,KAAK;AACf,QAAM,EAAE,aAAa,OAAO,IAAI,gBAAgB;AAEhD,QAAM,YAAY,cAAc,IAC5B,EAAE,yBAAyB,2BAA2B,EAAE,OAAO,YAAY,CAAC,IAC5E,EAAE,sBAAsB,UAAU;AAEtC,SACE,oBAAC,UAAO,SAAQ,SAAQ,MAAK,QAAO,SAAO,MAAC,WAAW,GAAG,YAAY,SAAS,GAC7E,+BAAC,QAAK,MAAK,qBAAoB,cAAY,WACzC;AAAA,wBAAC,QAAK,WAAW,GAAG,WAAW,UAAU,eAAe,GAAG;AAAA,IAC1D,cAAc,IACb,oBAAC,UAAK,WAAU,iMACb,wBAAc,KAAK,QAAQ,aAC9B,IACE;AAAA,KACN,GACF;AAEJ;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/ui",
3
- "version": "0.4.6-develop-18ffe6bc13",
3
+ "version": "0.4.6-develop-06c0791dc9",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -116,7 +116,7 @@
116
116
  }
117
117
  },
118
118
  "dependencies": {
119
- "@open-mercato/shared": "0.4.6-develop-18ffe6bc13",
119
+ "@open-mercato/shared": "0.4.6-develop-06c0791dc9",
120
120
  "@radix-ui/react-popover": "^1.1.6",
121
121
  "@radix-ui/react-tooltip": "^1.2.8",
122
122
  "date-fns": "^4.1.0",
@@ -10,12 +10,11 @@ import { useMessagesPoll } from './useMessagesPoll'
10
10
 
11
11
  export type MessagesIconProps = {
12
12
  className?: string
13
- canViewMessages?: boolean
14
13
  }
15
14
 
16
- export function MessagesIcon({ className, canViewMessages = true }: MessagesIconProps) {
15
+ export function MessagesIcon({ className }: MessagesIconProps) {
17
16
  const t = useT()
18
- const { unreadCount, hasNew } = useMessagesPoll({ enabled: canViewMessages })
17
+ const { unreadCount, hasNew } = useMessagesPoll()
19
18
 
20
19
  const ariaLabel = unreadCount > 0
21
20
  ? t('messages.badge.unread', '{count} unread messages', { count: unreadCount })