@anpayeras/agnostic-checkout 0.1.0 → 0.1.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/components/Checkout.d.ts +4 -0
- package/dist/components/Checkout.d.ts.map +1 -0
- package/dist/components/CheckoutLayout.d.ts +3 -0
- package/dist/components/CheckoutLayout.d.ts.map +1 -0
- package/dist/components/FeedbackScreen.d.ts +3 -0
- package/dist/components/FeedbackScreen.d.ts.map +1 -0
- package/dist/components/MobileOrderBar.d.ts +10 -0
- package/dist/components/MobileOrderBar.d.ts.map +1 -0
- package/dist/components/OrderSidebarSummary.d.ts +3 -0
- package/dist/components/OrderSidebarSummary.d.ts.map +1 -0
- package/dist/components/OrderSummary.d.ts +2 -0
- package/dist/components/OrderSummary.d.ts.map +1 -0
- package/dist/components/PaymentForm.d.ts +2 -0
- package/dist/components/PaymentForm.d.ts.map +1 -0
- package/dist/components/PaymentMethods.d.ts +2 -0
- package/dist/components/PaymentMethods.d.ts.map +1 -0
- package/dist/components/button.d.ts +3 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/checkout-content.d.ts +4 -0
- package/dist/components/checkout-content.d.ts.map +1 -0
- package/dist/components/dev-tools.d.ts +3 -0
- package/dist/components/dev-tools.d.ts.map +1 -0
- package/dist/components/mobile-bar.d.ts +4 -0
- package/dist/components/mobile-bar.d.ts.map +1 -0
- package/dist/components/types.d.ts +57 -0
- package/dist/components/types.d.ts.map +1 -0
- package/dist/core/checkout-context.d.ts +56 -0
- package/dist/core/checkout-context.d.ts.map +1 -0
- package/dist/core/checkout-machine.d.ts +3 -0
- package/dist/core/checkout-machine.d.ts.map +1 -0
- package/dist/core/event-system.d.ts +32 -0
- package/dist/core/event-system.d.ts.map +1 -0
- package/dist/core/i18n-context.d.ts +17 -0
- package/dist/core/i18n-context.d.ts.map +1 -0
- package/dist/core/provider.interface.d.ts +7 -0
- package/dist/core/provider.interface.d.ts.map +1 -0
- package/dist/core/types.d.ts +74 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/hooks/useCheckout.d.ts +26 -0
- package/dist/hooks/useCheckout.d.ts.map +1 -0
- package/dist/index.cjs +157 -1622
- package/dist/index.d.ts +16 -321
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4291 -1025
- package/dist/locales/en.d.ts +3 -0
- package/dist/locales/en.d.ts.map +1 -0
- package/dist/locales/es.d.ts +3 -0
- package/dist/locales/es.d.ts.map +1 -0
- package/dist/locales/index.d.ts +14 -0
- package/dist/locales/index.d.ts.map +1 -0
- package/dist/locales/pt-BR.d.ts +3 -0
- package/dist/locales/pt-BR.d.ts.map +1 -0
- package/dist/locales/types.d.ts +41 -0
- package/dist/locales/types.d.ts.map +1 -0
- package/dist/plugins/cart-edit-plugin.d.ts +10 -0
- package/dist/plugins/cart-edit-plugin.d.ts.map +1 -0
- package/dist/plugins/discount-plugin.d.ts +4 -0
- package/dist/plugins/discount-plugin.d.ts.map +1 -0
- package/dist/plugins/index.d.ts +6 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/plugin-context.d.ts +10 -0
- package/dist/plugins/plugin-context.d.ts.map +1 -0
- package/dist/plugins/types.d.ts +32 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/dist/theme/color-utils.d.ts +39 -0
- package/dist/theme/color-utils.d.ts.map +1 -0
- package/dist/theme/theme-provider.d.ts +11 -0
- package/dist/theme/theme-provider.d.ts.map +1 -0
- package/dist/theme/tokens.d.ts +30 -0
- package/dist/theme/tokens.d.ts.map +1 -0
- package/dist/utils/utils.d.ts +6 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/package.json +17 -9
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -321
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/locales/en.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,EAAE,EAAE,gBAmDhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../src/locales/es.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,EAAE,EAAE,gBAmDhB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CheckoutLocale, CheckoutMessages } from './types';
|
|
2
|
+
export type { CheckoutMessages, CheckoutLocale, CheckoutFormatters, SupportedCurrency } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Detects the best matching locale from the browser's language settings.
|
|
5
|
+
* Maps browser languages (e.g. "es-AR", "pt-BR", "en-US") to supported locales.
|
|
6
|
+
*/
|
|
7
|
+
export declare function detectLocale(): string;
|
|
8
|
+
/**
|
|
9
|
+
* Resolves "auto" to a detected locale, or returns the locale as-is.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveLocale(locale: CheckoutLocale | string): string;
|
|
12
|
+
export declare function getMessages(locale: CheckoutLocale | string): CheckoutMessages;
|
|
13
|
+
export declare function resolveMessages(locale: CheckoutLocale | string, overrides?: Partial<CheckoutMessages>): CheckoutMessages;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/locales/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAUvG;;;GAGG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAkBrC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,GAAG,MAAM,CAErE;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,GAAG,gBAAgB,CAG7E;AAED,wBAAgB,eAAe,CAC3B,MAAM,EAAE,cAAc,GAAG,MAAM,EAC/B,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GACtC,gBAAgB,CAIlB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pt-BR.d.ts","sourceRoot":"","sources":["../../src/locales/pt-BR.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,IAAI,EAAE,gBAmDlB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface CheckoutMessages {
|
|
2
|
+
orderSummary: string;
|
|
3
|
+
quantity: string;
|
|
4
|
+
quantityShort: string;
|
|
5
|
+
removeItem: string;
|
|
6
|
+
subtotal: string;
|
|
7
|
+
discount: string;
|
|
8
|
+
shipping: string;
|
|
9
|
+
shippingFree: string;
|
|
10
|
+
taxes: string;
|
|
11
|
+
total: string;
|
|
12
|
+
couponPlaceholder: string;
|
|
13
|
+
couponApply: string;
|
|
14
|
+
couponApplied: string;
|
|
15
|
+
couponInvalid: string;
|
|
16
|
+
couponRemove: string;
|
|
17
|
+
orderSummaryTitle: string;
|
|
18
|
+
securePayment: string;
|
|
19
|
+
continueToPay: string;
|
|
20
|
+
payNow: string;
|
|
21
|
+
pay: string;
|
|
22
|
+
processing: string;
|
|
23
|
+
continueNow: string;
|
|
24
|
+
paymentMethod: string;
|
|
25
|
+
back: string;
|
|
26
|
+
completeDetails: string;
|
|
27
|
+
selectMethod: string;
|
|
28
|
+
processingPayment: string;
|
|
29
|
+
processingDescription: string;
|
|
30
|
+
redirecting: string;
|
|
31
|
+
redirectDescription: string;
|
|
32
|
+
showOrderDetails: string;
|
|
33
|
+
hideOrderDetails: string;
|
|
34
|
+
continue: string;
|
|
35
|
+
}
|
|
36
|
+
export type CheckoutLocale = "es" | "en" | "pt-BR" | "auto";
|
|
37
|
+
export type SupportedCurrency = "USD" | "EUR" | "GBP" | "BRL" | "ARS" | "MXN" | "CLP" | "COP" | "PEN" | "UYU" | "PYG" | "BOB" | "VES" | "DOP" | "CRC" | "GTQ" | "HNL" | "NIO" | "PAB" | "CAD" | "JPY" | "CNY" | "KRW" | "INR" | "AUD" | (string & {});
|
|
38
|
+
export interface CheckoutFormatters {
|
|
39
|
+
currency?: (amount: number) => string;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/locales/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAE7B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IAGnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IAGd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IAGrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IAGtB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IAGpB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IAGrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAG9B,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAG5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5D,MAAM,MAAM,iBAAiB,GACvB,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GACrC,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GACrC,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GACrC,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GACrC,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GACrC,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEpB,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;CACzC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CheckoutPlugin } from './types';
|
|
2
|
+
import { EventHandler } from '../core/event-system';
|
|
3
|
+
export interface CartEditPluginOptions {
|
|
4
|
+
allowRemove?: boolean;
|
|
5
|
+
allowQuantityEdit?: boolean;
|
|
6
|
+
minQuantity?: number;
|
|
7
|
+
maxQuantity?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function createCartEditPlugin(emit: EventHandler, options?: CartEditPluginOptions): CheckoutPlugin;
|
|
10
|
+
//# sourceMappingURL=cart-edit-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart-edit-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/cart-edit-plugin.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,SAAS,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIzD,MAAM,WAAW,qBAAqB;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AA4ID,wBAAgB,oBAAoB,CAChC,IAAI,EAAE,YAAY,EAClB,OAAO,CAAC,EAAE,qBAAqB,GAChC,cAAc,CAoBhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discount-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/discount-plugin.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,SAAS,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AA8DzD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,CA0CvE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { CheckoutPlugin, PluginSlots, PluginSlotProps, PluginItemSlotProps } from './types';
|
|
2
|
+
export type { CartEditPluginOptions } from './cart-edit-plugin';
|
|
3
|
+
export { createDiscountPlugin } from './discount-plugin';
|
|
4
|
+
export { createCartEditPlugin } from './cart-edit-plugin';
|
|
5
|
+
export { PluginProvider, usePlugins, renderSlot, renderItemSlot } from './plugin-context';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACjG,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CheckoutPlugin, PluginSlotProps, PluginItemSlotProps, PluginContextValue } from './types';
|
|
3
|
+
export declare const PluginProvider: ({ plugins, children }: {
|
|
4
|
+
plugins: CheckoutPlugin[];
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const usePlugins: () => PluginContextValue;
|
|
8
|
+
export declare function renderSlot(plugins: CheckoutPlugin[], slotName: keyof CheckoutPlugin["slots"], props: PluginSlotProps): ReactNode[];
|
|
9
|
+
export declare function renderItemSlot(plugins: CheckoutPlugin[], slotName: keyof CheckoutPlugin["slots"], props: PluginItemSlotProps): ReactNode[];
|
|
10
|
+
//# sourceMappingURL=plugin-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-context.d.ts","sourceRoot":"","sources":["../../src/plugins/plugin-context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAIxG,eAAO,MAAM,cAAc,GAAI,uBAAuB;IAAE,OAAO,EAAE,cAAc,EAAE,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,4CAGvG,CAAC;AAEF,eAAO,MAAM,UAAU,0BAAkC,CAAC;AAE1D,wBAAgB,UAAU,CACtB,OAAO,EAAE,cAAc,EAAE,EACzB,QAAQ,EAAE,MAAM,cAAc,CAAC,OAAO,CAAC,EACvC,KAAK,EAAE,eAAe,GACvB,SAAS,EAAE,CAOb;AAED,wBAAgB,cAAc,CAC1B,OAAO,EAAE,cAAc,EAAE,EACzB,QAAQ,EAAE,MAAM,cAAc,CAAC,OAAO,CAAC,EACvC,KAAK,EAAE,mBAAmB,GAC3B,SAAS,EAAE,CAOb"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CheckoutItem, CheckoutTotals } from '../core/types';
|
|
3
|
+
import { CheckoutMessages } from '../locales/types';
|
|
4
|
+
export interface PluginContextValue {
|
|
5
|
+
plugins: CheckoutPlugin[];
|
|
6
|
+
}
|
|
7
|
+
export interface PluginSlotProps {
|
|
8
|
+
items: CheckoutItem[];
|
|
9
|
+
totals: CheckoutTotals;
|
|
10
|
+
step: string;
|
|
11
|
+
t: CheckoutMessages;
|
|
12
|
+
fmt: (amount: number) => string;
|
|
13
|
+
}
|
|
14
|
+
export interface PluginItemSlotProps extends PluginSlotProps {
|
|
15
|
+
item: CheckoutItem;
|
|
16
|
+
}
|
|
17
|
+
export interface PluginSlots {
|
|
18
|
+
orderItemActions?: (props: PluginItemSlotProps) => ReactNode;
|
|
19
|
+
/** Renders at the end of item row in OrderSummary (e.g. remove icon) */
|
|
20
|
+
orderItemEnd?: (props: PluginItemSlotProps) => ReactNode;
|
|
21
|
+
/** Renders before totals in sidebar (desktop) — e.g. coupon input */
|
|
22
|
+
sidebarBeforeTotals?: (props: PluginSlotProps) => ReactNode;
|
|
23
|
+
/** Renders next to discount line in totals — e.g. remove coupon */
|
|
24
|
+
totalsDiscountAction?: (props: PluginSlotProps) => ReactNode;
|
|
25
|
+
/** Renders inside mobile bar expandable section — e.g. coupon input */
|
|
26
|
+
mobileBarExpanded?: (props: PluginSlotProps) => ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export interface CheckoutPlugin {
|
|
29
|
+
id: string;
|
|
30
|
+
slots: PluginSlots;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,gBAAgB,CAAC;IACpB,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;CACnC;AAED,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IACxD,IAAI,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IACxB,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,SAAS,CAAC;IAE7D,wEAAwE;IACxE,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,SAAS,CAAC;IAEzD,qEAAqE;IACrE,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,SAAS,CAAC;IAE5D,mEAAmE;IACnE,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,SAAS,CAAC;IAE7D,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,SAAS,CAAC;CAC7D;AAED,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,WAAW,CAAC;CACtB"}
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.right-4{right:1rem}.top-0{top:0}.top-4{top:1rem}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.-mr-1{margin-right:-.25rem}.-mt-1{margin-top:-.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-6{margin-bottom:1.5rem}.mr-3{margin-right:.75rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.block{display:block}.inline{display:inline}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-8{height:2rem}.h-\[80vh\]{height:80vh}.h-full{height:100%}.max-h-0{max-height:0px}.max-h-52{max-height:13rem}.max-h-\[70vh\]{max-height:70vh}.min-h-0{min-height:0px}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-80{width:20rem}.w-\[320px\]{width:320px}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.max-w-\[280px\]{max-width:280px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[var\(--radius-DEFAULT\)\]{border-radius:var(--radius-DEFAULT)}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-b-\[var\(--radius-DEFAULT\)\]{border-bottom-right-radius:var(--radius-DEFAULT);border-bottom-left-radius:var(--radius-DEFAULT)}.rounded-t-\[var\(--radius-DEFAULT\)\]{border-top-left-radius:var(--radius-DEFAULT);border-top-right-radius:var(--radius-DEFAULT)}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-dashed{border-style:dashed}.border-white\/10{border-color:#ffffff1a}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity, 1))}.bg-orange-500\/10{background-color:#f973161a}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pt-1{padding-top:.25rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-indigo-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.accent-indigo-500{accent-color:#6366f1}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_-4px_20px_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow: 0 -4px 20px rgba(0,0,0,.1);--tw-shadow-colored: 0 -4px 20px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.focus-within\:ring-2:focus-within{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:opacity-90:hover{opacity:.9}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.active\:scale-\[0\.98\]:active{--tw-scale-x: .98;--tw-scale-y: .98;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media (min-width: 768px){.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-full{height:100%}.md\:flex-row{flex-direction:row}}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color manipulation utilities for the Brand Auto Theme system.
|
|
3
|
+
* All functions work with hex color strings (#RRGGBB or #RGB).
|
|
4
|
+
*/
|
|
5
|
+
interface RGB {
|
|
6
|
+
r: number;
|
|
7
|
+
g: number;
|
|
8
|
+
b: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function hexToRgb(hex: string): RGB;
|
|
11
|
+
export declare function rgbToHex({ r, g, b }: RGB): string;
|
|
12
|
+
/**
|
|
13
|
+
* Calculates relative luminance using sRGB coefficients (W3C formula).
|
|
14
|
+
* Returns a value between 0 (black) and 1 (white).
|
|
15
|
+
*/
|
|
16
|
+
export declare function getLuminance(hex: string): number;
|
|
17
|
+
/**
|
|
18
|
+
* Returns #000000 or #FFFFFF based on which provides better contrast
|
|
19
|
+
* against the given background color.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getContrastColor(hex: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Returns true if the color is considered "dark" (luminance < 0.5).
|
|
24
|
+
*/
|
|
25
|
+
export declare function isDark(hex: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Darkens a hex color by a given amount (0–100).
|
|
28
|
+
*/
|
|
29
|
+
export declare function darken(hex: string, amount: number): string;
|
|
30
|
+
/**
|
|
31
|
+
* Lightens a hex color by a given amount (0–100).
|
|
32
|
+
*/
|
|
33
|
+
export declare function lighten(hex: string, amount: number): string;
|
|
34
|
+
/**
|
|
35
|
+
* Mixes two hex colors by a given ratio (0 = first color, 1 = second color).
|
|
36
|
+
*/
|
|
37
|
+
export declare function mix(hex1: string, hex2: string, ratio: number): string;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=color-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-utils.d.ts","sourceRoot":"","sources":["../../src/theme/color-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,UAAU,GAAG;IACT,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAWzC;AAED,wBAAgB,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,GAAG,MAAM,CAGjD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMhD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE3C;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAQ1D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAQ3D;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQrE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CheckoutTheme, CheckoutThemeName } from './tokens';
|
|
3
|
+
interface ThemeProviderProps {
|
|
4
|
+
theme?: CheckoutThemeName | Partial<CheckoutTheme>;
|
|
5
|
+
brandColor?: string;
|
|
6
|
+
customTheme?: Partial<CheckoutTheme>;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=theme-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-provider.d.ts","sourceRoot":"","sources":["../../src/theme/theme-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGjE,UAAU,kBAAkB;IACxB,KAAK,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAYtD,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export interface CheckoutThemeColors {
|
|
3
|
+
primary: string;
|
|
4
|
+
background: string;
|
|
5
|
+
surface: string;
|
|
6
|
+
text: string;
|
|
7
|
+
border: string;
|
|
8
|
+
success: string;
|
|
9
|
+
error: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CheckoutTheme {
|
|
12
|
+
colors: Partial<CheckoutThemeColors>;
|
|
13
|
+
radius: string;
|
|
14
|
+
fontFamily: string;
|
|
15
|
+
}
|
|
16
|
+
export type CheckoutThemeName = "light" | "dark" | "minimal" | "corporate" | "neon";
|
|
17
|
+
export declare const checkoutThemes: Record<CheckoutThemeName, CheckoutTheme>;
|
|
18
|
+
export declare const defaultTheme: CheckoutTheme;
|
|
19
|
+
export declare function mergeTheme(base: CheckoutTheme, overrides?: Partial<CheckoutTheme>): CheckoutTheme;
|
|
20
|
+
export declare function createCssVars(theme: CheckoutTheme): CSSProperties;
|
|
21
|
+
/**
|
|
22
|
+
* Generates a complete CheckoutTheme from a single brand color.
|
|
23
|
+
* Uses the brand color as `primary` and auto-generates all other tokens.
|
|
24
|
+
*/
|
|
25
|
+
export declare function generateBrandTheme(brandColor: string): CheckoutTheme;
|
|
26
|
+
/**
|
|
27
|
+
* Priority chain: customTheme overrides → brandColor theme → preset theme
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveTheme(theme?: CheckoutThemeName | Partial<CheckoutTheme>, brandColor?: string, customTheme?: Partial<CheckoutTheme>): CheckoutTheme;
|
|
30
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/theme/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;AAwEpF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,iBAAiB,EAAE,aAAa,CAMnE,CAAC;AAEF,eAAO,MAAM,YAAY,eAAQ,CAAC;AAElC,wBAAgB,UAAU,CACtB,IAAI,EAAE,aAAa,EACnB,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACnC,aAAa,CAQf;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,CAYjE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,CAiBpE;AAED;;GAEG;AACH,wBAAgB,YAAY,CACxB,KAAK,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,EAClD,UAAU,CAAC,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACrC,aAAa,CAYf"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
|
+
export declare const isPaymentStep: (step: string) => step is "payment_method" | "payment_details";
|
|
4
|
+
export declare const isReviewStep: (step: string) => step is "review";
|
|
5
|
+
export declare const formatNumber: (n: number, currency: string) => string;
|
|
6
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,iDACiB,CAAC;AAE5D,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,qBAAsB,CAAC;AAEhE,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,EAAE,UAAU,MAAM,WACqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anpayeras/agnostic-checkout",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Provider-agnostic, embeddable React checkout component with dynamic theming and plugin architecture",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
+
"style": "./dist/style.css",
|
|
9
10
|
"exports": {
|
|
10
11
|
".": {
|
|
11
12
|
"types": "./dist/index.d.ts",
|
|
12
13
|
"import": "./dist/index.js",
|
|
13
14
|
"require": "./dist/index.cjs"
|
|
14
15
|
},
|
|
15
|
-
"./styles": "./
|
|
16
|
+
"./styles": "./dist/style.css",
|
|
17
|
+
"./style.css": "./dist/style.css"
|
|
16
18
|
},
|
|
17
19
|
"files": [
|
|
18
|
-
"dist"
|
|
19
|
-
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"sideEffects": [
|
|
23
|
+
"./dist/style.css"
|
|
20
24
|
],
|
|
21
|
-
"sideEffects": false,
|
|
22
25
|
"scripts": {
|
|
23
|
-
"build": "
|
|
26
|
+
"build": "vite build",
|
|
24
27
|
"lint": "eslint src/",
|
|
25
28
|
"typecheck": "tsc --noEmit"
|
|
26
29
|
},
|
|
@@ -36,8 +39,13 @@
|
|
|
36
39
|
"devDependencies": {
|
|
37
40
|
"@types/react": "^19.2.7",
|
|
38
41
|
"@types/react-dom": "^19.2.3",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
42
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
43
|
+
"autoprefixer": "^10.4.27",
|
|
44
|
+
"postcss": "^8.5.8",
|
|
45
|
+
"tailwindcss": "^3.4.19",
|
|
46
|
+
"typescript": "^5.9.3",
|
|
47
|
+
"vite": "^5.4.21",
|
|
48
|
+
"vite-plugin-dts": "^4.5.4"
|
|
41
49
|
},
|
|
42
50
|
"keywords": [
|
|
43
51
|
"react",
|
|
@@ -48,4 +56,4 @@
|
|
|
48
56
|
"plugins"
|
|
49
57
|
],
|
|
50
58
|
"license": "MIT"
|
|
51
|
-
}
|
|
59
|
+
}
|