@caffeinebounce/ui 0.62.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.
Files changed (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +39 -0
  3. package/dist/FinancialStatementTable-BNUrdTU4.d.cts +249 -0
  4. package/dist/FinancialStatementTable-BNUrdTU4.d.ts +249 -0
  5. package/dist/NewsletterSignup-BPreFi5W.d.cts +37 -0
  6. package/dist/NewsletterSignup-BPreFi5W.d.ts +37 -0
  7. package/dist/TestimonialsSection-DtPu2OeR.d.ts +736 -0
  8. package/dist/TestimonialsSection-z-yotRfv.d.cts +736 -0
  9. package/dist/UnifiedTableControls-CG299y9h.d.ts +1233 -0
  10. package/dist/UnifiedTableControls-CIjRpNhy.d.cts +1233 -0
  11. package/dist/blog.d.cts +99 -0
  12. package/dist/blog.d.ts +99 -0
  13. package/dist/blog.js +292 -0
  14. package/dist/blog.mjs +279 -0
  15. package/dist/button-BHnoRUkF.d.cts +34 -0
  16. package/dist/button-BHnoRUkF.d.ts +34 -0
  17. package/dist/charts.d.cts +80 -0
  18. package/dist/charts.d.ts +80 -0
  19. package/dist/charts.js +19 -0
  20. package/dist/charts.mjs +2 -0
  21. package/dist/chunk-33JR5SYE.js +44 -0
  22. package/dist/chunk-3NDB4YPC.js +247 -0
  23. package/dist/chunk-5RW4PYZ6.js +1504 -0
  24. package/dist/chunk-5THF4YP6.mjs +155 -0
  25. package/dist/chunk-6BUBNZPG.mjs +164 -0
  26. package/dist/chunk-6DVWMJ3H.mjs +7029 -0
  27. package/dist/chunk-6TGV2DNP.js +120 -0
  28. package/dist/chunk-72JGQ7IJ.mjs +1498 -0
  29. package/dist/chunk-7DHKQODW.mjs +2932 -0
  30. package/dist/chunk-7IKHZKAC.js +160 -0
  31. package/dist/chunk-ADIDI7AJ.js +11 -0
  32. package/dist/chunk-BFWX5GJZ.mjs +940 -0
  33. package/dist/chunk-BMFQG6RA.mjs +5537 -0
  34. package/dist/chunk-C4UT5V3P.js +65 -0
  35. package/dist/chunk-CC4KUIKC.js +2004 -0
  36. package/dist/chunk-D3QXPL47.mjs +1814 -0
  37. package/dist/chunk-DQWHYBV2.js +36 -0
  38. package/dist/chunk-E42B4GSB.js +993 -0
  39. package/dist/chunk-ESZ7CBA2.js +1007 -0
  40. package/dist/chunk-EYJJQVV4.js +111 -0
  41. package/dist/chunk-FRRS2YZH.mjs +129 -0
  42. package/dist/chunk-G5TQWWQA.mjs +37 -0
  43. package/dist/chunk-GAIQJCAZ.js +5612 -0
  44. package/dist/chunk-GMBGWOCR.mjs +48 -0
  45. package/dist/chunk-GUSTCU2W.mjs +105 -0
  46. package/dist/chunk-HBLKVQIQ.mjs +23 -0
  47. package/dist/chunk-HMAMMC72.js +26 -0
  48. package/dist/chunk-IMKLN273.mjs +9 -0
  49. package/dist/chunk-J6OLBSZR.js +250 -0
  50. package/dist/chunk-JAE45W2T.js +28 -0
  51. package/dist/chunk-JORVSG52.js +606 -0
  52. package/dist/chunk-KB7UXIQZ.mjs +984 -0
  53. package/dist/chunk-KGGQ5NZV.js +186 -0
  54. package/dist/chunk-KHCC5UKW.mjs +22 -0
  55. package/dist/chunk-KRRIRS6A.mjs +1945 -0
  56. package/dist/chunk-LQCVRWVF.js +48 -0
  57. package/dist/chunk-MHZXUOGN.mjs +168 -0
  58. package/dist/chunk-MPZFPU4X.js +349 -0
  59. package/dist/chunk-MVYRNJA6.js +74 -0
  60. package/dist/chunk-N6AFNFZR.mjs +565 -0
  61. package/dist/chunk-OFQLWSUR.mjs +214 -0
  62. package/dist/chunk-OLAAXLXY.mjs +219 -0
  63. package/dist/chunk-OZZWDIOY.js +1859 -0
  64. package/dist/chunk-PZRI43EZ.js +111 -0
  65. package/dist/chunk-Q256HRYD.js +176 -0
  66. package/dist/chunk-Q52ZEL62.mjs +223 -0
  67. package/dist/chunk-R26Y7LGJ.js +142 -0
  68. package/dist/chunk-RBUYW6QQ.js +39 -0
  69. package/dist/chunk-RVEFPVZF.mjs +43 -0
  70. package/dist/chunk-SORWLKOK.js +96 -0
  71. package/dist/chunk-STEP6C4C.mjs +33 -0
  72. package/dist/chunk-T5R6HUDG.mjs +22 -0
  73. package/dist/chunk-T6ZBA6VJ.js +7109 -0
  74. package/dist/chunk-UM7WMXIU.js +2995 -0
  75. package/dist/chunk-VBD4Q5LL.mjs +117 -0
  76. package/dist/chunk-WOITB4JL.js +195 -0
  77. package/dist/chunk-YKZEKJMZ.mjs +71 -0
  78. package/dist/chunk-YL7RZRHM.mjs +103 -0
  79. package/dist/chunk-YSLD2HLP.mjs +346 -0
  80. package/dist/chunk-ZFLZA7UP.mjs +140 -0
  81. package/dist/chunk-ZKUIUE7W.mjs +26 -0
  82. package/dist/chunk-ZOA7B32D.js +248 -0
  83. package/dist/data-table.d.cts +46 -0
  84. package/dist/data-table.d.ts +46 -0
  85. package/dist/data-table.js +270 -0
  86. package/dist/data-table.mjs +13 -0
  87. package/dist/editor.d.cts +89 -0
  88. package/dist/editor.d.ts +89 -0
  89. package/dist/editor.js +10 -0
  90. package/dist/editor.mjs +1 -0
  91. package/dist/forms.d.cts +142 -0
  92. package/dist/forms.d.ts +142 -0
  93. package/dist/forms.js +24 -0
  94. package/dist/forms.mjs +11 -0
  95. package/dist/hooks-8ORd7T1A.d.cts +751 -0
  96. package/dist/hooks-B2jU1GVT.d.ts +751 -0
  97. package/dist/hooks.d.cts +6 -0
  98. package/dist/hooks.d.ts +6 -0
  99. package/dist/hooks.js +99 -0
  100. package/dist/hooks.mjs +10 -0
  101. package/dist/index.d.cts +3141 -0
  102. package/dist/index.d.ts +3141 -0
  103. package/dist/index.js +7332 -0
  104. package/dist/index.mjs +5876 -0
  105. package/dist/layouts-DPfDDF53.d.cts +1001 -0
  106. package/dist/layouts-DPfDDF53.d.ts +1001 -0
  107. package/dist/layouts.d.cts +4 -0
  108. package/dist/layouts.d.ts +4 -0
  109. package/dist/layouts.js +100 -0
  110. package/dist/layouts.mjs +11 -0
  111. package/dist/marketing-3d.d.cts +51 -0
  112. package/dist/marketing-3d.d.ts +51 -0
  113. package/dist/marketing-3d.js +553 -0
  114. package/dist/marketing-3d.mjs +526 -0
  115. package/dist/marketing.d.cts +583 -0
  116. package/dist/marketing.d.ts +583 -0
  117. package/dist/marketing.js +299 -0
  118. package/dist/marketing.mjs +10 -0
  119. package/dist/media.d.cts +29 -0
  120. package/dist/media.d.ts +29 -0
  121. package/dist/media.js +189 -0
  122. package/dist/media.mjs +182 -0
  123. package/dist/navigation.d.cts +591 -0
  124. package/dist/navigation.d.ts +591 -0
  125. package/dist/navigation.js +108 -0
  126. package/dist/navigation.mjs +15 -0
  127. package/dist/portal.d.cts +58 -0
  128. package/dist/portal.d.ts +58 -0
  129. package/dist/portal.js +403 -0
  130. package/dist/portal.mjs +395 -0
  131. package/dist/primitives.d.cts +508 -0
  132. package/dist/primitives.d.ts +508 -0
  133. package/dist/primitives.js +295 -0
  134. package/dist/primitives.mjs +14 -0
  135. package/dist/settings.d.cts +216 -0
  136. package/dist/settings.d.ts +216 -0
  137. package/dist/settings.js +34 -0
  138. package/dist/settings.mjs +9 -0
  139. package/dist/shared-Dqn36QHZ.d.cts +4 -0
  140. package/dist/shared-Dqn36QHZ.d.ts +4 -0
  141. package/dist/styles.css +1213 -0
  142. package/package.json +189 -0
  143. package/styles.css +1 -0
@@ -0,0 +1,89 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Editor } from 'grapesjs';
3
+
4
+ /** Project types supported by the Studio SDK */
5
+ type StudioProjectType = "web" | "email";
6
+ /** Theme options for the editor */
7
+ type StudioTheme = "light" | "dark";
8
+ /** Block category configuration */
9
+ interface StudioBlockCategory {
10
+ id: string;
11
+ label: string;
12
+ order?: number;
13
+ open?: boolean;
14
+ }
15
+ /** Custom block definition for the editor */
16
+ interface StudioBlock {
17
+ id: string;
18
+ label: string;
19
+ category?: string;
20
+ content: string | {
21
+ type: string;
22
+ [key: string]: unknown;
23
+ };
24
+ media?: string;
25
+ attributes?: Record<string, string>;
26
+ }
27
+ /** Props for the StudioEditor component */
28
+ interface StudioEditorProps {
29
+ /** Type of project - "web" for forms/pages, "email" for newsletters */
30
+ projectType?: StudioProjectType;
31
+ /** Initial HTML content to load in the editor (use for new content) */
32
+ initialContent?: string;
33
+ /** Initial project data to load (use for restoring saved projects) */
34
+ initialProject?: Record<string, unknown>;
35
+ /** Called when content changes */
36
+ onChange?: (html: string, css: string, json: unknown) => void;
37
+ /** Called when user explicitly saves */
38
+ onSave?: (data: {
39
+ html: string;
40
+ css: string;
41
+ json: unknown;
42
+ }) => void;
43
+ /** Editor theme - "light" or "dark". Defaults to "light" */
44
+ theme?: StudioTheme;
45
+ /** Custom blocks to add to the editor */
46
+ customBlocks?: StudioBlock[];
47
+ /** Custom block categories */
48
+ blockCategories?: StudioBlockCategory[];
49
+ /** Whether to show the pages panel (for multi-page projects) */
50
+ showPages?: boolean;
51
+ /** Whether to show the layers panel */
52
+ showLayers?: boolean;
53
+ /** Height of the editor container */
54
+ height?: string | number;
55
+ /** Additional CSS to inject into the canvas */
56
+ canvasStyles?: string;
57
+ /** License key - use "DEV_LICENSE_KEY" for localhost development */
58
+ licenseKey?: string;
59
+ /** Called when editor is ready */
60
+ onReady?: (editor: Editor) => void;
61
+ /** Custom storage configuration */
62
+ storage?: {
63
+ /** Storage type: "browser" for local, "self" for custom handlers, "cloud" for GrapesJS cloud, or false to disable */
64
+ type?: "browser" | "self" | "cloud" | false;
65
+ /** Autosave after this many changes (0 to disable) */
66
+ autosaveChanges?: number;
67
+ /** Autosave after this many milliseconds (0 to disable) */
68
+ autosaveIntervalMs?: number;
69
+ };
70
+ /** Unique key to identify this editor instance (used for storage isolation). Changing this forces a remount. */
71
+ editorKey?: string;
72
+ /** Start the editor in preview mode (hides panels, shows canvas only). Useful for read-only views. */
73
+ previewMode?: boolean;
74
+ /** Lock the editor in preview mode - prevents user from exiting preview. Used with previewMode. */
75
+ lockPreview?: boolean;
76
+ /** Initial device to select (e.g., "Desktop", "Mobile", "Tablet"). */
77
+ initialDevice?: string;
78
+ /** Called when user changes the device. Receives the device name. */
79
+ onDeviceChange?: (device: string) => void;
80
+ /** Enable verbose debug logging for editor initialization and canvas diagnostics. */
81
+ debug?: boolean;
82
+ }
83
+ /**
84
+ * StudioEditor component using GrapesJS Studio SDK.
85
+ * Production-ready visual editor with beautiful built-in UI.
86
+ */
87
+ declare function StudioEditor({ projectType, initialContent, initialProject, onChange, onSave, theme, customBlocks, blockCategories: _blockCategories, showPages: _showPages, showLayers: _showLayers, height, canvasStyles, licenseKey, onReady, storage, editorKey, previewMode, lockPreview, initialDevice, onDeviceChange, debug, }: StudioEditorProps): react_jsx_runtime.JSX.Element;
88
+
89
+ export { type StudioBlock, type StudioBlockCategory, StudioEditor, type StudioEditorProps, type StudioProjectType, type StudioTheme };
@@ -0,0 +1,89 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Editor } from 'grapesjs';
3
+
4
+ /** Project types supported by the Studio SDK */
5
+ type StudioProjectType = "web" | "email";
6
+ /** Theme options for the editor */
7
+ type StudioTheme = "light" | "dark";
8
+ /** Block category configuration */
9
+ interface StudioBlockCategory {
10
+ id: string;
11
+ label: string;
12
+ order?: number;
13
+ open?: boolean;
14
+ }
15
+ /** Custom block definition for the editor */
16
+ interface StudioBlock {
17
+ id: string;
18
+ label: string;
19
+ category?: string;
20
+ content: string | {
21
+ type: string;
22
+ [key: string]: unknown;
23
+ };
24
+ media?: string;
25
+ attributes?: Record<string, string>;
26
+ }
27
+ /** Props for the StudioEditor component */
28
+ interface StudioEditorProps {
29
+ /** Type of project - "web" for forms/pages, "email" for newsletters */
30
+ projectType?: StudioProjectType;
31
+ /** Initial HTML content to load in the editor (use for new content) */
32
+ initialContent?: string;
33
+ /** Initial project data to load (use for restoring saved projects) */
34
+ initialProject?: Record<string, unknown>;
35
+ /** Called when content changes */
36
+ onChange?: (html: string, css: string, json: unknown) => void;
37
+ /** Called when user explicitly saves */
38
+ onSave?: (data: {
39
+ html: string;
40
+ css: string;
41
+ json: unknown;
42
+ }) => void;
43
+ /** Editor theme - "light" or "dark". Defaults to "light" */
44
+ theme?: StudioTheme;
45
+ /** Custom blocks to add to the editor */
46
+ customBlocks?: StudioBlock[];
47
+ /** Custom block categories */
48
+ blockCategories?: StudioBlockCategory[];
49
+ /** Whether to show the pages panel (for multi-page projects) */
50
+ showPages?: boolean;
51
+ /** Whether to show the layers panel */
52
+ showLayers?: boolean;
53
+ /** Height of the editor container */
54
+ height?: string | number;
55
+ /** Additional CSS to inject into the canvas */
56
+ canvasStyles?: string;
57
+ /** License key - use "DEV_LICENSE_KEY" for localhost development */
58
+ licenseKey?: string;
59
+ /** Called when editor is ready */
60
+ onReady?: (editor: Editor) => void;
61
+ /** Custom storage configuration */
62
+ storage?: {
63
+ /** Storage type: "browser" for local, "self" for custom handlers, "cloud" for GrapesJS cloud, or false to disable */
64
+ type?: "browser" | "self" | "cloud" | false;
65
+ /** Autosave after this many changes (0 to disable) */
66
+ autosaveChanges?: number;
67
+ /** Autosave after this many milliseconds (0 to disable) */
68
+ autosaveIntervalMs?: number;
69
+ };
70
+ /** Unique key to identify this editor instance (used for storage isolation). Changing this forces a remount. */
71
+ editorKey?: string;
72
+ /** Start the editor in preview mode (hides panels, shows canvas only). Useful for read-only views. */
73
+ previewMode?: boolean;
74
+ /** Lock the editor in preview mode - prevents user from exiting preview. Used with previewMode. */
75
+ lockPreview?: boolean;
76
+ /** Initial device to select (e.g., "Desktop", "Mobile", "Tablet"). */
77
+ initialDevice?: string;
78
+ /** Called when user changes the device. Receives the device name. */
79
+ onDeviceChange?: (device: string) => void;
80
+ /** Enable verbose debug logging for editor initialization and canvas diagnostics. */
81
+ debug?: boolean;
82
+ }
83
+ /**
84
+ * StudioEditor component using GrapesJS Studio SDK.
85
+ * Production-ready visual editor with beautiful built-in UI.
86
+ */
87
+ declare function StudioEditor({ projectType, initialContent, initialProject, onChange, onSave, theme, customBlocks, blockCategories: _blockCategories, showPages: _showPages, showLayers: _showLayers, height, canvasStyles, licenseKey, onReady, storage, editorKey, previewMode, lockPreview, initialDevice, onDeviceChange, debug, }: StudioEditorProps): react_jsx_runtime.JSX.Element;
88
+
89
+ export { type StudioBlock, type StudioBlockCategory, StudioEditor, type StudioEditorProps, type StudioProjectType, type StudioTheme };
package/dist/editor.js ADDED
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var chunk5RW4PYZ6_js = require('./chunk-5RW4PYZ6.js');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "StudioEditor", {
8
+ enumerable: true,
9
+ get: function () { return chunk5RW4PYZ6_js.StudioEditor; }
10
+ });
@@ -0,0 +1 @@
1
+ export { StudioEditor } from './chunk-72JGQ7IJ.mjs';
@@ -0,0 +1,142 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { LucideIcon } from 'lucide-react';
3
+ import { ReactNode } from 'react';
4
+
5
+ /**
6
+ * Step validation status for progress indicator styling
7
+ */
8
+ type StepStatus = "not-started" | "in-progress" | "incomplete" | "complete" | "error";
9
+ /**
10
+ * A single step definition for the FormWizard
11
+ */
12
+ interface FormWizardStep {
13
+ /** Unique identifier for the step */
14
+ id: string;
15
+ /** Display label for the step */
16
+ label: string;
17
+ /** Icon component from lucide-react */
18
+ icon: LucideIcon;
19
+ }
20
+ /**
21
+ * Style configuration returned for a step based on its status
22
+ */
23
+ interface StepStatusStyles {
24
+ /** Border/background classes for the icon circle */
25
+ border: string;
26
+ /** Text color classes for the label */
27
+ text: string;
28
+ /** The icon element to render */
29
+ icon: ReactNode;
30
+ /** Optional tooltip message (for error/incomplete states) */
31
+ tooltip: string | null;
32
+ }
33
+ /**
34
+ * Function type for computing step status
35
+ */
36
+ type GetStepStatus = (stepIndex: number) => StepStatus;
37
+ /**
38
+ * Function type for computing step tooltip content
39
+ */
40
+ type GetStepTooltip = (stepIndex: number, status: StepStatus) => string | null;
41
+ /**
42
+ * Props for the FormWizard component
43
+ */
44
+ interface FormWizardProps<T = unknown> {
45
+ /** Array of step definitions */
46
+ steps: FormWizardStep[];
47
+ /** Current active step index (0-based) */
48
+ currentStep: number;
49
+ /** Callback when step changes */
50
+ onStepChange: (stepIndex: number) => void;
51
+ /** Function to compute the status of each step */
52
+ getStepStatus: GetStepStatus;
53
+ /** Optional function to get tooltip content for a step */
54
+ getStepTooltip?: GetStepTooltip;
55
+ /** Enable keyboard navigation with Alt/Option+Arrow keys */
56
+ enableKeyboardNavigation?: boolean;
57
+ /** Scope keyboard navigation to elements with role="dialog" */
58
+ scopeToDialog?: boolean;
59
+ /** Callback when Escape is pressed (for cancel functionality) */
60
+ onCancel?: () => void;
61
+ /** Callback when Cmd/Ctrl+Enter is pressed (for submit functionality) */
62
+ onSubmit?: () => void;
63
+ /** Callback when Ctrl+Shift+R is pressed (for reset functionality) */
64
+ onReset?: () => void;
65
+ /**
66
+ * CSS selector for the element to auto-focus when the wizard mounts.
67
+ * Useful for focusing the first input field in a dialog.
68
+ * @example 'input[name="name"]' or '[role="dialog"] input:first-of-type'
69
+ */
70
+ autoFocusSelector?: string;
71
+ /**
72
+ * Key to use for localStorage persistence.
73
+ * If provided, form data will be automatically saved to localStorage.
74
+ */
75
+ persistKey?: string;
76
+ /** The form data to persist (required if persistKey is provided) */
77
+ formData?: T;
78
+ /** Callback when data is restored from storage */
79
+ onDataRestored?: (data: T) => void;
80
+ /** The step content to render */
81
+ children: ReactNode;
82
+ /** Additional class name for the container */
83
+ className?: string;
84
+ }
85
+ /**
86
+ * FormWizard provides a multi-step form interface with:
87
+ * - Step progress indicator with icons and animated connectors
88
+ * - Step validation status styling (not-started, in-progress, incomplete, complete, error)
89
+ * - Tooltips for steps with errors or incomplete status
90
+ * - Optional keyboard navigation (Alt/Option+Arrow keys)
91
+ *
92
+ * This component handles the step navigation and progress display,
93
+ * while the actual form fields and validation logic are provided by the parent.
94
+ *
95
+ * @example
96
+ * ```tsx
97
+ * <FormWizard
98
+ * steps={[
99
+ * { id: "basic", label: "Basic Info", icon: Building2 },
100
+ * { id: "details", label: "Details", icon: FileText },
101
+ * ]}
102
+ * currentStep={currentStep}
103
+ * onStepChange={setCurrentStep}
104
+ * getStepStatus={(index) => stepStatuses[index]}
105
+ * getStepTooltip={(index, status) =>
106
+ * status === "error" ? "Missing required fields" : null
107
+ * }
108
+ * enableKeyboardNavigation
109
+ * onCancel={() => setDialogOpen(false)}
110
+ * onSubmit={handleFormSubmit}
111
+ * >
112
+ * {currentStep === 0 && <BasicInfoFields />}
113
+ * {currentStep === 1 && <DetailsFields />}
114
+ * </FormWizard>
115
+ * ```
116
+ */
117
+ declare function FormWizard<T = unknown>({ steps, currentStep, onStepChange, getStepStatus, getStepTooltip, enableKeyboardNavigation, scopeToDialog, onCancel, onSubmit, onReset, autoFocusSelector, persistKey, formData, onDataRestored, children, className, }: FormWizardProps<T>): react_jsx_runtime.JSX.Element;
118
+ /**
119
+ * Context for navigation controls - allows children to trigger navigation
120
+ */
121
+ interface FormWizardNavigation {
122
+ /** Go to the next step */
123
+ goNext: () => void;
124
+ /** Go to the previous step */
125
+ goBack: () => void;
126
+ /** Go to a specific step */
127
+ goToStep: (index: number) => void;
128
+ /** Whether currently on the first step */
129
+ isFirstStep: boolean;
130
+ /** Whether currently on the last step */
131
+ isLastStep: boolean;
132
+ /** Current step index */
133
+ currentStep: number;
134
+ /** Total number of steps */
135
+ totalSteps: number;
136
+ }
137
+ /**
138
+ * Hook-compatible helper to create navigation handlers
139
+ */
140
+ declare function useFormWizardNavigation(currentStep: number, totalSteps: number, onStepChange: (step: number) => void): FormWizardNavigation;
141
+
142
+ export { FormWizard, type FormWizardNavigation, type FormWizardProps, type FormWizardStep, type GetStepStatus, type GetStepTooltip, type StepStatus, type StepStatusStyles, useFormWizardNavigation };
@@ -0,0 +1,142 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { LucideIcon } from 'lucide-react';
3
+ import { ReactNode } from 'react';
4
+
5
+ /**
6
+ * Step validation status for progress indicator styling
7
+ */
8
+ type StepStatus = "not-started" | "in-progress" | "incomplete" | "complete" | "error";
9
+ /**
10
+ * A single step definition for the FormWizard
11
+ */
12
+ interface FormWizardStep {
13
+ /** Unique identifier for the step */
14
+ id: string;
15
+ /** Display label for the step */
16
+ label: string;
17
+ /** Icon component from lucide-react */
18
+ icon: LucideIcon;
19
+ }
20
+ /**
21
+ * Style configuration returned for a step based on its status
22
+ */
23
+ interface StepStatusStyles {
24
+ /** Border/background classes for the icon circle */
25
+ border: string;
26
+ /** Text color classes for the label */
27
+ text: string;
28
+ /** The icon element to render */
29
+ icon: ReactNode;
30
+ /** Optional tooltip message (for error/incomplete states) */
31
+ tooltip: string | null;
32
+ }
33
+ /**
34
+ * Function type for computing step status
35
+ */
36
+ type GetStepStatus = (stepIndex: number) => StepStatus;
37
+ /**
38
+ * Function type for computing step tooltip content
39
+ */
40
+ type GetStepTooltip = (stepIndex: number, status: StepStatus) => string | null;
41
+ /**
42
+ * Props for the FormWizard component
43
+ */
44
+ interface FormWizardProps<T = unknown> {
45
+ /** Array of step definitions */
46
+ steps: FormWizardStep[];
47
+ /** Current active step index (0-based) */
48
+ currentStep: number;
49
+ /** Callback when step changes */
50
+ onStepChange: (stepIndex: number) => void;
51
+ /** Function to compute the status of each step */
52
+ getStepStatus: GetStepStatus;
53
+ /** Optional function to get tooltip content for a step */
54
+ getStepTooltip?: GetStepTooltip;
55
+ /** Enable keyboard navigation with Alt/Option+Arrow keys */
56
+ enableKeyboardNavigation?: boolean;
57
+ /** Scope keyboard navigation to elements with role="dialog" */
58
+ scopeToDialog?: boolean;
59
+ /** Callback when Escape is pressed (for cancel functionality) */
60
+ onCancel?: () => void;
61
+ /** Callback when Cmd/Ctrl+Enter is pressed (for submit functionality) */
62
+ onSubmit?: () => void;
63
+ /** Callback when Ctrl+Shift+R is pressed (for reset functionality) */
64
+ onReset?: () => void;
65
+ /**
66
+ * CSS selector for the element to auto-focus when the wizard mounts.
67
+ * Useful for focusing the first input field in a dialog.
68
+ * @example 'input[name="name"]' or '[role="dialog"] input:first-of-type'
69
+ */
70
+ autoFocusSelector?: string;
71
+ /**
72
+ * Key to use for localStorage persistence.
73
+ * If provided, form data will be automatically saved to localStorage.
74
+ */
75
+ persistKey?: string;
76
+ /** The form data to persist (required if persistKey is provided) */
77
+ formData?: T;
78
+ /** Callback when data is restored from storage */
79
+ onDataRestored?: (data: T) => void;
80
+ /** The step content to render */
81
+ children: ReactNode;
82
+ /** Additional class name for the container */
83
+ className?: string;
84
+ }
85
+ /**
86
+ * FormWizard provides a multi-step form interface with:
87
+ * - Step progress indicator with icons and animated connectors
88
+ * - Step validation status styling (not-started, in-progress, incomplete, complete, error)
89
+ * - Tooltips for steps with errors or incomplete status
90
+ * - Optional keyboard navigation (Alt/Option+Arrow keys)
91
+ *
92
+ * This component handles the step navigation and progress display,
93
+ * while the actual form fields and validation logic are provided by the parent.
94
+ *
95
+ * @example
96
+ * ```tsx
97
+ * <FormWizard
98
+ * steps={[
99
+ * { id: "basic", label: "Basic Info", icon: Building2 },
100
+ * { id: "details", label: "Details", icon: FileText },
101
+ * ]}
102
+ * currentStep={currentStep}
103
+ * onStepChange={setCurrentStep}
104
+ * getStepStatus={(index) => stepStatuses[index]}
105
+ * getStepTooltip={(index, status) =>
106
+ * status === "error" ? "Missing required fields" : null
107
+ * }
108
+ * enableKeyboardNavigation
109
+ * onCancel={() => setDialogOpen(false)}
110
+ * onSubmit={handleFormSubmit}
111
+ * >
112
+ * {currentStep === 0 && <BasicInfoFields />}
113
+ * {currentStep === 1 && <DetailsFields />}
114
+ * </FormWizard>
115
+ * ```
116
+ */
117
+ declare function FormWizard<T = unknown>({ steps, currentStep, onStepChange, getStepStatus, getStepTooltip, enableKeyboardNavigation, scopeToDialog, onCancel, onSubmit, onReset, autoFocusSelector, persistKey, formData, onDataRestored, children, className, }: FormWizardProps<T>): react_jsx_runtime.JSX.Element;
118
+ /**
119
+ * Context for navigation controls - allows children to trigger navigation
120
+ */
121
+ interface FormWizardNavigation {
122
+ /** Go to the next step */
123
+ goNext: () => void;
124
+ /** Go to the previous step */
125
+ goBack: () => void;
126
+ /** Go to a specific step */
127
+ goToStep: (index: number) => void;
128
+ /** Whether currently on the first step */
129
+ isFirstStep: boolean;
130
+ /** Whether currently on the last step */
131
+ isLastStep: boolean;
132
+ /** Current step index */
133
+ currentStep: number;
134
+ /** Total number of steps */
135
+ totalSteps: number;
136
+ }
137
+ /**
138
+ * Hook-compatible helper to create navigation handlers
139
+ */
140
+ declare function useFormWizardNavigation(currentStep: number, totalSteps: number, onStepChange: (step: number) => void): FormWizardNavigation;
141
+
142
+ export { FormWizard, type FormWizardNavigation, type FormWizardProps, type FormWizardStep, type GetStepStatus, type GetStepTooltip, type StepStatus, type StepStatusStyles, useFormWizardNavigation };
package/dist/forms.js ADDED
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ var chunkMPZFPU4X_js = require('./chunk-MPZFPU4X.js');
4
+ require('./chunk-ESZ7CBA2.js');
5
+ require('./chunk-UM7WMXIU.js');
6
+ require('./chunk-WOITB4JL.js');
7
+ require('./chunk-RBUYW6QQ.js');
8
+ require('./chunk-6TGV2DNP.js');
9
+ require('./chunk-J6OLBSZR.js');
10
+ require('./chunk-SORWLKOK.js');
11
+ require('./chunk-DQWHYBV2.js');
12
+ require('./chunk-Q256HRYD.js');
13
+ require('./chunk-ADIDI7AJ.js');
14
+
15
+
16
+
17
+ Object.defineProperty(exports, "FormWizard", {
18
+ enumerable: true,
19
+ get: function () { return chunkMPZFPU4X_js.FormWizard; }
20
+ });
21
+ Object.defineProperty(exports, "useFormWizardNavigation", {
22
+ enumerable: true,
23
+ get: function () { return chunkMPZFPU4X_js.useFormWizardNavigation; }
24
+ });
package/dist/forms.mjs ADDED
@@ -0,0 +1,11 @@
1
+ export { FormWizard, useFormWizardNavigation } from './chunk-YSLD2HLP.mjs';
2
+ import './chunk-KB7UXIQZ.mjs';
3
+ import './chunk-7DHKQODW.mjs';
4
+ import './chunk-6BUBNZPG.mjs';
5
+ import './chunk-G5TQWWQA.mjs';
6
+ import './chunk-VBD4Q5LL.mjs';
7
+ import './chunk-OFQLWSUR.mjs';
8
+ import './chunk-YKZEKJMZ.mjs';
9
+ import './chunk-STEP6C4C.mjs';
10
+ import './chunk-MHZXUOGN.mjs';
11
+ import './chunk-IMKLN273.mjs';