@locusgraph/blocks 0.1.0 → 0.1.1

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,4 +1,4 @@
1
- import type { CreditPack } from "../types";
1
+ import type { CreditPack } from "../types.js";
2
2
  type CreditPacksProps = {
3
3
  packs: CreditPack[];
4
4
  onBuy: (packId: string) => void;
@@ -1,5 +1,5 @@
1
1
  import type * as React from "react";
2
- import type { PlanOffer } from "../types";
2
+ import type { PlanOffer } from "../types.js";
3
3
  type PlanOptionsProps = {
4
4
  plans: PlanOffer[];
5
5
  actionFor?: (plan: PlanOffer) => React.ReactNode;
@@ -1,4 +1,4 @@
1
- import type { WalletGrant } from "../types";
1
+ import type { WalletGrant } from "../types.js";
2
2
  type WalletPanelProps = {
3
3
  balanceMicroUsd: number;
4
4
  debtMicroUsd?: number;
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { CreditPacks } from "./billing/credit-packs";
2
- export { PlanOptions } from "./billing/plan-options";
3
- export { WalletPanel } from "./billing/wallet-panel";
4
- export { KeysTable } from "./keys/keys-table";
5
- export { NoKeys } from "./keys/no-keys";
6
- export * from "./types";
7
- export { QuotaMeter } from "./usage/quota-meter";
8
- export { UsageAttention } from "./usage/usage-attention";
9
- export { UsageSummary } from "./usage/usage-summary";
1
+ export { CreditPacks } from "./billing/credit-packs.js";
2
+ export { PlanOptions } from "./billing/plan-options.js";
3
+ export { WalletPanel } from "./billing/wallet-panel.js";
4
+ export { KeysTable } from "./keys/keys-table.js";
5
+ export { NoKeys } from "./keys/no-keys.js";
6
+ export * from "./types.js";
7
+ export { QuotaMeter } from "./usage/quota-meter.js";
8
+ export { UsageAttention } from "./usage/usage-attention.js";
9
+ export { UsageSummary } from "./usage/usage-summary.js";
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- export { CreditPacks } from "./billing/credit-packs";
2
- export { PlanOptions } from "./billing/plan-options";
3
- export { WalletPanel } from "./billing/wallet-panel";
4
- export { KeysTable } from "./keys/keys-table";
5
- export { NoKeys } from "./keys/no-keys";
6
- export * from "./types";
7
- export { QuotaMeter } from "./usage/quota-meter";
8
- export { UsageAttention } from "./usage/usage-attention";
9
- export { UsageSummary } from "./usage/usage-summary";
1
+ export { CreditPacks } from "./billing/credit-packs.js";
2
+ export { PlanOptions } from "./billing/plan-options.js";
3
+ export { WalletPanel } from "./billing/wallet-panel.js";
4
+ export { KeysTable } from "./keys/keys-table.js";
5
+ export { NoKeys } from "./keys/no-keys.js";
6
+ export * from "./types.js";
7
+ export { QuotaMeter } from "./usage/quota-meter.js";
8
+ export { UsageAttention } from "./usage/usage-attention.js";
9
+ export { UsageSummary } from "./usage/usage-summary.js";
@@ -1,5 +1,5 @@
1
1
  import type * as React from "react";
2
- import type { ApiKeyRow } from "../types";
2
+ import type { ApiKeyRow } from "../types.js";
3
3
  type KeysTableProps = {
4
4
  keys: ApiKeyRow[];
5
5
  actions?: (key: ApiKeyRow) => React.ReactNode;
@@ -1,4 +1,4 @@
1
- import type { LinkComponent } from "../types";
1
+ import type { LinkComponent } from "../types.js";
2
2
  type NoKeysProps = {
3
3
  newKeyHref?: string;
4
4
  description?: string;
@@ -1,4 +1,4 @@
1
- import { type Quota } from "../types";
1
+ import { type Quota } from "../types.js";
2
2
  export declare function QuotaMeter({ quota }: {
3
3
  quota: Quota;
4
4
  }): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Progress } from "@locusgraph/components";
3
3
  import { formatCount, quotaPercent, quotaStatus } from "@locusgraph/utils";
4
- import { periodLabel } from "../types";
4
+ import { periodLabel } from "../types.js";
5
5
  const statusIndicator = {
6
6
  ok: "",
7
7
  near: "[&_[data-slot=progress-indicator]]:bg-warn",
@@ -1,4 +1,4 @@
1
- import { type LinkComponent, type Quota } from "../types";
1
+ import { type LinkComponent, type Quota } from "../types.js";
2
2
  type UsageAttentionProps = {
3
3
  balanceMicroUsd: number | null;
4
4
  quotas: Quota[];
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Alert, AlertDescription, AlertTitle, Button } from "@locusgraph/components";
3
3
  import { balanceLevel, formatCount, formatMicroUsd, quotaStatus } from "@locusgraph/utils";
4
4
  import { CircleAlertIcon } from "lucide-react";
5
- import { periodLabel } from "../types";
5
+ import { periodLabel } from "../types.js";
6
6
  function attentionTitle(empty, overCount) {
7
7
  if (empty)
8
8
  return "Out of credits";
@@ -1,4 +1,4 @@
1
- import type { Quota } from "../types";
1
+ import type { Quota } from "../types.js";
2
2
  type UsageSummaryProps = {
3
3
  quotas: Quota[];
4
4
  label?: string;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { RuleGrid, RuleGridCell, RuleGridLabel } from "@locusgraph/components";
3
- import { QuotaMeter } from "./quota-meter";
3
+ import { QuotaMeter } from "./quota-meter.js";
4
4
  export function UsageSummary({ quotas, label = "Usage", emptyText = "No plan includes metered usage yet.", }) {
5
5
  return (_jsx(RuleGrid, { columns: 1, children: _jsxs(RuleGridCell, { className: "gap-5", children: [_jsx(RuleGridLabel, { children: label }), quotas.length > 0 ? (quotas.map((quota) => _jsx(QuotaMeter, { quota: quota }, quota.key))) : (_jsx("p", { className: "text-sm text-muted-foreground", children: emptyText }))] }) }));
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@locusgraph/blocks",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Product sections built from @locusgraph/components: usage meters and alerts, wallet, credit packs, plan options and API keys.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -29,16 +29,16 @@
29
29
  "provenance": true
30
30
  },
31
31
  "peerDependencies": {
32
- "@locusgraph/components": "^0.1.0",
32
+ "@locusgraph/components": "^0.1.1",
33
33
  "react": "^19.2.0",
34
34
  "react-dom": "^19.2.0"
35
35
  },
36
36
  "dependencies": {
37
- "@locusgraph/utils": "0.1.0",
37
+ "@locusgraph/utils": "0.1.1",
38
38
  "lucide-react": "^1.28.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@locusgraph/components": "0.1.0",
41
+ "@locusgraph/components": "0.1.1",
42
42
  "@locusgraph/config": "0.1.0",
43
43
  "@types/node": "^22.0.0",
44
44
  "@types/react": "^19.2.0",
@@ -49,7 +49,7 @@
49
49
  "vitest": "^5.0.3"
50
50
  },
51
51
  "scripts": {
52
- "build": "rm -rf dist && tsc -p tsconfig.build.json && cp src/sources.css dist/sources.css",
52
+ "build": "rm -rf dist && tsc -p tsconfig.build.json && cp src/sources.css dist/sources.css && node ../../scripts/esm-extensions.mjs dist",
53
53
  "typecheck": "tsc -p tsconfig.json --noEmit",
54
54
  "test": "vitest run"
55
55
  }