@arbidocs/blocks 0.4.119 → 0.4.120

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.
@@ -3,8 +3,25 @@ export interface FirmPoolView {
3
3
  /** £ of AI usage used this month; `null` while the usage report is not available yet. */
4
4
  usedGbp: number | null;
5
5
  totalGbp: number;
6
+ /** The licence's part of this month's pool (£ of AI usage a month); the rest of `totalGbp` is top-ups. */
7
+ baseGbp?: number;
8
+ /** £ of AI usage automatic top-ups may still add this month before the usage budget stops them
9
+ * (`null` = no limit; omitted = not applicable, e.g. no automatic top-ups on this licence). */
10
+ autoRoomGbp?: number | null;
6
11
  /** £ of AI usage each top-up step adds a month (for the top-up help); £25 on Box. */
7
12
  addonGbp?: number;
13
+ /** Storage on this deployment against the licence's storage (GB); `usedGb` null until measured. Automatic
14
+ * top-ups this month (`autoAddedGb`) are part of `totalGb`. */
15
+ storage?: {
16
+ usedGb: number | null;
17
+ totalGb: number;
18
+ autoAddedGb?: number;
19
+ };
20
+ /** Internal users (firm members; external users and guests are free) against the licence's users. */
21
+ users?: {
22
+ used: number | null;
23
+ total: number;
24
+ };
8
25
  /** The Box licence, already formatted (e.g. "8 users · 250 GB · £200 of AI usage a month · Annual"). */
9
26
  licence?: string;
10
27
  /** A decrease kept until the period end, already formatted (e.g. "From 1 Dec 2026: 6 users · …"). */
@@ -13,12 +30,13 @@ export interface FirmPoolView {
13
30
  resetsAt?: string;
14
31
  /** Standard AI is unlimited and the allowance applies to Premium AI only. */
15
32
  premiumOnly: boolean;
16
- /** Automatic top-ups this month, as money against the monthly usage budget (formatted), with what
17
- * they added (e.g. "+£50 of AI usage · +25 GB"). */
33
+ /** Automatic top-ups this month, as money against the monthly usage budget (formatted: spent, limit and what
34
+ * is left), with what they added (e.g. "+£50 of AI usage · +25 GB"). */
18
35
  autoAddons?: {
19
36
  count: number;
20
37
  spent: string;
21
38
  limit: string;
39
+ left?: string;
22
40
  pct: number;
23
41
  added?: string;
24
42
  };
@@ -29,9 +47,17 @@ export interface FirmPoolSectionLabels {
29
47
  title: string;
30
48
  licence: string;
31
49
  used: string;
50
+ storage: string;
51
+ users: string;
32
52
  premiumOnly: string;
33
53
  resets: (date: string) => string;
34
54
  usageUnknown: string;
55
+ legendLicence: (amount: string) => string;
56
+ legendTopUps: (amount: string) => string;
57
+ legendAutoRoom: (amount: string) => string;
58
+ autoRoomNoLimit: string;
59
+ budget: string;
60
+ budgetValue: (left: string, limit: string) => string;
35
61
  autoAddons: (count: number) => string;
36
62
  autoAddonsOff: string;
37
63
  topUpLabel: string;
@@ -3,7 +3,7 @@
3
3
 
4
4
  var chunkOR4CO743_cjs = require('../chunk-OR4CO743.cjs');
5
5
  var chunk223D4727_cjs = require('../chunk-223D4727.cjs');
6
- var chunk46IU3UPF_cjs = require('../chunk-46IU3UPF.cjs');
6
+ var chunkA7NCSZAP_cjs = require('../chunk-A7NCSZAP.cjs');
7
7
  var chunkS5HZBXZA_cjs = require('../chunk-S5HZBXZA.cjs');
8
8
  var chunkN26CXGXC_cjs = require('../chunk-N26CXGXC.cjs');
9
9
  var chunkDVUZTGVL_cjs = require('../chunk-DVUZTGVL.cjs');
@@ -1439,7 +1439,7 @@ var DEFAULT_PLAN_CARD_LABELS = {
1439
1439
  explainerTiers: [
1440
1440
  "AI usage and storage are shared by everyone in the project. AI usage resets monthly.",
1441
1441
  "Need more? Add \xA325 of AI usage or 25 GB at a time. Add-ons renew until you reduce them.",
1442
- "Add-ons, manual and automatic, stay within your monthly usage cap (\xA3100 by default; \xA30 = no extra usage, or no limit).",
1442
+ "Automatic top-ups stay within your monthly usage cap (\xA3100 by default; \xA30 = no automatic top-ups, or no limit). Adding by hand is never capped.",
1443
1443
  "Add-ons start now. Downgrades, billing switches and add-on reductions start at the end of the period. No refunds.",
1444
1444
  "Prices are shown + VAT; the total for your country is shown before you pay."
1445
1445
  ],
@@ -2051,13 +2051,21 @@ function RenameDialog({
2051
2051
  ] }) });
2052
2052
  }
2053
2053
  var DEFAULT_FIRM_POOL_SECTION_LABELS = {
2054
- title: "Firm AI usage",
2054
+ title: "Firm usage",
2055
2055
  licence: "Licence",
2056
- used: "This month",
2056
+ used: "AI usage this month",
2057
+ storage: "Storage",
2058
+ users: "Internal users",
2057
2059
  premiumOnly: "Standard AI is unlimited; the allowance applies to Premium AI.",
2058
2060
  resets: (date) => `resets ${date}`,
2059
2061
  usageUnknown: "Usage is being calculated.",
2060
- autoAddons: (count) => `Automatic top-ups: ${count}`,
2062
+ legendLicence: (amount) => `Licence ${amount}`,
2063
+ legendTopUps: (amount) => `Top-ups ${amount}`,
2064
+ legendAutoRoom: (amount) => `Automatic top-ups may add ${amount}`,
2065
+ autoRoomNoLimit: "Automatic top-ups: no limit",
2066
+ budget: "Usage budget \u2014 limits automatic top-ups only",
2067
+ budgetValue: (left, limit) => `${left} left of ${limit}`,
2068
+ autoAddons: (count) => `Automatic top-ups this month: ${count}`,
2061
2069
  autoAddonsOff: "Automatic top-ups are off (\xA30 usage budget).",
2062
2070
  topUpLabel: "Steps to add",
2063
2071
  topUp: "Add AI usage",
@@ -2079,11 +2087,15 @@ function FirmPoolSection({
2079
2087
  const [count, setCount] = react.useState(1);
2080
2088
  const valid = Number.isInteger(count) && count >= 1 && count <= FIRM_POOL_MAX_TOP_UP;
2081
2089
  const used = view.usedGbp;
2082
- const pct = used != null && view.totalGbp > 0 ? used / view.totalGbp * 100 : 0;
2083
2090
  const step = view.addonGbp ?? 25;
2091
+ const base = Math.min(view.baseGbp ?? view.totalGbp, view.totalGbp);
2092
+ const topUps = Math.max(0, view.totalGbp - base);
2093
+ const gb = (n) => `${Math.round(n * 10) / 10} GB`;
2094
+ const storage = view.storage;
2095
+ const users = view.users;
2084
2096
  return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "space-y-3", "data-testid": testId, children: [
2085
2097
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "px-1 text-sm font-semibold text-foreground", children: l.title }),
2086
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3 px-1", children: [
2098
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 px-1", children: [
2087
2099
  view.licence && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5 text-sm", "data-testid": `${testId}-licence`, children: [
2088
2100
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-baseline justify-between gap-x-4", children: [
2089
2101
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: l.licence }),
@@ -2092,23 +2104,62 @@ function FirmPoolSection({
2092
2104
  view.renews && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", "data-testid": `${testId}-renews`, children: view.renews })
2093
2105
  ] }),
2094
2106
  /* @__PURE__ */ jsxRuntime.jsx(
2095
- chunk46IU3UPF_cjs.UsageMeter,
2107
+ chunkA7NCSZAP_cjs.UsageMeter,
2096
2108
  {
2097
2109
  label: l.used,
2098
2110
  hint: view.resetsAt ? l.resets(view.resetsAt) : void 0,
2099
2111
  value: `${used != null ? formatAmount(used) : "\u2014"} / ${formatAmount(view.totalGbp)}`,
2100
- pct,
2112
+ allowance: {
2113
+ used: used ?? 0,
2114
+ plan: base,
2115
+ topUps,
2116
+ autoRoom: view.autoAddonsOff ? 0 : view.autoRoomGbp
2117
+ },
2118
+ legend: {
2119
+ plan: topUps > 0 || (view.autoRoomGbp ?? 0) > 0 ? l.legendLicence(formatAmount(base)) : void 0,
2120
+ topUps: topUps > 0 ? l.legendTopUps(formatAmount(topUps)) : void 0,
2121
+ autoRoom: view.autoRoomGbp === null ? l.autoRoomNoLimit : view.autoRoomGbp ? l.legendAutoRoom(formatAmount(view.autoRoomGbp)) : void 0
2122
+ },
2123
+ details: used == null ? /* @__PURE__ */ jsxRuntime.jsx("p", { children: l.usageUnknown }) : void 0,
2101
2124
  testId: `${testId}-usage`
2102
2125
  }
2103
2126
  ),
2104
- used == null && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: l.usageUnknown }),
2127
+ storage && /* @__PURE__ */ jsxRuntime.jsx(
2128
+ chunkA7NCSZAP_cjs.UsageMeter,
2129
+ {
2130
+ label: l.storage,
2131
+ value: `${storage.usedGb != null ? gb(storage.usedGb) : "\u2014"} / ${gb(storage.totalGb)}`,
2132
+ allowance: {
2133
+ used: storage.usedGb ?? 0,
2134
+ plan: storage.totalGb - (storage.autoAddedGb ?? 0),
2135
+ topUps: storage.autoAddedGb ?? 0
2136
+ },
2137
+ legend: {
2138
+ plan: storage.autoAddedGb ? l.legendLicence(gb(storage.totalGb - storage.autoAddedGb)) : void 0,
2139
+ topUps: storage.autoAddedGb ? l.legendTopUps(gb(storage.autoAddedGb)) : void 0
2140
+ },
2141
+ testId: `${testId}-storage`
2142
+ }
2143
+ ),
2144
+ users && /* @__PURE__ */ jsxRuntime.jsx(
2145
+ chunkA7NCSZAP_cjs.UsageMeter,
2146
+ {
2147
+ label: l.users,
2148
+ value: `${users.used ?? "\u2014"} / ${users.total}`,
2149
+ allowance: { used: users.used ?? 0, plan: users.total },
2150
+ testId: `${testId}-users`
2151
+ }
2152
+ ),
2105
2153
  view.autoAddons && /* @__PURE__ */ jsxRuntime.jsx(
2106
- chunk46IU3UPF_cjs.UsageMeter,
2154
+ chunkA7NCSZAP_cjs.UsageMeter,
2107
2155
  {
2108
- label: l.autoAddons(view.autoAddons.count),
2109
- value: `${view.autoAddons.spent} / ${view.autoAddons.limit}`,
2156
+ label: l.budget,
2157
+ value: view.autoAddons.left ? l.budgetValue(view.autoAddons.left, view.autoAddons.limit) : `${view.autoAddons.spent} / ${view.autoAddons.limit}`,
2110
2158
  pct: view.autoAddons.pct,
2111
- hint: view.autoAddons.added,
2159
+ details: /* @__PURE__ */ jsxRuntime.jsxs("p", { "data-testid": `${testId}-auto-addons-count`, children: [
2160
+ l.autoAddons(view.autoAddons.count),
2161
+ view.autoAddons.added ? ` (${view.autoAddons.added})` : ""
2162
+ ] }),
2112
2163
  testId: `${testId}-auto-addons`
2113
2164
  }
2114
2165
  ),
@@ -2294,7 +2345,7 @@ function WelcomeDialog({
2294
2345
  planBadge
2295
2346
  ] }),
2296
2347
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: quotas.map((quota) => /* @__PURE__ */ jsxRuntime.jsx(
2297
- chunk46IU3UPF_cjs.UsageMeter,
2348
+ chunkA7NCSZAP_cjs.UsageMeter,
2298
2349
  {
2299
2350
  icon: quota.icon,
2300
2351
  label: quota.label,
@@ -3166,7 +3217,7 @@ function SubscriptionStatusView({
3166
3217
  ] }),
3167
3218
  !resetDate && isCanceling && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-yellow-text", children: l.cancelsAtEndOfBillingPeriod }),
3168
3219
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: meters.map((m) => /* @__PURE__ */ jsxRuntime.jsx(
3169
- chunk46IU3UPF_cjs.UsageMeter,
3220
+ chunkA7NCSZAP_cjs.UsageMeter,
3170
3221
  {
3171
3222
  icon: m.icon,
3172
3223
  label: m.label,