@arbidocs/blocks 0.4.118 → 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.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  export { ActiveSessionsDialog, AvatarPicker, DEFAULT_ACTIVE_SESSIONS_DIALOG_LABELS, DEFAULT_AVATAR_PICKER_LABELS, DEFAULT_DELETE_ACCOUNT_DIALOG_LABELS, DEFAULT_IDENTITY_VERIFICATION_LABELS, DEFAULT_LOGOUT_DIALOG_LABELS, DEFAULT_PASSWORD_CHANGE_DIALOG_LABELS, DEFAULT_PROFILE_CARD_LABELS, DEFAULT_SETTINGS_DANGER_ZONE_LABELS, DeleteAccountDialog, EMAIL_NOTIFICATION_CATEGORIES, EMAIL_NOTIFICATION_KEYS, IdentityVerificationCard, IdentityVerificationDialog, LogoutDialog, NotificationCategoryList, PasswordChangeDialog, ProfileCard, RequireVerified, SettingsActionRow, SettingsCard, SettingsDangerZone, SettingsPanel, SettingsRow, SettingsSection, SettingsSwitchGroup, SettingsSwitchRow, formatSessionTtl, toActiveSessionViews, toDeleteBlockerViews, toLogoutSessionViews, toNotificationCategories } from '../chunk-GFYGYME3.js';
3
3
  export { ModalBreadcrumbHeader, ModalCrumbs } from '../chunk-RC6VTY2H.js';
4
- import { UsageMeter } from '../chunk-D5T53XCL.js';
4
+ import { UsageMeter } from '../chunk-IBZJYCYM.js';
5
5
  export { DEFAULT_DOCUMENT_PICKER_LABELS, DocumentPicker, MultiSelect } from '../chunk-4XJZ6AAY.js';
6
6
  export { DEFAULT_TRI_STATE_FILTER_MENU_LABELS, TriStateFilterMenu } from '../chunk-6S5FLMWG.js';
7
7
  import { ToneBadge } from '../chunk-5LXQPP2K.js';
@@ -1418,7 +1418,7 @@ var DEFAULT_PLAN_CARD_LABELS = {
1418
1418
  explainerTiers: [
1419
1419
  "AI usage and storage are shared by everyone in the project. AI usage resets monthly.",
1420
1420
  "Need more? Add \xA325 of AI usage or 25 GB at a time. Add-ons renew until you reduce them.",
1421
- "Add-ons, manual and automatic, stay within your monthly usage cap (\xA3100 by default; \xA30 = no extra usage, or no limit).",
1421
+ "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.",
1422
1422
  "Add-ons start now. Downgrades, billing switches and add-on reductions start at the end of the period. No refunds.",
1423
1423
  "Prices are shown + VAT; the total for your country is shown before you pay."
1424
1424
  ],
@@ -2030,13 +2030,21 @@ function RenameDialog({
2030
2030
  ] }) });
2031
2031
  }
2032
2032
  var DEFAULT_FIRM_POOL_SECTION_LABELS = {
2033
- title: "Firm AI usage",
2033
+ title: "Firm usage",
2034
2034
  licence: "Licence",
2035
- used: "This month",
2035
+ used: "AI usage this month",
2036
+ storage: "Storage",
2037
+ users: "Internal users",
2036
2038
  premiumOnly: "Standard AI is unlimited; the allowance applies to Premium AI.",
2037
2039
  resets: (date) => `resets ${date}`,
2038
2040
  usageUnknown: "Usage is being calculated.",
2039
- autoAddons: (count) => `Automatic top-ups: ${count}`,
2041
+ legendLicence: (amount) => `Licence ${amount}`,
2042
+ legendTopUps: (amount) => `Top-ups ${amount}`,
2043
+ legendAutoRoom: (amount) => `Automatic top-ups may add ${amount}`,
2044
+ autoRoomNoLimit: "Automatic top-ups: no limit",
2045
+ budget: "Usage budget \u2014 limits automatic top-ups only",
2046
+ budgetValue: (left, limit) => `${left} left of ${limit}`,
2047
+ autoAddons: (count) => `Automatic top-ups this month: ${count}`,
2040
2048
  autoAddonsOff: "Automatic top-ups are off (\xA30 usage budget).",
2041
2049
  topUpLabel: "Steps to add",
2042
2050
  topUp: "Add AI usage",
@@ -2058,11 +2066,15 @@ function FirmPoolSection({
2058
2066
  const [count, setCount] = useState(1);
2059
2067
  const valid = Number.isInteger(count) && count >= 1 && count <= FIRM_POOL_MAX_TOP_UP;
2060
2068
  const used = view.usedGbp;
2061
- const pct = used != null && view.totalGbp > 0 ? used / view.totalGbp * 100 : 0;
2062
2069
  const step = view.addonGbp ?? 25;
2070
+ const base = Math.min(view.baseGbp ?? view.totalGbp, view.totalGbp);
2071
+ const topUps = Math.max(0, view.totalGbp - base);
2072
+ const gb = (n) => `${Math.round(n * 10) / 10} GB`;
2073
+ const storage = view.storage;
2074
+ const users = view.users;
2063
2075
  return /* @__PURE__ */ jsxs("section", { className: "space-y-3", "data-testid": testId, children: [
2064
2076
  /* @__PURE__ */ jsx("h3", { className: "px-1 text-sm font-semibold text-foreground", children: l.title }),
2065
- /* @__PURE__ */ jsxs("div", { className: "space-y-3 px-1", children: [
2077
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4 px-1", children: [
2066
2078
  view.licence && /* @__PURE__ */ jsxs("div", { className: "space-y-0.5 text-sm", "data-testid": `${testId}-licence`, children: [
2067
2079
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-baseline justify-between gap-x-4", children: [
2068
2080
  /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: l.licence }),
@@ -2076,18 +2088,57 @@ function FirmPoolSection({
2076
2088
  label: l.used,
2077
2089
  hint: view.resetsAt ? l.resets(view.resetsAt) : void 0,
2078
2090
  value: `${used != null ? formatAmount(used) : "\u2014"} / ${formatAmount(view.totalGbp)}`,
2079
- pct,
2091
+ allowance: {
2092
+ used: used ?? 0,
2093
+ plan: base,
2094
+ topUps,
2095
+ autoRoom: view.autoAddonsOff ? 0 : view.autoRoomGbp
2096
+ },
2097
+ legend: {
2098
+ plan: topUps > 0 || (view.autoRoomGbp ?? 0) > 0 ? l.legendLicence(formatAmount(base)) : void 0,
2099
+ topUps: topUps > 0 ? l.legendTopUps(formatAmount(topUps)) : void 0,
2100
+ autoRoom: view.autoRoomGbp === null ? l.autoRoomNoLimit : view.autoRoomGbp ? l.legendAutoRoom(formatAmount(view.autoRoomGbp)) : void 0
2101
+ },
2102
+ details: used == null ? /* @__PURE__ */ jsx("p", { children: l.usageUnknown }) : void 0,
2080
2103
  testId: `${testId}-usage`
2081
2104
  }
2082
2105
  ),
2083
- used == null && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: l.usageUnknown }),
2106
+ storage && /* @__PURE__ */ jsx(
2107
+ UsageMeter,
2108
+ {
2109
+ label: l.storage,
2110
+ value: `${storage.usedGb != null ? gb(storage.usedGb) : "\u2014"} / ${gb(storage.totalGb)}`,
2111
+ allowance: {
2112
+ used: storage.usedGb ?? 0,
2113
+ plan: storage.totalGb - (storage.autoAddedGb ?? 0),
2114
+ topUps: storage.autoAddedGb ?? 0
2115
+ },
2116
+ legend: {
2117
+ plan: storage.autoAddedGb ? l.legendLicence(gb(storage.totalGb - storage.autoAddedGb)) : void 0,
2118
+ topUps: storage.autoAddedGb ? l.legendTopUps(gb(storage.autoAddedGb)) : void 0
2119
+ },
2120
+ testId: `${testId}-storage`
2121
+ }
2122
+ ),
2123
+ users && /* @__PURE__ */ jsx(
2124
+ UsageMeter,
2125
+ {
2126
+ label: l.users,
2127
+ value: `${users.used ?? "\u2014"} / ${users.total}`,
2128
+ allowance: { used: users.used ?? 0, plan: users.total },
2129
+ testId: `${testId}-users`
2130
+ }
2131
+ ),
2084
2132
  view.autoAddons && /* @__PURE__ */ jsx(
2085
2133
  UsageMeter,
2086
2134
  {
2087
- label: l.autoAddons(view.autoAddons.count),
2088
- value: `${view.autoAddons.spent} / ${view.autoAddons.limit}`,
2135
+ label: l.budget,
2136
+ value: view.autoAddons.left ? l.budgetValue(view.autoAddons.left, view.autoAddons.limit) : `${view.autoAddons.spent} / ${view.autoAddons.limit}`,
2089
2137
  pct: view.autoAddons.pct,
2090
- hint: view.autoAddons.added,
2138
+ details: /* @__PURE__ */ jsxs("p", { "data-testid": `${testId}-auto-addons-count`, children: [
2139
+ l.autoAddons(view.autoAddons.count),
2140
+ view.autoAddons.added ? ` (${view.autoAddons.added})` : ""
2141
+ ] }),
2091
2142
  testId: `${testId}-auto-addons`
2092
2143
  }
2093
2144
  ),