@schematichq/schematic-components 2.1.2 → 2.2.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.
@@ -1869,6 +1869,89 @@ export declare type ButtonSize = "sm" | "md" | "lg";
1869
1869
 
1870
1870
  export declare type ButtonVariant = "filled" | "outline" | "ghost" | "text";
1871
1871
 
1872
+ /**
1873
+ * Configuration for controlling checkout stage flow and pre-selection.
1874
+ *
1875
+ * ## Three Behavior Modes
1876
+ *
1877
+ * ### 1. Pre-Selection Mode (object without `skipped`)
1878
+ * When you provide planId/addOnIds without explicit skip config, stages are
1879
+ * shown with values pre-selected for user review.
1880
+ *
1881
+ * @example
1882
+ * // Pre-select plan, show plan stage for review
1883
+ * initializeWithPlan({ planId: 'plan_xyz' })
1884
+ *
1885
+ * @example
1886
+ * // Pre-select plan and add-ons, show both stages for review
1887
+ * initializeWithPlan({
1888
+ * planId: 'plan_xyz',
1889
+ * addOnIds: ['addon_1', 'addon_2']
1890
+ * })
1891
+ *
1892
+ * ### 2. Explicit Skip Mode (object with `skipped`)
1893
+ * With explicit skip configuration, you control exactly which stages to skip.
1894
+ * You can skip stages without pre-selecting, or pre-select and skip together.
1895
+ *
1896
+ * @example
1897
+ * // Skip plan stage without pre-selecting (user chooses plan)
1898
+ * initializeWithPlan({
1899
+ * skipped: { planStage: true }
1900
+ * })
1901
+ *
1902
+ * @example
1903
+ * // Pre-select plan AND skip plan stage (go directly to add-ons)
1904
+ * initializeWithPlan({
1905
+ * planId: 'plan_xyz',
1906
+ * skipped: { planStage: true }
1907
+ * })
1908
+ *
1909
+ * @example
1910
+ * // Pre-select plan but show it, skip add-ons stage
1911
+ * initializeWithPlan({
1912
+ * planId: 'plan_xyz',
1913
+ * skipped: { planStage: false, addOnStage: true }
1914
+ * })
1915
+ *
1916
+ * @example
1917
+ * // Skip both stages, go straight to checkout
1918
+ * initializeWithPlan({
1919
+ * planId: 'plan_xyz',
1920
+ * addOnIds: ['addon_1'],
1921
+ * skipped: { planStage: true, addOnStage: true }
1922
+ * })
1923
+ *
1924
+ * ### 3. Legacy String Format
1925
+ * Backwards compatible mode: pre-selects plan and skips plan stage.
1926
+ *
1927
+ * @example
1928
+ * initializeWithPlan('plan_xyz')
1929
+ * // Equivalent to: { planId: 'plan_xyz', skipped: { planStage: true } }
1930
+ */
1931
+ export declare interface BypassConfig {
1932
+ /**
1933
+ * Plan ID to pre-select.
1934
+ * Optional - you can skip stages without pre-selecting a plan.
1935
+ */
1936
+ planId?: string;
1937
+ /**
1938
+ * Add-on IDs to pre-select.
1939
+ * Optional - you can skip stages without pre-selecting add-ons.
1940
+ */
1941
+ addOnIds?: string[];
1942
+ /**
1943
+ * Explicit skip configuration for stages.
1944
+ * - If not provided: stages are shown with pre-selected values (review mode)
1945
+ * - If provided: you control exactly which stages to skip
1946
+ */
1947
+ skipped?: CheckoutStageSkipConfig;
1948
+ /**
1949
+ * Hide skipped stages from breadcrumb navigation.
1950
+ * Default: false (skipped stages still appear in breadcrumbs)
1951
+ */
1952
+ hideSkipped?: boolean;
1953
+ }
1954
+
1872
1955
  export declare const Card: ForwardRefExoticComponent<CardProps & RefAttributes<HTMLDivElement | null>>;
1873
1956
 
1874
1957
  export declare const cardBoxShadow = "0px 1px 20px 0px #1018280F, 0px 1px 3px 0px #1018281A";
@@ -2118,6 +2201,49 @@ export declare interface CheckoutStage {
2118
2201
  description?: string;
2119
2202
  }
2120
2203
 
2204
+ /**
2205
+ * Explicit configuration for skipping checkout stages.
2206
+ *
2207
+ * This configuration is independent of pre-selection (planId/addOnIds).
2208
+ * You have full control to:
2209
+ * - Skip stages without pre-selecting values
2210
+ * - Pre-select values without skipping stages
2211
+ * - Pre-select AND skip stages
2212
+ * - Any combination that suits your checkout flow
2213
+ *
2214
+ * @example
2215
+ * // Skip both stages (go directly to checkout/payment)
2216
+ * { planStage: true, addOnStage: true }
2217
+ *
2218
+ * @example
2219
+ * // Skip only plan stage (show add-ons)
2220
+ * { planStage: true, addOnStage: false }
2221
+ *
2222
+ * @example
2223
+ * // Show plan stage, skip add-ons stage
2224
+ * { planStage: false, addOnStage: true }
2225
+ *
2226
+ * @example
2227
+ * // Show both stages (same as not providing skipped config)
2228
+ * { planStage: false, addOnStage: false }
2229
+ */
2230
+ export declare interface CheckoutStageSkipConfig {
2231
+ /**
2232
+ * Skip the plan selection stage.
2233
+ * - true: Skip directly to next stage
2234
+ * - false: Show plan stage (user can review/change selection)
2235
+ * - undefined: Defaults to false (show stage)
2236
+ */
2237
+ planStage?: boolean;
2238
+ /**
2239
+ * Skip the add-on selection stage.
2240
+ * - true: Skip directly to next stage
2241
+ * - false: Show add-on stage (user can review/change selection)
2242
+ * - undefined: Defaults to false (show stage)
2243
+ */
2244
+ addOnStage?: boolean;
2245
+ }
2246
+
2121
2247
  export declare type CheckoutState = {
2122
2248
  period?: string;
2123
2249
  planId?: string | null;
@@ -2126,6 +2252,9 @@ export declare type CheckoutState = {
2126
2252
  addOnUsage?: boolean;
2127
2253
  credits?: boolean;
2128
2254
  bypassPlanSelection?: boolean;
2255
+ bypassAddOnSelection?: boolean;
2256
+ addOnIds?: string[];
2257
+ hideSkippedStages?: boolean;
2129
2258
  };
2130
2259
 
2131
2260
  /**
@@ -4100,7 +4229,7 @@ export declare interface EmbedContextProps extends EmbedState {
4100
4229
  setError: (error: Error) => void;
4101
4230
  setLayout: (layout: EmbedLayout) => void;
4102
4231
  setCheckoutState: (state: CheckoutState) => void;
4103
- initializeWithPlan: (planId: string) => void;
4232
+ initializeWithPlan: (config: string | BypassConfig) => void;
4104
4233
  setData: (data: HydrateDataWithCompanyContext) => void;
4105
4234
  updateSettings: (settings: DeepPartial<EmbedSettings>, options?: {
4106
4235
  update?: boolean;