@streamoid/settings 0.6.1 → 0.6.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.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { SVGProps, ReactNode } from 'react';
3
+ import { WorkspaceUsage } from '@streamoid/ui';
3
4
 
4
5
  /**
5
6
  * Settings tab identifiers and URL mapping helpers.
@@ -141,6 +142,13 @@ interface SettingsWorkspaceCurrent {
141
142
  /** Optional reactive credit summary if the host tracks it. */
142
143
  availableCredits?: number | null;
143
144
  totalCredits?: number | null;
145
+ /**
146
+ * Storage & bandwidth against the plan allowance, as the HOST has already
147
+ * fetched and evaluated it (`evaluateWorkspaceUsage` from `@streamoid/ui`).
148
+ * This package never requests it. When present, the Billing tab renders a
149
+ * usage meter for each kind; absent or null renders none.
150
+ */
151
+ usage?: WorkspaceUsage | null;
144
152
  /** ISO country code for the workspace; drives plan currency selection. */
145
153
  country?: string;
146
154
  /**
@@ -512,6 +520,8 @@ interface MemberPermissionsPayload {
512
520
  serviceIds: string[];
513
521
  storeIds: string[];
514
522
  }
523
+ /** `SettingsWorkspaceCurrent.usage`; re-exported from `@streamoid/ui`. */
524
+ type WorkspaceUsageResponse = WorkspaceUsage;
515
525
  interface AvailableCreditsResponse {
516
526
  availableCredits: number;
517
527
  }
@@ -1384,4 +1394,4 @@ declare function SettingsAdaptersProvider({ adapters, children, }: {
1384
1394
  */
1385
1395
  declare function useSettingsAdapters(): SettingsAdapters;
1386
1396
 
1387
- export { APP_KEYS, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, ExportDateModal, InviteUpdateModal, type InvoicePdfResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationInvite, OrganizationInviteModal, type OrganizationInviteModalProps, type OrganizationJoinRequest, type OrganizationMember, OrganizationModal, type OrganizationView, type OrganizationWorkspaceItem, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, ReferralTab, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCurrent, type SettingsOrganizationListItem, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USER_LANGUAGES, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryResponse, type UserLanguage, type UserPermissions, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, WorkspaceTab, countLabel, resolveSettingsTabFromPath, useSettingsAdapters, userLanguageLabel };
1397
+ export { APP_KEYS, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, ExportDateModal, InviteUpdateModal, type InvoicePdfResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationInvite, OrganizationInviteModal, type OrganizationInviteModalProps, type OrganizationJoinRequest, type OrganizationMember, OrganizationModal, type OrganizationView, type OrganizationWorkspaceItem, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, ReferralTab, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCurrent, type SettingsOrganizationListItem, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USER_LANGUAGES, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryResponse, type UserLanguage, type UserPermissions, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, WorkspaceTab, type WorkspaceUsageResponse, countLabel, resolveSettingsTabFromPath, useSettingsAdapters, userLanguageLabel };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { SVGProps, ReactNode } from 'react';
3
+ import { WorkspaceUsage } from '@streamoid/ui';
3
4
 
4
5
  /**
5
6
  * Settings tab identifiers and URL mapping helpers.
@@ -141,6 +142,13 @@ interface SettingsWorkspaceCurrent {
141
142
  /** Optional reactive credit summary if the host tracks it. */
142
143
  availableCredits?: number | null;
143
144
  totalCredits?: number | null;
145
+ /**
146
+ * Storage & bandwidth against the plan allowance, as the HOST has already
147
+ * fetched and evaluated it (`evaluateWorkspaceUsage` from `@streamoid/ui`).
148
+ * This package never requests it. When present, the Billing tab renders a
149
+ * usage meter for each kind; absent or null renders none.
150
+ */
151
+ usage?: WorkspaceUsage | null;
144
152
  /** ISO country code for the workspace; drives plan currency selection. */
145
153
  country?: string;
146
154
  /**
@@ -512,6 +520,8 @@ interface MemberPermissionsPayload {
512
520
  serviceIds: string[];
513
521
  storeIds: string[];
514
522
  }
523
+ /** `SettingsWorkspaceCurrent.usage`; re-exported from `@streamoid/ui`. */
524
+ type WorkspaceUsageResponse = WorkspaceUsage;
515
525
  interface AvailableCreditsResponse {
516
526
  availableCredits: number;
517
527
  }
@@ -1384,4 +1394,4 @@ declare function SettingsAdaptersProvider({ adapters, children, }: {
1384
1394
  */
1385
1395
  declare function useSettingsAdapters(): SettingsAdapters;
1386
1396
 
1387
- export { APP_KEYS, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, ExportDateModal, InviteUpdateModal, type InvoicePdfResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationInvite, OrganizationInviteModal, type OrganizationInviteModalProps, type OrganizationJoinRequest, type OrganizationMember, OrganizationModal, type OrganizationView, type OrganizationWorkspaceItem, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, ReferralTab, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCurrent, type SettingsOrganizationListItem, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USER_LANGUAGES, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryResponse, type UserLanguage, type UserPermissions, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, WorkspaceTab, countLabel, resolveSettingsTabFromPath, useSettingsAdapters, userLanguageLabel };
1397
+ export { APP_KEYS, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, ExportDateModal, InviteUpdateModal, type InvoicePdfResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationInvite, OrganizationInviteModal, type OrganizationInviteModalProps, type OrganizationJoinRequest, type OrganizationMember, OrganizationModal, type OrganizationView, type OrganizationWorkspaceItem, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, ReferralTab, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCurrent, type SettingsOrganizationListItem, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USER_LANGUAGES, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryResponse, type UserLanguage, type UserPermissions, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, WorkspaceTab, type WorkspaceUsageResponse, countLabel, resolveSettingsTabFromPath, useSettingsAdapters, userLanguageLabel };
package/dist/index.js CHANGED
@@ -9175,6 +9175,7 @@ function BillingContent({
9175
9175
  fetchBillingOverview();
9176
9176
  fetchUserMap();
9177
9177
  }, [fetchBillingOverview, fetchUserMap]);
9178
+ const usage = workspace.current?.usage ?? null;
9178
9179
  (0, import_react14.useEffect)(() => {
9179
9180
  void logBillingEvent("billing_page_viewed", "Billing page viewed", {
9180
9181
  action: "view"
@@ -9482,6 +9483,28 @@ function BillingContent({
9482
9483
  ]
9483
9484
  }
9484
9485
  ),
9486
+ usage ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
9487
+ "div",
9488
+ {
9489
+ className: "grid shrink-0 w-full",
9490
+ style: {
9491
+ gap: "var(--spacing-6xl)",
9492
+ gridTemplateColumns: "repeat(auto-fit, minmax(18rem, 1fr))"
9493
+ },
9494
+ children: [
9495
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui9.ScUsageMeterCard, { kind: "storage", plan: usage.plan, status: usage.storage }),
9496
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
9497
+ import_ui9.ScUsageMeterCard,
9498
+ {
9499
+ kind: "bandwidth",
9500
+ plan: usage.plan,
9501
+ status: usage.bandwidth,
9502
+ footnote: `This billing month \xB7 resets ${new Date(usage.period.to).toLocaleDateString(void 0, { day: "numeric", month: "short" })}`
9503
+ }
9504
+ )
9505
+ ]
9506
+ }
9507
+ ) : null,
9485
9508
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center justify-between shrink-0 w-full", children: [
9486
9509
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(BillingTabBar, { activeTab, onTabChange: setActiveTab }),
9487
9510
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
package/dist/index.mjs CHANGED
@@ -6956,7 +6956,8 @@ import {
6956
6956
  ScBillingHistoryTableList,
6957
6957
  ScHeader,
6958
6958
  ScPlanCard,
6959
- ScPlanComparison
6959
+ ScPlanComparison,
6960
+ ScUsageMeterCard
6960
6961
  } from "@streamoid/ui";
6961
6962
  import {
6962
6963
  SiconDownload,
@@ -9177,6 +9178,7 @@ function BillingContent({
9177
9178
  fetchBillingOverview();
9178
9179
  fetchUserMap();
9179
9180
  }, [fetchBillingOverview, fetchUserMap]);
9181
+ const usage = workspace.current?.usage ?? null;
9180
9182
  useEffect10(() => {
9181
9183
  void logBillingEvent("billing_page_viewed", "Billing page viewed", {
9182
9184
  action: "view"
@@ -9484,6 +9486,28 @@ function BillingContent({
9484
9486
  ]
9485
9487
  }
9486
9488
  ),
9489
+ usage ? /* @__PURE__ */ jsxs16(
9490
+ "div",
9491
+ {
9492
+ className: "grid shrink-0 w-full",
9493
+ style: {
9494
+ gap: "var(--spacing-6xl)",
9495
+ gridTemplateColumns: "repeat(auto-fit, minmax(18rem, 1fr))"
9496
+ },
9497
+ children: [
9498
+ /* @__PURE__ */ jsx18(ScUsageMeterCard, { kind: "storage", plan: usage.plan, status: usage.storage }),
9499
+ /* @__PURE__ */ jsx18(
9500
+ ScUsageMeterCard,
9501
+ {
9502
+ kind: "bandwidth",
9503
+ plan: usage.plan,
9504
+ status: usage.bandwidth,
9505
+ footnote: `This billing month \xB7 resets ${new Date(usage.period.to).toLocaleDateString(void 0, { day: "numeric", month: "short" })}`
9506
+ }
9507
+ )
9508
+ ]
9509
+ }
9510
+ ) : null,
9487
9511
  /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between shrink-0 w-full", children: [
9488
9512
  /* @__PURE__ */ jsx18(BillingTabBar, { activeTab, onTabChange: setActiveTab }),
9489
9513
  /* @__PURE__ */ jsxs16(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/settings",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",