@gearbox-protocol/ui-kit 3.14.0-next.43 → 3.14.0-next.44

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("@fortawesome/free-solid-svg-icons"),f=require("../../icons/fa-icon.cjs"),y=require("../../simple-dropdown/simple-dropdown.cjs");require("../../simple-dropdown/simple-dropdown-menu-item.cjs");const r=require("../../typed-intl/index.cjs"),n=require("../../typography/typography.cjs"),s=require("../../../test-ids/notification-center.cjs");require("react");require("@gearbox-protocol/sdk");const l=require("../../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../utils/z-index.cjs");function g({row:t}){const i=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:l.cn("mt-[5px] size-[7px] shrink-0 rounded-full",t.isReady?"bg-success":"bg-gray-50")}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx(n.Typography,{as:"span",variant:"bodySmall",className:"truncate text-foreground",children:t.title}),e.jsx(n.Typography,{as:"span",variant:"bodySmall",color:t.isReady?"success":"muted",className:"shrink-0 text-right",children:t.statusLabel})]}),e.jsx(n.Typography,{as:"span",variant:"bodySmall",color:"muted",children:t.positionName})]})]});return t.isReady&&t.onExecute?e.jsx("button",{type:"button","data-testid":s.notificationCenterTestIds.requestRow,onClick:t.onExecute,className:"flex w-full cursor-pointer items-start gap-2 py-4 text-left hover:opacity-80",children:i}):e.jsx("div",{"data-testid":s.notificationCenterTestIds.requestRow,className:"flex w-full items-start gap-2 py-4",children:i})}function h({open:t,onOpenChange:i,deferredRows:o,successRows:c,deferredCount:d,hasReady:m,hasAny:u,onClear:p}){return e.jsx(y.SimpleDropdown,{open:t,onOpenChange:i,align:"end",asChild:!0,className:"w-[460px] max-w-[calc(100vw-32px)] bg-modal p-0",title:e.jsxs("button",{type:"button","data-testid":s.notificationCenterTestIds.trigger,className:"relative flex size-8 items-center justify-center rounded-md text-secondary-foreground hover:text-foreground",children:[e.jsx(f.FaIcon,{icon:x.faBell,className:"size-4"}),d>0?e.jsx("span",{"data-testid":s.notificationCenterTestIds.badge,className:l.cn("absolute -right-0.5 -top-0.5 flex size-[15px] items-center justify-center rounded-full text-[10px] font-medium leading-none text-white",m?"bg-primary":"bg-gray-50"),children:d}):null]}),children:e.jsxs("div",{"data-testid":s.notificationCenterTestIds.panel,className:"flex flex-col p-8",children:[u?null:e.jsx(n.Typography,{as:"span",variant:"bodySmall",color:"muted","data-testid":s.notificationCenterTestIds.empty,children:e.jsx(r.FormattedMessageTyped,{messageId:"components.notificationCenter.empty"})}),o.length>0?e.jsxs("div",{className:"flex flex-col","data-testid":s.notificationCenterTestIds.requestsSection,children:[e.jsxs("div",{className:"flex items-center justify-between pb-2",children:[e.jsx(n.Typography,{as:"span",variant:"bodySmall",className:"font-medium text-foreground",children:e.jsx(r.FormattedMessageTyped,{messageId:"components.notificationCenter.requests"})}),p?e.jsx("button",{type:"button","data-testid":s.notificationCenterTestIds.clear,onClick:p,className:"cursor-pointer text-xs text-secondary-foreground hover:text-foreground",children:e.jsx(r.FormattedMessageTyped,{messageId:"components.notificationCenter.clear"})}):null]}),e.jsx("div",{className:"-mr-2 flex max-h-[40dvh] flex-col divide-y divide-gray-60 overflow-y-auto overflow-x-hidden pr-2 [scrollbar-gutter:stable]",children:o.map(a=>e.jsx(g,{row:a},a.id))})]}):null,c.length>0?e.jsxs("div",{className:l.cn("flex flex-col",o.length>0&&"mt-4 pt-4"),"data-testid":s.notificationCenterTestIds.successSection,children:[e.jsx(n.Typography,{as:"span",variant:"bodySmall",className:"pb-2 font-medium text-foreground",children:e.jsx(r.FormattedMessageTyped,{messageId:"components.notificationCenter.recent"})}),e.jsx("div",{className:"-mr-2 flex max-h-[30dvh] flex-col overflow-y-auto overflow-x-hidden pr-2 [scrollbar-gutter:stable]",children:c.map(a=>e.jsxs("button",{type:"button","data-testid":s.notificationCenterTestIds.successRow,onClick:a.onView,className:"flex cursor-pointer items-center justify-between gap-3 py-2 text-left hover:opacity-80",children:[e.jsx(n.Typography,{as:"span",variant:"bodySmall",className:"truncate text-foreground",children:a.label}),e.jsx(n.Typography,{as:"span",variant:"caption",color:"muted",children:a.timestampLabel})]},a.id))})]}):null]})})}exports.NotificationCenter=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("@fortawesome/free-solid-svg-icons"),f=require("../../icons/fa-icon.cjs"),y=require("../../simple-dropdown/simple-dropdown.cjs");require("../../simple-dropdown/simple-dropdown-menu-item.cjs");const r=require("../../typed-intl/index.cjs"),n=require("../../typography/typography.cjs"),s=require("../../../test-ids/notification-center.cjs");require("react");require("@gearbox-protocol/sdk");const l=require("../../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../utils/z-index.cjs");function g({row:t}){const i=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:l.cn("mt-[5px] size-[7px] shrink-0 rounded-full",t.isReady?"bg-success":"bg-gray-50")}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx(n.Typography,{as:"span",variant:"bodySmall",className:"truncate text-foreground",children:t.title}),e.jsx(n.Typography,{as:"span",variant:"bodySmall",color:t.isReady?"success":"muted",className:"shrink-0 text-right",children:t.statusLabel})]}),e.jsx(n.Typography,{as:"span",variant:"bodySmall",color:"muted",children:t.positionName})]})]});return t.isReady&&t.onExecute?e.jsx("button",{type:"button","data-testid":s.notificationCenterTestIds.requestRow,onClick:t.onExecute,className:"flex w-full cursor-pointer items-start gap-2 py-4 text-left hover:opacity-80",children:i}):e.jsx("div",{"data-testid":s.notificationCenterTestIds.requestRow,className:"flex w-full items-start gap-2 py-4",children:i})}function h({open:t,onOpenChange:i,deferredRows:o,successRows:c,deferredCount:d,hasReady:m,hasAny:u,onClear:p}){return e.jsx(y.SimpleDropdown,{open:t,onOpenChange:i,align:"end",asChild:!0,className:"w-[460px] max-w-[calc(100vw-32px)] bg-modal p-0",title:e.jsxs("button",{type:"button","data-testid":s.notificationCenterTestIds.trigger,className:"relative flex size-8 items-center justify-center rounded-md text-secondary-foreground hover:text-foreground",children:[e.jsx(f.FaIcon,{icon:x.faBell,className:"size-4"}),d>0?e.jsx("span",{"data-testid":s.notificationCenterTestIds.badge,className:l.cn("absolute -right-0.5 -top-0.5 flex size-[15px] items-center justify-center rounded-full text-[10px] font-medium leading-none text-white",m?"bg-primary":"bg-gray-50"),children:d}):null]}),children:e.jsxs("div",{"data-testid":s.notificationCenterTestIds.panel,className:"flex flex-col p-8",children:[u?null:e.jsx(n.Typography,{as:"span",variant:"bodySmall",color:"muted","data-testid":s.notificationCenterTestIds.empty,children:e.jsx(r.FormattedMessageTyped,{messageId:"components.notificationCenter.empty"})}),o.length>0?e.jsxs("div",{className:"flex flex-col","data-testid":s.notificationCenterTestIds.requestsSection,children:[e.jsx(n.Typography,{as:"span",variant:"bodySmall",className:"pb-2 font-medium text-foreground",children:e.jsx(r.FormattedMessageTyped,{messageId:"components.notificationCenter.requests"})}),e.jsx("div",{className:"-mr-2 flex max-h-[40dvh] flex-col divide-y divide-gray-60 overflow-y-auto overflow-x-hidden pr-2 [scrollbar-gutter:stable]",children:o.map(a=>e.jsx(g,{row:a},a.id))})]}):null,c.length>0?e.jsxs("div",{className:l.cn("flex flex-col",o.length>0&&"mt-4 pt-4"),"data-testid":s.notificationCenterTestIds.successSection,children:[e.jsxs("div",{className:"flex items-center justify-between pb-2",children:[e.jsx(n.Typography,{as:"span",variant:"bodySmall",className:"font-medium text-foreground",children:e.jsx(r.FormattedMessageTyped,{messageId:"components.notificationCenter.recent"})}),p?e.jsx("button",{type:"button","data-testid":s.notificationCenterTestIds.clear,onClick:p,className:"cursor-pointer text-xs text-secondary-foreground hover:text-foreground",children:e.jsx(r.FormattedMessageTyped,{messageId:"components.notificationCenter.clear"})}):null]}),e.jsx("div",{className:"-mr-2 flex max-h-[30dvh] flex-col overflow-y-auto overflow-x-hidden pr-2 [scrollbar-gutter:stable]",children:c.map(a=>e.jsxs("button",{type:"button","data-testid":s.notificationCenterTestIds.successRow,onClick:a.onView,className:"flex cursor-pointer items-center justify-between gap-3 py-2 text-left hover:opacity-80",children:[e.jsx(n.Typography,{as:"span",variant:"bodySmall",className:"truncate text-foreground",children:a.label}),e.jsx(n.Typography,{as:"span",variant:"caption",color:"muted",children:a.timestampLabel})]},a.id))})]}):null]})})}exports.NotificationCenter=h;
@@ -128,6 +128,28 @@ function L({
128
128
  {
129
129
  className: "flex flex-col",
130
130
  "data-testid": a.requestsSection,
131
+ children: [
132
+ /* @__PURE__ */ e(
133
+ n,
134
+ {
135
+ as: "span",
136
+ variant: "bodySmall",
137
+ className: "pb-2 font-medium text-foreground",
138
+ children: /* @__PURE__ */ e(r, { messageId: "components.notificationCenter.requests" })
139
+ }
140
+ ),
141
+ /* @__PURE__ */ e("div", { className: "-mr-2 flex max-h-[40dvh] flex-col divide-y divide-gray-60 overflow-y-auto overflow-x-hidden pr-2 [scrollbar-gutter:stable]", children: o.map((l) => /* @__PURE__ */ e(b, { row: l }, l.id)) })
142
+ ]
143
+ }
144
+ ) : null,
145
+ d.length > 0 ? /* @__PURE__ */ i(
146
+ "div",
147
+ {
148
+ className: c(
149
+ "flex flex-col",
150
+ o.length > 0 && "mt-4 pt-4"
151
+ ),
152
+ "data-testid": a.successSection,
131
153
  children: [
132
154
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between pb-2", children: [
133
155
  /* @__PURE__ */ e(
@@ -136,7 +158,7 @@ function L({
136
158
  as: "span",
137
159
  variant: "bodySmall",
138
160
  className: "font-medium text-foreground",
139
- children: /* @__PURE__ */ e(r, { messageId: "components.notificationCenter.requests" })
161
+ children: /* @__PURE__ */ e(r, { messageId: "components.notificationCenter.recent" })
140
162
  }
141
163
  ),
142
164
  p ? /* @__PURE__ */ e(
@@ -150,28 +172,6 @@ function L({
150
172
  }
151
173
  ) : null
152
174
  ] }),
153
- /* @__PURE__ */ e("div", { className: "-mr-2 flex max-h-[40dvh] flex-col divide-y divide-gray-60 overflow-y-auto overflow-x-hidden pr-2 [scrollbar-gutter:stable]", children: o.map((l) => /* @__PURE__ */ e(b, { row: l }, l.id)) })
154
- ]
155
- }
156
- ) : null,
157
- d.length > 0 ? /* @__PURE__ */ i(
158
- "div",
159
- {
160
- className: c(
161
- "flex flex-col",
162
- o.length > 0 && "mt-4 pt-4"
163
- ),
164
- "data-testid": a.successSection,
165
- children: [
166
- /* @__PURE__ */ e(
167
- n,
168
- {
169
- as: "span",
170
- variant: "bodySmall",
171
- className: "pb-2 font-medium text-foreground",
172
- children: /* @__PURE__ */ e(r, { messageId: "components.notificationCenter.recent" })
173
- }
174
- ),
175
175
  /* @__PURE__ */ e("div", { className: "-mr-2 flex max-h-[30dvh] flex-col overflow-y-auto overflow-x-hidden pr-2 [scrollbar-gutter:stable]", children: d.map((l) => /* @__PURE__ */ i(
176
176
  "button",
177
177
  {
@@ -25,6 +25,6 @@ export interface NotificationCenterProps {
25
25
  /** At least one deferred request has matured (drives the badge/status color). */
26
26
  readonly hasReady: boolean;
27
27
  readonly hasAny: boolean;
28
- /** Optional dev-only action: wipe all notifications. Hidden when omitted. */
28
+ /** Optional action: wipe settled ("Recent") notifications. Rendered in the Recent section header; hidden when omitted. */
29
29
  readonly onClear?: () => void;
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/ui-kit",
3
- "version": "3.14.0-next.43",
3
+ "version": "3.14.0-next.44",
4
4
  "description": "Internal UI components",
5
5
  "repository": {
6
6
  "type": "git",