@ss-dev/agnostic-checkout 0.1.12

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.
Files changed (94) hide show
  1. package/README.md +439 -0
  2. package/dist/components/accordion-layout.d.ts +3 -0
  3. package/dist/components/accordion-layout.d.ts.map +1 -0
  4. package/dist/components/checkout-content.d.ts +5 -0
  5. package/dist/components/checkout-content.d.ts.map +1 -0
  6. package/dist/components/checkout-layout.d.ts +3 -0
  7. package/dist/components/checkout-layout.d.ts.map +1 -0
  8. package/dist/components/checkout.d.ts +4 -0
  9. package/dist/components/checkout.d.ts.map +1 -0
  10. package/dist/components/dev-tools.d.ts +3 -0
  11. package/dist/components/dev-tools.d.ts.map +1 -0
  12. package/dist/components/feedback-screen.d.ts +3 -0
  13. package/dist/components/feedback-screen.d.ts.map +1 -0
  14. package/dist/components/mobile-bar.d.ts +3 -0
  15. package/dist/components/mobile-bar.d.ts.map +1 -0
  16. package/dist/components/mobile-order-bar.d.ts +3 -0
  17. package/dist/components/mobile-order-bar.d.ts.map +1 -0
  18. package/dist/components/order-sidebar-summary.d.ts +3 -0
  19. package/dist/components/order-sidebar-summary.d.ts.map +1 -0
  20. package/dist/components/order-summary.d.ts +4 -0
  21. package/dist/components/order-summary.d.ts.map +1 -0
  22. package/dist/components/payment-form.d.ts +2 -0
  23. package/dist/components/payment-form.d.ts.map +1 -0
  24. package/dist/components/payment-methods.d.ts +4 -0
  25. package/dist/components/payment-methods.d.ts.map +1 -0
  26. package/dist/components/shipping-methods.d.ts +3 -0
  27. package/dist/components/shipping-methods.d.ts.map +1 -0
  28. package/dist/components/types.d.ts +105 -0
  29. package/dist/components/types.d.ts.map +1 -0
  30. package/dist/components/ui/badge.d.ts +9 -0
  31. package/dist/components/ui/badge.d.ts.map +1 -0
  32. package/dist/components/ui/button.d.ts +16 -0
  33. package/dist/components/ui/button.d.ts.map +1 -0
  34. package/dist/components/ui/card.d.ts +19 -0
  35. package/dist/components/ui/card.d.ts.map +1 -0
  36. package/dist/components/ui/index.d.ts +6 -0
  37. package/dist/components/ui/index.d.ts.map +1 -0
  38. package/dist/components/ui/selectable-card.d.ts +15 -0
  39. package/dist/components/ui/selectable-card.d.ts.map +1 -0
  40. package/dist/components/ui/spinner.d.ts +7 -0
  41. package/dist/components/ui/spinner.d.ts.map +1 -0
  42. package/dist/core/checkout-context.d.ts +67 -0
  43. package/dist/core/checkout-context.d.ts.map +1 -0
  44. package/dist/core/checkout-machine.d.ts +3 -0
  45. package/dist/core/checkout-machine.d.ts.map +1 -0
  46. package/dist/core/event-system.d.ts +35 -0
  47. package/dist/core/event-system.d.ts.map +1 -0
  48. package/dist/core/i18n-context.d.ts +17 -0
  49. package/dist/core/i18n-context.d.ts.map +1 -0
  50. package/dist/core/license.d.ts +18 -0
  51. package/dist/core/license.d.ts.map +1 -0
  52. package/dist/core/provider.interface.d.ts +7 -0
  53. package/dist/core/provider.interface.d.ts.map +1 -0
  54. package/dist/core/types.d.ts +76 -0
  55. package/dist/core/types.d.ts.map +1 -0
  56. package/dist/hooks/useCheckout.d.ts +37 -0
  57. package/dist/hooks/useCheckout.d.ts.map +1 -0
  58. package/dist/hooks/useLicense.d.ts +8 -0
  59. package/dist/hooks/useLicense.d.ts.map +1 -0
  60. package/dist/index.cjs +157 -0
  61. package/dist/index.d.ts +21 -0
  62. package/dist/index.d.ts.map +1 -0
  63. package/dist/index.js +5069 -0
  64. package/dist/locales/en.d.ts +3 -0
  65. package/dist/locales/en.d.ts.map +1 -0
  66. package/dist/locales/es.d.ts +3 -0
  67. package/dist/locales/es.d.ts.map +1 -0
  68. package/dist/locales/index.d.ts +14 -0
  69. package/dist/locales/index.d.ts.map +1 -0
  70. package/dist/locales/pt-BR.d.ts +3 -0
  71. package/dist/locales/pt-BR.d.ts.map +1 -0
  72. package/dist/locales/types.d.ts +46 -0
  73. package/dist/locales/types.d.ts.map +1 -0
  74. package/dist/plugins/cart-edit-plugin.d.ts +10 -0
  75. package/dist/plugins/cart-edit-plugin.d.ts.map +1 -0
  76. package/dist/plugins/discount-plugin.d.ts +4 -0
  77. package/dist/plugins/discount-plugin.d.ts.map +1 -0
  78. package/dist/plugins/index.d.ts +8 -0
  79. package/dist/plugins/index.d.ts.map +1 -0
  80. package/dist/plugins/plugin-context.d.ts +10 -0
  81. package/dist/plugins/plugin-context.d.ts.map +1 -0
  82. package/dist/plugins/shipping-plugin.d.ts +27 -0
  83. package/dist/plugins/shipping-plugin.d.ts.map +1 -0
  84. package/dist/plugins/types.d.ts +35 -0
  85. package/dist/plugins/types.d.ts.map +1 -0
  86. package/dist/theme/color-utils.d.ts +39 -0
  87. package/dist/theme/color-utils.d.ts.map +1 -0
  88. package/dist/theme/theme-provider.d.ts +11 -0
  89. package/dist/theme/theme-provider.d.ts.map +1 -0
  90. package/dist/theme/tokens.d.ts +30 -0
  91. package/dist/theme/tokens.d.ts.map +1 -0
  92. package/dist/utils/utils.d.ts +7 -0
  93. package/dist/utils/utils.d.ts.map +1 -0
  94. package/package.json +56 -0
@@ -0,0 +1,3 @@
1
+ import { CheckoutMessages } from './types';
2
+ export declare const en: CheckoutMessages;
3
+ //# sourceMappingURL=en.d.ts.map
@@ -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,gBA0DhB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { CheckoutMessages } from './types';
2
+ export declare const es: CheckoutMessages;
3
+ //# sourceMappingURL=es.d.ts.map
@@ -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,gBA0DhB,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,3 @@
1
+ import { CheckoutMessages } from './types';
2
+ export declare const ptBR: CheckoutMessages;
3
+ //# sourceMappingURL=pt-BR.d.ts.map
@@ -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,gBA0DlB,CAAC"}
@@ -0,0 +1,46 @@
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
+ confirmOrder: string;
20
+ continueToPay: string;
21
+ payNow: string;
22
+ pay: string;
23
+ processing: string;
24
+ continueNow: string;
25
+ paymentMethod: string;
26
+ back: string;
27
+ completeDetails: string;
28
+ selectMethod: string;
29
+ processingPayment: string;
30
+ processingDescription: string;
31
+ redirecting: string;
32
+ redirectDescription: string;
33
+ redirectingIn: string;
34
+ showOrderDetails: string;
35
+ hideOrderDetails: string;
36
+ continue: string;
37
+ shippingMethod: string;
38
+ continueToShipping: string;
39
+ freeShipping: string;
40
+ }
41
+ export type CheckoutLocale = "es" | "en" | "pt-BR" | "auto";
42
+ 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 & {});
43
+ export interface CheckoutFormatters {
44
+ currency?: (amount: number) => string;
45
+ }
46
+ //# 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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M,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,4 @@
1
+ import { CheckoutPlugin } from './types';
2
+ import { EventHandler } from '../core/event-system';
3
+ export declare function createDiscountPlugin(emit: EventHandler): CheckoutPlugin;
4
+ //# sourceMappingURL=discount-plugin.d.ts.map
@@ -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,8 @@
1
+ export type { CheckoutPlugin, PluginSlots, PluginSlotProps, PluginItemSlotProps } from './types';
2
+ export type { CartEditPluginOptions } from './cart-edit-plugin';
3
+ export type { ShippingMethod, ShippingMethodComponentProps, ShippingPluginConfig } from './shipping-plugin';
4
+ export { createDiscountPlugin } from './discount-plugin';
5
+ export { createCartEditPlugin } from './cart-edit-plugin';
6
+ export { createShippingPlugin } from './shipping-plugin';
7
+ export { PluginProvider, usePlugins, renderSlot, renderItemSlot } from './plugin-context';
8
+ //# 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,YAAY,EAAE,cAAc,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC5G,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,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,27 @@
1
+ import { CheckoutPlugin } from './types';
2
+ import { ReactNode } from 'react';
3
+ export interface ShippingMethodComponentProps {
4
+ /** Call this to signal that the shipping form is complete/incomplete */
5
+ onReadyChange: (ready: boolean) => void;
6
+ }
7
+ export interface ShippingMethod {
8
+ id: string;
9
+ label: string;
10
+ description?: string;
11
+ /** Shipping price — displayed next to the label */
12
+ price?: number;
13
+ /** Custom icon node. Falls back to a default icon */
14
+ icon?: ReactNode;
15
+ /**
16
+ * Optional inline form rendered when the method is selected.
17
+ * If provided, the method is considered "not ready" until `onReadyChange(true)` is called.
18
+ */
19
+ renderComponent?: (props: ShippingMethodComponentProps) => ReactNode;
20
+ }
21
+ export interface ShippingPluginConfig {
22
+ methods: ShippingMethod[];
23
+ /** Called when the user selects a shipping method */
24
+ onSelect?: (methodId: string) => void;
25
+ }
26
+ export declare function createShippingPlugin(config: ShippingPluginConfig): CheckoutPlugin;
27
+ //# sourceMappingURL=shipping-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipping-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/shipping-plugin.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,4BAA4B;IACzC,wEAAwE;IACxE,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3C;AAED,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,4BAA4B,KAAK,SAAS,CAAC;CACxE;AAED,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAID,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc,CAMjF"}
@@ -0,0 +1,35 @@
1
+ import { ReactNode } from 'react';
2
+ import { CheckoutItem, CheckoutTotals } from '../core/types';
3
+ import { CheckoutMessages } from '../locales/types';
4
+ import { ShippingMethod } from './shipping-plugin';
5
+ export interface PluginContextValue {
6
+ plugins: CheckoutPlugin[];
7
+ }
8
+ export interface PluginSlotProps {
9
+ items: CheckoutItem[];
10
+ totals: CheckoutTotals;
11
+ step: string;
12
+ t: CheckoutMessages;
13
+ fmt: (amount: number) => string;
14
+ }
15
+ export interface PluginItemSlotProps extends PluginSlotProps {
16
+ item: CheckoutItem;
17
+ }
18
+ export interface PluginSlots {
19
+ orderItemActions?: (props: PluginItemSlotProps) => ReactNode;
20
+ /** Renders at the end of item row in OrderSummary (e.g. remove icon) */
21
+ orderItemEnd?: (props: PluginItemSlotProps) => ReactNode;
22
+ /** Renders before totals in sidebar (desktop) — e.g. coupon input */
23
+ sidebarBeforeTotals?: (props: PluginSlotProps) => ReactNode;
24
+ /** Renders next to discount line in totals — e.g. remove coupon */
25
+ totalsDiscountAction?: (props: PluginSlotProps) => ReactNode;
26
+ /** Renders inside mobile bar expandable section — e.g. coupon input */
27
+ mobileBarExpanded?: (props: PluginSlotProps) => ReactNode;
28
+ }
29
+ export interface CheckoutPlugin {
30
+ id: string;
31
+ slots: PluginSlots;
32
+ /** Shipping methods registered by this plugin */
33
+ shippingMethods?: ShippingMethod[];
34
+ }
35
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","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,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,CAiBjE;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,7 @@
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 isShippingStep: (step: string) => step is "shipping_method";
6
+ export declare const formatNumber: (n: number, currency: string) => string;
7
+ //# 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,cAAc,GAAI,MAAM,MAAM,8BAA+B,CAAC;AAE3E,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,EAAE,UAAU,MAAM,WACqB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@ss-dev/agnostic-checkout",
3
+ "version": "0.1.12",
4
+ "description": "Provider-agnostic, embeddable React checkout component with dynamic theming and plugin architecture",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "sideEffects": true,
20
+ "scripts": {
21
+ "build": "vite build",
22
+ "lint": "eslint src/",
23
+ "typecheck": "tsc --noEmit"
24
+ },
25
+ "peerDependencies": {
26
+ "react": ">=18",
27
+ "react-dom": ">=18"
28
+ },
29
+ "dependencies": {
30
+ "clsx": "^2.1.1",
31
+ "convex": "^1.33.1",
32
+ "lucide-react": "^0.575.0",
33
+ "tailwind-merge": "^3.5.0"
34
+ },
35
+ "devDependencies": {
36
+ "@tailwindcss/vite": "^4.2.1",
37
+ "@types/node": "^25.5.0",
38
+ "@types/react": "^19.2.7",
39
+ "@types/react-dom": "^19.2.3",
40
+ "@vitejs/plugin-react": "^4.7.0",
41
+ "tailwindcss": "^4.2.1",
42
+ "typescript": "^5.9.3",
43
+ "vite": "^5.4.21",
44
+ "vite-plugin-css-injected-by-js": "^4.0.1",
45
+ "vite-plugin-dts": "^4.5.4"
46
+ },
47
+ "keywords": [
48
+ "react",
49
+ "checkout",
50
+ "payment",
51
+ "sdk",
52
+ "theming",
53
+ "plugins"
54
+ ],
55
+ "license": "MIT"
56
+ }