Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion dist/tebex.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12517,7 +12517,17 @@
];
const COLOR_NAMES = [
"primary",
"secondary"
"secondary",
"background",
"surface",
"surface-variant",
"success",
"warning",
"error",
"green",
"red",
"fields",
"field-border",
];
const EVENT_NAMES = [
"open",
Expand Down
2 changes: 1 addition & 1 deletion dist/tebex.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/tebex.min.js.map

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion dist/tebex.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12511,7 +12511,17 @@ const THEME_NAMES = [
];
const COLOR_NAMES = [
"primary",
"secondary"
"secondary",
"background",
"surface",
"surface-variant",
"success",
"warning",
"error",
"green",
"red",
"fields",
"field-border",
];
const EVENT_NAMES = [
"open",
Expand Down
2 changes: 1 addition & 1 deletion dist/types/checkout.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type Unsubscribe } from "nanoevents";
import { Lightbox } from "./lightbox";
import { type CssDimension, type Implements } from "./utils";
export declare const THEME_NAMES: readonly ["auto", "default", "light", "dark"];
export declare const COLOR_NAMES: readonly ["primary", "secondary"];
export declare const COLOR_NAMES: readonly ["primary", "secondary", "background", "surface", "surface-variant", "success", "warning", "error", "green", "red", "fields", "field-border"];
export declare const EVENT_NAMES: readonly ["open", "close", "payment:complete", "payment:error"];
/**
* Configuration options for `Tebex.checkout.init()`.
Expand Down
3 changes: 2 additions & 1 deletion example/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ function launch() {
ident: ident,
theme: document.getElementById("popup-theme")?.value,
colors: [],
endpoint: "https://localhost:3000",
endpoint: "https://pay.tebex.io",
defaultPaymentMethod: "paypal",
};

Array.prototype.forEach.call(
Expand Down
1 change: 1 addition & 0 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function launch() {
theme: document.getElementById("popup-theme")?.value,
colors: [],
endpoint: __ENDPOINT__,
defaultPaymentMethod: "paypal",
};

Array.prototype.forEach.call(
Expand Down
12 changes: 11 additions & 1 deletion src/checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,17 @@ export const THEME_NAMES = [

export const COLOR_NAMES = [
"primary",
"secondary"
"secondary",
"background",
"surface",
"surface-variant",
"success",
"warning",
"error",
"green",
"red",
"fields",
"field-border",
] as const;

export const EVENT_NAMES = [
Expand Down
8 changes: 4 additions & 4 deletions tests/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("Typechecks", () => {
closeOnClickOutside?: boolean;
closeOnEsc?: boolean;
colors?: {
name: "primary" | "secondary",
name: "primary" | "secondary" | "background" | "surface" | "surface-variant" | "success" | "warning" | "error" | "green" | "red" | "fields" | "field-border",
color: string
}[];
defaultPaymentMethod?: string;
Expand All @@ -49,7 +49,7 @@ describe("Typechecks", () => {
test("CheckoutColorDefinition", () => {
expectTypeOf<CheckoutColorDefinition>().toBeObject();
expectTypeOf<CheckoutColorDefinition>().toMatchTypeOf<{
name: "primary" | "secondary",
name: "primary" | "secondary" | "background" | "surface" | "surface-variant" | "success" | "warning" | "error" | "green" | "red" | "fields" | "field-border",
color: string
}>();
});
Expand Down Expand Up @@ -87,7 +87,7 @@ describe("Typechecks", () => {
expectTypeOf<CheckoutZoidProps>().toMatchTypeOf<{
locale: string;
colors: {
name: "primary" | "secondary",
name: "primary" | "secondary" | "background" | "surface" | "surface-variant" | "success" | "warning" | "error" | "green" | "red" | "fields" | "field-border",
color: string
}[];
closeOnClickOutside: boolean;
Expand Down Expand Up @@ -144,7 +144,7 @@ describe("Typechecks", () => {
closeOnClickOutside?: boolean;
closeOnEsc?: boolean;
colors?: {
name: "primary" | "secondary",
name: "primary" | "secondary" | "background" | "surface" | "surface-variant" | "success" | "warning" | "error" | "green" | "red" | "fields" | "field-border",
color: string
}[];
defaultPaymentMethod?: string;
Expand Down