@soba-so/react 0.0.28 → 0.0.29
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/RedeemCode.d.ts +17 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +23 -6
- package/dist/styles.css +17 -0
- package/dist/types.d.ts +6 -0
- package/dist/useRedeemCode.d.ts +24 -0
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type RedeemedReward } from "./useRedeemCode.js";
|
|
2
|
+
export interface RedeemCodeProps {
|
|
3
|
+
/** The button's word. "Apply" by default. */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Placeholder for the field. */
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
/** Called with what the code gave, after the plan has been re-read. */
|
|
8
|
+
onRedeemed?: (reward: RedeemedReward) => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A PROMO CODE FIELD — `useRedeemCode()` with a field and a button. The code
|
|
13
|
+
* is checked by Soba: a typo, one used up, one expired or one already redeemed
|
|
14
|
+
* says so in a sentence. What it gives applies at once, and the plan state is
|
|
15
|
+
* re-read, so `<SobaCurrentPlan />` beside it moves without a reload.
|
|
16
|
+
*/
|
|
17
|
+
export declare function RedeemCode({ label, placeholder, onRedeemed, className, }: RedeemCodeProps): import("react").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { type ComputeState, type ConnectReason, type ConnectState, type ModelsSt
|
|
|
8
8
|
export { collectText, parseEvent, readEvents } from "./events.js";
|
|
9
9
|
export { ModelPicker, type ModelPickerProps } from "./ModelPicker.js";
|
|
10
10
|
export { ProviderMark, type ProviderMarkProps } from "./ProviderMark.js";
|
|
11
|
+
export { RedeemCode, type RedeemCodeProps } from "./RedeemCode.js";
|
|
11
12
|
export { RunError, type RunErrorProps, runErrorMessage } from "./RunError.js";
|
|
12
13
|
export { RunLimit, type RunLimitProps } from "./RunLimit.js";
|
|
13
14
|
export { SobaBilling, type SobaBillingProps } from "./SobaBilling.js";
|
|
@@ -29,5 +30,6 @@ export { type MachineRunsOptions, type MachineRunsView, useMachineRuns } from ".
|
|
|
29
30
|
export { type ModelAgent, type ModelProvider, type ModelView, modelLogo, type UseModelOptions, useModel, } from "./useModel.js";
|
|
30
31
|
export { useOpenSobaConnect } from "./useOpenSobaConnect.js";
|
|
31
32
|
export { type PlanCompute, type PlanConnect, type PlanCta, type PlanOffer, type PlanPrice, type PlansOptions, type PlansView, usePlans, } from "./usePlans.js";
|
|
33
|
+
export { type RedeemCodeView, type RedeemedReward, useRedeemCode } from "./useRedeemCode.js";
|
|
32
34
|
export { type LimitReason, type Offer, sobaErrorCode, useRunLimit } from "./useRunLimit.js";
|
|
33
35
|
export { type RunStream, type WatchOptions, watchRun } from "./watch.js";
|