@elevasis/ui 1.0.0

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 (97) hide show
  1. package/dist/api/index.d.ts +87 -0
  2. package/dist/api/index.js +3 -0
  3. package/dist/auth/context.d.ts +19 -0
  4. package/dist/auth/context.js +1 -0
  5. package/dist/auth/index.d.ts +85 -0
  6. package/dist/auth/index.js +3 -0
  7. package/dist/chunk-3KMDHCAR.js +52 -0
  8. package/dist/chunk-5UWFGBFM.js +129 -0
  9. package/dist/chunk-6BJOYF6E.js +8 -0
  10. package/dist/chunk-6M6OLGQY.js +36 -0
  11. package/dist/chunk-7AI5ZYJ4.js +202 -0
  12. package/dist/chunk-7PLEQFHO.js +18 -0
  13. package/dist/chunk-GDV44UWF.js +138 -0
  14. package/dist/chunk-GEFB5YIR.js +338 -0
  15. package/dist/chunk-HBRMWW6V.js +43 -0
  16. package/dist/chunk-HUWJXLLF.js +681 -0
  17. package/dist/chunk-J3FALDQE.js +176 -0
  18. package/dist/chunk-JKERRYVS.js +109 -0
  19. package/dist/chunk-KA7LO7U5.js +28 -0
  20. package/dist/chunk-LHQTTUL2.js +27 -0
  21. package/dist/chunk-MAAS6CGR.js +1299 -0
  22. package/dist/chunk-NE36BUGQ.js +146 -0
  23. package/dist/chunk-NGXCFBCS.js +398 -0
  24. package/dist/chunk-OEYU5O27.js +235 -0
  25. package/dist/chunk-OUHGHTE7.js +748 -0
  26. package/dist/chunk-OXVOHOP3.js +661 -0
  27. package/dist/chunk-PSLKGOBZ.js +58 -0
  28. package/dist/chunk-PYL4XW6H.js +107 -0
  29. package/dist/chunk-Q47SPRY7.js +1 -0
  30. package/dist/chunk-Q7DJKLEN.js +18 -0
  31. package/dist/chunk-RJCA5672.js +1664 -0
  32. package/dist/chunk-S66I2PYB.js +748 -0
  33. package/dist/chunk-W7ZBF5AA.js +1 -0
  34. package/dist/chunk-WNWKOCGJ.js +1067 -0
  35. package/dist/chunk-XCYKC6OZ.js +1 -0
  36. package/dist/chunk-YULUKCS6.js +56 -0
  37. package/dist/chunk-YZ6GTZXL.js +48 -0
  38. package/dist/chunk-ZGHDPDTF.js +379 -0
  39. package/dist/components/command-queue/index.css +53 -0
  40. package/dist/components/command-queue/index.d.ts +204 -0
  41. package/dist/components/command-queue/index.js +10 -0
  42. package/dist/components/forms/index.d.ts +56 -0
  43. package/dist/components/forms/index.js +2 -0
  44. package/dist/components/index.css +443 -0
  45. package/dist/components/index.d.ts +1354 -0
  46. package/dist/components/index.js +18 -0
  47. package/dist/components/monitoring/index.d.ts +66 -0
  48. package/dist/components/monitoring/index.js +2 -0
  49. package/dist/components/navigation/index.d.ts +54 -0
  50. package/dist/components/navigation/index.js +91 -0
  51. package/dist/components/notifications/index.d.ts +52 -0
  52. package/dist/components/notifications/index.js +4 -0
  53. package/dist/components/resource-definition/index.css +388 -0
  54. package/dist/components/resource-definition/index.d.ts +301 -0
  55. package/dist/components/resource-definition/index.js +3 -0
  56. package/dist/display/index.css +53 -0
  57. package/dist/display/index.d.ts +606 -0
  58. package/dist/display/index.js +6 -0
  59. package/dist/execution/index.css +388 -0
  60. package/dist/execution/index.d.ts +1090 -0
  61. package/dist/execution/index.js +4 -0
  62. package/dist/graph/index.css +388 -0
  63. package/dist/graph/index.d.ts +429 -0
  64. package/dist/graph/index.js +1 -0
  65. package/dist/hooks/index.d.ts +1927 -0
  66. package/dist/hooks/index.js +6 -0
  67. package/dist/hooks/published.d.ts +1653 -0
  68. package/dist/hooks/published.js +4 -0
  69. package/dist/index.css +505 -0
  70. package/dist/index.d.ts +7284 -0
  71. package/dist/index.js +31 -0
  72. package/dist/initialization/index.d.ts +2325 -0
  73. package/dist/initialization/index.js +4 -0
  74. package/dist/organization/index.d.ts +225 -0
  75. package/dist/organization/index.js +4 -0
  76. package/dist/profile/index.d.ts +2265 -0
  77. package/dist/profile/index.js +3 -0
  78. package/dist/provider/index.css +61 -0
  79. package/dist/provider/index.d.ts +291 -0
  80. package/dist/provider/index.js +7 -0
  81. package/dist/provider/published.d.ts +198 -0
  82. package/dist/provider/published.js +6 -0
  83. package/dist/router/context.d.ts +19 -0
  84. package/dist/router/context.js +1 -0
  85. package/dist/router/index.d.ts +31 -0
  86. package/dist/router/index.js +2 -0
  87. package/dist/sse/index.d.ts +83 -0
  88. package/dist/sse/index.js +185 -0
  89. package/dist/supabase/index.d.ts +4289 -0
  90. package/dist/supabase/index.js +47 -0
  91. package/dist/typeform/index.d.ts +458 -0
  92. package/dist/typeform/index.js +1976 -0
  93. package/dist/typeform/schemas.d.ts +67 -0
  94. package/dist/typeform/schemas.js +1 -0
  95. package/dist/utils/index.d.ts +177 -0
  96. package/dist/utils/index.js +1 -0
  97. package/package.json +88 -0
@@ -0,0 +1,47 @@
1
+ import { useAuthContext } from '../chunk-7PLEQFHO.js';
2
+ import { createClient } from '@supabase/supabase-js';
3
+ import { useMemo } from 'react';
4
+
5
+ function getSupabaseConfig() {
6
+ const url = import.meta.env?.VITE_SUPABASE_URL;
7
+ const anonKey = import.meta.env?.VITE_SUPABASE_ANON_KEY;
8
+ if (!url || !anonKey) {
9
+ throw new Error("Missing Supabase environment variables (VITE_SUPABASE_URL, VITE_SUPABASE_ANON_KEY)");
10
+ }
11
+ return { url, anonKey };
12
+ }
13
+ var _supabase = null;
14
+ function getSupabaseClient() {
15
+ if (!_supabase) {
16
+ const { url, anonKey } = getSupabaseConfig();
17
+ _supabase = createClient(url, anonKey);
18
+ }
19
+ return _supabase;
20
+ }
21
+ var useSupabase = () => {
22
+ const { getAccessToken } = useAuthContext();
23
+ const { url, anonKey } = getSupabaseConfig();
24
+ return useMemo(
25
+ () => createClient(url, anonKey, {
26
+ global: {
27
+ headers: {
28
+ // Additional headers if needed
29
+ }
30
+ },
31
+ accessToken: async () => {
32
+ try {
33
+ const token = await getAccessToken();
34
+ if (!token) {
35
+ return null;
36
+ }
37
+ return token;
38
+ } catch {
39
+ return null;
40
+ }
41
+ }
42
+ }),
43
+ [getAccessToken, url, anonKey]
44
+ );
45
+ };
46
+
47
+ export { getSupabaseClient, useSupabase };
@@ -0,0 +1,458 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode, CSSProperties } from 'react';
3
+ import { ZodSchema, z } from 'zod';
4
+
5
+ /**
6
+ * Discriminated union for single-value answers.
7
+ * 'preset' = selected from predefined options
8
+ * 'custom' = user-entered value via "Other" option
9
+ */
10
+ type AnswerValue = {
11
+ type: 'preset';
12
+ value: string;
13
+ } | {
14
+ type: 'custom';
15
+ value: string;
16
+ };
17
+ /**
18
+ * Multi-value answer (checkbox/multi-select).
19
+ * Array of AnswerValue objects, can mix preset and custom.
20
+ */
21
+ type MultiAnswerValue = AnswerValue[];
22
+ /**
23
+ * Factory helper for creating preset answer values.
24
+ */
25
+ declare function createPresetValue(value: string): AnswerValue;
26
+ /**
27
+ * Factory helper for creating custom answer values.
28
+ */
29
+ declare function createCustomValue(value: string): AnswerValue;
30
+ /**
31
+ * Type guard to check if an answer is custom (user-entered).
32
+ */
33
+ declare function isCustomValue(answer: AnswerValue): answer is {
34
+ type: 'custom';
35
+ value: string;
36
+ };
37
+ /**
38
+ * Type guard to check if an answer is preset (from options).
39
+ */
40
+ declare function isPresetValue(answer: AnswerValue): answer is {
41
+ type: 'preset';
42
+ value: string;
43
+ };
44
+ /**
45
+ * Extract the raw string value from an AnswerValue.
46
+ * Useful for display or simple comparisons.
47
+ */
48
+ declare function getAnswerString(answer: AnswerValue | undefined): string;
49
+ /**
50
+ * Extract all raw string values from MultiAnswerValue.
51
+ */
52
+ declare function getMultiAnswerStrings(answers: MultiAnswerValue): string[];
53
+ /**
54
+ * Check if a MultiAnswerValue contains any custom value.
55
+ */
56
+ declare function hasCustomValue(answers: MultiAnswerValue): boolean;
57
+ /**
58
+ * Get the custom value text from a MultiAnswerValue, if present.
59
+ */
60
+ declare function getCustomValueText(answers: MultiAnswerValue): string | undefined;
61
+ /**
62
+ * Check if a MultiAnswerValue contains a specific preset value.
63
+ */
64
+ declare function hasPresetValue(answers: MultiAnswerValue, value: string): boolean;
65
+ /**
66
+ * Extract the raw string value from an AnswerValue for display or storage.
67
+ * For custom values, returns the user-entered text.
68
+ * For preset values, returns the preset value.
69
+ */
70
+ declare function extractAnswerValue(answer: AnswerValue): string;
71
+ /**
72
+ * Extract all raw string values from a MultiAnswerValue.
73
+ */
74
+ declare function extractMultiAnswerValues(answers: MultiAnswerValue): string[];
75
+ interface TypeformStyles {
76
+ container?: React.CSSProperties;
77
+ question?: React.CSSProperties;
78
+ questionNumber?: React.CSSProperties;
79
+ questionTitle?: React.CSSProperties;
80
+ questionDescription?: React.CSSProperties;
81
+ card?: React.CSSProperties;
82
+ cardSelected?: React.CSSProperties;
83
+ cardHovered?: React.CSSProperties;
84
+ cardLabel?: React.CSSProperties;
85
+ cardDescription?: React.CSSProperties;
86
+ cardKey?: React.CSSProperties;
87
+ cardCheckmark?: React.CSSProperties;
88
+ input?: React.CSSProperties;
89
+ textarea?: React.CSSProperties;
90
+ progress?: React.CSSProperties;
91
+ progressBar?: React.CSSProperties;
92
+ progressText?: React.CSSProperties;
93
+ navigation?: React.CSSProperties;
94
+ buttonBack?: React.CSSProperties;
95
+ buttonNext?: React.CSSProperties;
96
+ buttonSubmit?: React.CSSProperties;
97
+ buttonTerminate?: React.CSSProperties;
98
+ completion?: React.CSSProperties;
99
+ completionIcon?: React.CSSProperties;
100
+ completionTitle?: React.CSSProperties;
101
+ completionText?: React.CSSProperties;
102
+ error?: React.CSSProperties;
103
+ }
104
+ interface TypeformTheme {
105
+ colors?: {
106
+ primary?: string;
107
+ background?: string;
108
+ card?: string;
109
+ cardBorder?: string;
110
+ text?: string;
111
+ textMuted?: string;
112
+ };
113
+ spacing?: {
114
+ questionGap?: number;
115
+ contentMaxWidth?: number;
116
+ pageGap?: number;
117
+ };
118
+ animation?: {
119
+ duration?: number;
120
+ easing?: string;
121
+ };
122
+ options?: {
123
+ autoAdvance?: boolean;
124
+ compact?: boolean;
125
+ };
126
+ }
127
+ interface TypeformOption {
128
+ value: string;
129
+ label: string;
130
+ description?: string;
131
+ }
132
+ interface BaseQuestion {
133
+ id: string;
134
+ question: string;
135
+ description?: string;
136
+ required?: boolean;
137
+ }
138
+ interface RadioQuestion extends BaseQuestion {
139
+ type: 'radio';
140
+ options: TypeformOption[];
141
+ }
142
+ interface CheckboxQuestion extends BaseQuestion {
143
+ type: 'checkbox';
144
+ options: TypeformOption[];
145
+ minSelect?: number;
146
+ maxSelect?: number;
147
+ }
148
+ interface TextQuestion extends BaseQuestion {
149
+ type: 'text' | 'email';
150
+ placeholder?: string;
151
+ inputType?: 'text' | 'email' | 'tel' | 'url' | 'number';
152
+ }
153
+ interface TextareaQuestion extends BaseQuestion {
154
+ type: 'textarea';
155
+ placeholder?: string;
156
+ rows?: number;
157
+ }
158
+ type PageCondition = {
159
+ field: string;
160
+ operator: 'equals' | 'notEquals';
161
+ value: string;
162
+ } | {
163
+ field: string;
164
+ operator: 'includes' | 'notIncludes';
165
+ value: string;
166
+ } | {
167
+ field: string;
168
+ operator: 'isEmpty' | 'isNotEmpty';
169
+ } | ((answers: TypeformAnswers) => boolean);
170
+ interface ContentQuestion {
171
+ id: string;
172
+ type: 'content';
173
+ content: string;
174
+ style?: 'default' | 'callout' | 'script' | 'info' | 'warning';
175
+ condition?: PageCondition;
176
+ question?: string;
177
+ description?: string;
178
+ }
179
+ interface ArrayQuestion extends BaseQuestion {
180
+ type: 'array';
181
+ itemTemplate: {
182
+ fields: TypeformQuestion[];
183
+ };
184
+ minItems?: number;
185
+ maxItems?: number;
186
+ addLabel?: string;
187
+ removeLabel?: string;
188
+ itemLabel?: (index: number) => string;
189
+ summaryFields?: string[];
190
+ }
191
+ type TypeformInputQuestion = RadioQuestion | CheckboxQuestion | TextQuestion | TextareaQuestion | ArrayQuestion;
192
+ type TypeformQuestion = TypeformInputQuestion | ContentQuestion;
193
+ interface TypeformPage {
194
+ id: string;
195
+ title?: string;
196
+ description?: string;
197
+ questions: TypeformQuestion[];
198
+ condition?: PageCondition;
199
+ }
200
+ interface TypeformConfig<T extends Record<string, unknown> = Record<string, unknown>> {
201
+ questions?: TypeformQuestion[];
202
+ pages?: TypeformPage[];
203
+ schema?: ZodSchema<T>;
204
+ onSubmit: (data: T) => void | Promise<void>;
205
+ onStepChange?: (step: number, question: TypeformQuestion) => void;
206
+ onPageChange?: (pageIndex: number, page: TypeformPage) => void;
207
+ theme?: TypeformTheme;
208
+ terminationAction?: {
209
+ label: string;
210
+ confirmText?: string;
211
+ variant?: 'subtle' | 'outline' | 'filled';
212
+ color?: string;
213
+ onTerminate: (data: {
214
+ partialData: Partial<T>;
215
+ lastPageIndex: number;
216
+ reason?: string;
217
+ }) => void | Promise<void>;
218
+ };
219
+ initialValues?: Partial<T>;
220
+ }
221
+ type ArrayItemStatus = 'editing' | 'completed';
222
+ interface ArrayItemAnswer {
223
+ _status: ArrayItemStatus;
224
+ [key: string]: string | string[] | ArrayItemStatus;
225
+ }
226
+ type TypeformAnswerValue = AnswerValue | MultiAnswerValue | ArrayItemAnswer[] | string | string[];
227
+ type TypeformAnswers = Record<string, TypeformAnswerValue>;
228
+ type TypeformErrors = Record<string, string>;
229
+ interface TypeformState {
230
+ currentIndex: number;
231
+ answers: TypeformAnswers;
232
+ errors: TypeformErrors;
233
+ isSubmitting: boolean;
234
+ isComplete: boolean;
235
+ }
236
+ interface TypeformActions {
237
+ next: () => void;
238
+ back: () => void;
239
+ goTo: (index: number) => void;
240
+ setAnswer: (questionId: string, value: TypeformAnswerValue) => void;
241
+ setArrayItemAnswer: (questionId: string, itemIndex: number, fieldId: string, value: string | string[]) => void;
242
+ submit: () => Promise<void>;
243
+ reset: () => void;
244
+ }
245
+ interface UseTypeformReturn extends TypeformState, TypeformActions {
246
+ currentQuestion: TypeformQuestion | null;
247
+ currentPage: TypeformPage | null;
248
+ currentPageIndex: number;
249
+ pages: TypeformPage[];
250
+ progress: number;
251
+ isFirstQuestion: boolean;
252
+ isLastQuestion: boolean;
253
+ isFirstPage: boolean;
254
+ isLastPage: boolean;
255
+ canProceed: boolean;
256
+ direction: 'forward' | 'backward';
257
+ terminateAndSubmit: (reason?: string) => Promise<void>;
258
+ }
259
+ interface TypeformContextValue extends UseTypeformReturn {
260
+ config: TypeformConfig;
261
+ styles?: TypeformStyles;
262
+ }
263
+ interface TypeformSurveyProps {
264
+ config: TypeformConfig;
265
+ className?: string;
266
+ styles?: TypeformStyles;
267
+ children?: ReactNode;
268
+ hideProgress?: boolean;
269
+ }
270
+ interface TypeformRadioGroupProps {
271
+ question: RadioQuestion;
272
+ value: AnswerValue | undefined;
273
+ onChange: (value: AnswerValue) => void;
274
+ error?: string;
275
+ }
276
+ interface TypeformCheckboxGroupProps {
277
+ question: CheckboxQuestion;
278
+ value: MultiAnswerValue;
279
+ onChange: (value: MultiAnswerValue) => void;
280
+ error?: string;
281
+ }
282
+ interface TypeformTextInputProps {
283
+ question: TextQuestion | TextareaQuestion;
284
+ value: string;
285
+ onChange: (value: string) => void;
286
+ error?: string;
287
+ onSubmit?: () => void;
288
+ }
289
+ interface TypeformProgressProps {
290
+ current: number;
291
+ total: number;
292
+ showPercentage?: boolean;
293
+ }
294
+ interface TypeformNavigationProps {
295
+ onBack: () => void;
296
+ onNext: () => void;
297
+ onSubmit: () => void;
298
+ canGoBack: boolean;
299
+ canGoNext: boolean;
300
+ isLastQuestion: boolean;
301
+ isSubmitting: boolean;
302
+ terminationAction?: TypeformConfig['terminationAction'];
303
+ onTerminate?: (reason?: string) => Promise<void>;
304
+ }
305
+ declare function createSurveyConfig<T extends Record<string, unknown>>(config: TypeformConfig<T>): TypeformConfig<T>;
306
+
307
+ declare function useTypeformContext(): TypeformContextValue;
308
+ declare function TypeformSurvey({ config, className, styles, hideProgress }: TypeformSurveyProps): react_jsx_runtime.JSX.Element;
309
+
310
+ declare function TypeformProgress({ current, total, showPercentage, usePortal, }: TypeformProgressProps & {
311
+ usePortal?: boolean;
312
+ }): react_jsx_runtime.JSX.Element;
313
+
314
+ declare function TypeformNavigation({ onBack, onNext, onSubmit, canGoBack, canGoNext, isLastQuestion, isSubmitting, terminationAction, onTerminate }: TypeformNavigationProps): react_jsx_runtime.JSX.Element;
315
+
316
+ interface TypeformQuestionWrapperProps {
317
+ question: string;
318
+ description?: string;
319
+ questionNumber: number;
320
+ isActive: boolean;
321
+ children: ReactNode;
322
+ error?: string;
323
+ direction?: 'forward' | 'backward';
324
+ theme?: {
325
+ animation?: {
326
+ duration?: number;
327
+ easing?: string;
328
+ };
329
+ spacing?: {
330
+ contentMaxWidth?: number;
331
+ };
332
+ };
333
+ compact?: boolean;
334
+ styles?: {
335
+ question?: CSSProperties;
336
+ questionNumber?: CSSProperties;
337
+ questionTitle?: CSSProperties;
338
+ questionDescription?: CSSProperties;
339
+ error?: CSSProperties;
340
+ };
341
+ }
342
+ /**
343
+ * Wrapper for a single question (legacy, for backwards compatibility)
344
+ */
345
+ declare function TypeformQuestionWrapper({ question, description, questionNumber, isActive, children, error, direction, theme, compact, styles: customStyles, }: TypeformQuestionWrapperProps): react_jsx_runtime.JSX.Element;
346
+
347
+ declare function TypeformRadioGroup({ question, value, onChange, error }: TypeformRadioGroupProps): react_jsx_runtime.JSX.Element;
348
+
349
+ declare function TypeformCheckboxGroup({ question, value, onChange, error }: TypeformCheckboxGroupProps): react_jsx_runtime.JSX.Element;
350
+
351
+ declare function TypeformTextInput({ question, value, onChange, error, onSubmit }: TypeformTextInputProps): react_jsx_runtime.JSX.Element;
352
+
353
+ interface TypeformArrayFieldProps {
354
+ question: ArrayQuestion;
355
+ value: ArrayItemAnswer[];
356
+ onChange: (value: ArrayItemAnswer[]) => void;
357
+ errors?: TypeformErrors;
358
+ renderField: (question: TypeformQuestion, itemIndex: number, fieldId: string, value: string | string[], onFieldChange: (value: string | string[]) => void, error?: string) => React.ReactNode;
359
+ theme?: TypeformTheme;
360
+ }
361
+ declare function TypeformArrayField({ question, value, onChange, errors, renderField, theme: _theme }: TypeformArrayFieldProps): react_jsx_runtime.JSX.Element;
362
+
363
+ declare function useTypeform(config: TypeformConfig): UseTypeformReturn;
364
+
365
+ /**
366
+ * Shared hook for card styling used by RadioGroup and CheckboxGroup.
367
+ * Ensures consistent styling and avoids duplication.
368
+ */
369
+ declare function useCardStyle(): {
370
+ getCardStyle: (isSelected: boolean, isHovered: boolean) => CSSProperties;
371
+ getKeyStyle: (isSelected: boolean, isHovered: boolean) => CSSProperties;
372
+ theme: TypeformTheme | undefined;
373
+ styles: TypeformStyles | undefined;
374
+ };
375
+
376
+ declare const defaultTheme: TypeformTheme;
377
+ declare function mergeTheme(theme?: TypeformTheme): Required<TypeformTheme>;
378
+
379
+ /**
380
+ * Brochure-style theme preset
381
+ * Emulates the Black Tap brochure aesthetic with glass cards, dark background, and blue accent
382
+ */
383
+ declare const brochureTheme: TypeformTheme;
384
+ /**
385
+ * Brochure-style styles preset
386
+ * Glass morphism cards with subtle borders and backdrop blur
387
+ *
388
+ * NOTE: Use backgroundColor for solid colors to avoid conflicts with Mantine's internal styles.
389
+ * Only use background shorthand for gradients or complex backgrounds.
390
+ */
391
+ declare const brochureStyles: TypeformStyles;
392
+
393
+ /**
394
+ * Zod schemas for Typeform answer validation.
395
+ * Separated from types.ts to avoid Next.js server/client boundary issues.
396
+ */
397
+
398
+ /**
399
+ * Zod schema for a single AnswerValue (preset or custom).
400
+ */
401
+ declare const answerValueSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
402
+ type: z.ZodLiteral<"preset">;
403
+ value: z.ZodString;
404
+ }, z.core.$strip>, z.ZodObject<{
405
+ type: z.ZodLiteral<"custom">;
406
+ value: z.ZodString;
407
+ }, z.core.$strip>], "type">;
408
+ /**
409
+ * Zod schema for MultiAnswerValue (array of AnswerValue).
410
+ */
411
+ declare const multiAnswerValueSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
412
+ type: z.ZodLiteral<"preset">;
413
+ value: z.ZodString;
414
+ }, z.core.$strip>, z.ZodObject<{
415
+ type: z.ZodLiteral<"custom">;
416
+ value: z.ZodString;
417
+ }, z.core.$strip>], "type">>;
418
+ /**
419
+ * Create a Zod schema for a radio field with "Other" option.
420
+ * Accepts either a preset value from the enum OR a custom value.
421
+ *
422
+ * @param presetValues - Array of valid preset values (e.g., ['hubspot', 'salesforce'])
423
+ * @returns Zod schema that validates AnswerValue with preset constraint
424
+ *
425
+ * @example
426
+ * const crmSchema = radioWithOtherSchema(['hubspot', 'salesforce', 'pipedrive'])
427
+ * // Accepts: { type: 'preset', value: 'hubspot' }
428
+ * // Accepts: { type: 'custom', value: 'Freshsales' }
429
+ * // Rejects: { type: 'preset', value: 'invalid' }
430
+ */
431
+ declare function radioWithOtherSchema<T extends string>(presetValues: readonly T[]): z.ZodDiscriminatedUnion<[z.ZodObject<{
432
+ type: z.ZodLiteral<"preset">;
433
+ value: z.ZodEnum<{ [k_1 in T]: k_1; } extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never>;
434
+ }, z.core.$strip>, z.ZodObject<{
435
+ type: z.ZodLiteral<"custom">;
436
+ value: z.ZodString;
437
+ }, z.core.$strip>], "type">;
438
+ /**
439
+ * Create a Zod schema for a checkbox field with "Other" option.
440
+ * Each selected value is either a preset or custom AnswerValue.
441
+ *
442
+ * @param presetValues - Array of valid preset values
443
+ * @returns Zod schema that validates MultiAnswerValue with preset constraint
444
+ *
445
+ * @example
446
+ * const toolsSchema = checkboxWithOtherSchema(['zapier', 'make', 'n8n'])
447
+ * // Accepts: [{ type: 'preset', value: 'zapier' }, { type: 'custom', value: 'Tray.io' }]
448
+ */
449
+ declare function checkboxWithOtherSchema<T extends string>(presetValues: readonly T[]): z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
450
+ type: z.ZodLiteral<"preset">;
451
+ value: z.ZodEnum<{ [k_1 in T]: k_1; } extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never>;
452
+ }, z.core.$strip>, z.ZodObject<{
453
+ type: z.ZodLiteral<"custom">;
454
+ value: z.ZodString;
455
+ }, z.core.$strip>], "type">>;
456
+
457
+ export { TypeformArrayField, TypeformCheckboxGroup, TypeformNavigation, TypeformProgress, TypeformQuestionWrapper, TypeformRadioGroup, TypeformSurvey, TypeformTextInput, answerValueSchema, brochureStyles, brochureTheme, checkboxWithOtherSchema, createCustomValue, createPresetValue, createSurveyConfig, defaultTheme, extractAnswerValue, extractMultiAnswerValues, getAnswerString, getCustomValueText, getMultiAnswerStrings, hasCustomValue, hasPresetValue, isCustomValue, isPresetValue, mergeTheme, multiAnswerValueSchema, radioWithOtherSchema, useCardStyle, useTypeform, useTypeformContext };
458
+ export type { AnswerValue, ArrayItemAnswer, ArrayQuestion, BaseQuestion, CheckboxQuestion, ContentQuestion, MultiAnswerValue, PageCondition, RadioQuestion, TextQuestion, TextareaQuestion, TypeformActions, TypeformAnswerValue, TypeformAnswers, TypeformArrayFieldProps, TypeformCheckboxGroupProps, TypeformConfig, TypeformContextValue, TypeformErrors, TypeformInputQuestion, TypeformNavigationProps, TypeformOption, TypeformPage, TypeformProgressProps, TypeformQuestion, TypeformRadioGroupProps, TypeformState, TypeformStyles, TypeformSurveyProps, TypeformTextInputProps, TypeformTheme, UseTypeformReturn };