@useloops/design-system 1.4.720 → 1.4.722

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 (187) hide show
  1. package/dist/Platform.js +1 -1
  2. package/dist/WebCore/FormBuilder.d.ts +3 -0
  3. package/dist/WebCore/FormBuilder.js +1 -0
  4. package/dist/WebCore.d.ts +2 -0
  5. package/dist/WebCore.js +1 -1
  6. package/dist/esm/Platform.js +1 -1
  7. package/dist/esm/WebCore/FormBuilder.js +1 -0
  8. package/dist/esm/WebCore.js +1 -1
  9. package/dist/esm/index.js +1 -1
  10. package/dist/esm/systems/Marketing/PlanFeatureTable/PlanFeatureTableSkeleton.js +1 -1
  11. package/dist/esm/systems/Marketing/PlanTierCard/PlanTierCard.js +1 -1
  12. package/dist/esm/systems/Marketing/PlanTierCard/PlanTierCardSkeleton.js +1 -1
  13. package/dist/esm/systems/Marketing/PlanTierCard/SavingsPill.js +1 -1
  14. package/dist/esm/systems/Platform/AIInsight/AIInsight.js +1 -1
  15. package/dist/esm/systems/Platform/AISummary/AISummary.js +1 -1
  16. package/dist/esm/systems/Platform/AIWrittenByLockUp/AiWrittenByLockUp.js +1 -1
  17. package/dist/esm/systems/Platform/AssetItem/AssetItem.js +1 -1
  18. package/dist/esm/systems/Platform/AssetItem/_partials/AssetItemMenu.js +1 -1
  19. package/dist/esm/systems/Platform/AssetItem/_partials/CoverTypeIndicator.js +1 -1
  20. package/dist/esm/systems/Platform/AssetItem/_partials/ImageTile.js +1 -1
  21. package/dist/esm/systems/Platform/CommentCard/CommentCard.js +1 -1
  22. package/dist/esm/systems/Platform/DataPointInfo/DataPointInfo.js +1 -1
  23. package/dist/esm/systems/Platform/DataPointInfo/_partials/DataSourceItem.js +1 -1
  24. package/dist/esm/systems/Platform/DataPointInfo/_partials/EmptyStateMessage.js +1 -1
  25. package/dist/esm/systems/Platform/DataPointInfo/_partials/StatValue.js +1 -1
  26. package/dist/esm/systems/Platform/DemographicSelectionSection/DemographicSelectionSection.js +1 -1
  27. package/dist/esm/systems/Platform/EmojiListItem/EmojiListItem.js +1 -1
  28. package/dist/esm/systems/Platform/EmojiListItem/_partials/StyledSurface.js +1 -1
  29. package/dist/esm/systems/Platform/EmojiQuestionEditorOption/EmojiQuestionEditorOption.js +1 -1
  30. package/dist/esm/systems/Platform/EmptyStateCard/EmptyStateCard.js +1 -1
  31. package/dist/esm/systems/Platform/ExtendedTestStatus/ExtendedTestStatus.js +1 -1
  32. package/dist/esm/systems/Platform/FilterCount/FilterCount.js +1 -1
  33. package/dist/esm/systems/Platform/FilterGroupAccordion/FilterGroupAccordion.js +1 -1
  34. package/dist/esm/systems/Platform/FilterPyramidGraph/FilterPyramidGraph.js +1 -1
  35. package/dist/esm/systems/Platform/FilterRow/FilterRow.js +1 -1
  36. package/dist/esm/systems/Platform/FilteredItemsCard/FilteredItemsCard.js +1 -1
  37. package/dist/esm/systems/Platform/GraphBar/_partials/UnitText/UnitText.js +1 -1
  38. package/dist/esm/systems/Platform/Header/Header.js +1 -1
  39. package/dist/esm/systems/Platform/KpiDataPopover/KpiDataPopover.js +1 -1
  40. package/dist/esm/systems/Platform/KpiDataPopover/KpiDetails.js +1 -1
  41. package/dist/esm/systems/Platform/KpiDataPopover/QuestionStatsCard.js +1 -1
  42. package/dist/esm/systems/Platform/LikertGraph/_partials/LikertActionController/LikertActionController.js +1 -1
  43. package/dist/esm/systems/Platform/LikertGraph/_partials/LikertGraphBar/LikertGraphBar.js +1 -1
  44. package/dist/esm/systems/Platform/LinkExpired/LinkExpired.js +1 -1
  45. package/dist/esm/systems/Platform/LoopItem/LoopItem.js +1 -1
  46. package/dist/esm/systems/Platform/LoopItemEmpty/LoopItemEmpty.js +1 -1
  47. package/dist/esm/systems/Platform/LoopVideoNudge/LoopVideoNudge.js +1 -1
  48. package/dist/esm/systems/Platform/MFACodeVerify/MFACodeVerify.js +1 -1
  49. package/dist/esm/systems/Platform/MiniResultCard/MiniResultCard.js +1 -1
  50. package/dist/esm/systems/Platform/PaginationControl/PaginationControl.js +1 -1
  51. package/dist/esm/systems/Platform/PinchIndicator/PinchIndicator.js +1 -1
  52. package/dist/esm/systems/Platform/PinchIndicator/_partials/StyledSurface/StyledSurface.js +1 -1
  53. package/dist/esm/systems/Platform/ProjectItem/ProjectItemGridView.js +1 -1
  54. package/dist/esm/systems/Platform/ProjectItem/ProjectItemListView.js +1 -1
  55. package/dist/esm/systems/Platform/ProjectItem/_partials/NoThumbnailPlaceholder.js +1 -1
  56. package/dist/esm/systems/Platform/ProjectItem/_partials/styledPartials.js +1 -1
  57. package/dist/esm/systems/Platform/QuestionBar/QuestionBar.js +1 -1
  58. package/dist/esm/systems/Platform/QuestionBlock/QuestionBlock.js +1 -1
  59. package/dist/esm/systems/Platform/QuestionSelector/QuestionSelector.js +1 -1
  60. package/dist/esm/systems/Platform/ScrollIndicator/ScrollIndicator.js +1 -1
  61. package/dist/esm/systems/Platform/SearchInput/SearchInput.js +1 -1
  62. package/dist/esm/systems/Platform/SectionHeader/SectionHeader.js +1 -1
  63. package/dist/esm/systems/Platform/SentimentArrow/SentimentArrow.js +1 -1
  64. package/dist/esm/systems/Platform/SliderGraph/_partials/SliderGraphBar/SliderGraphBar.js +1 -1
  65. package/dist/esm/systems/Platform/SliderGraph/_partials/SliderGraphYAxis/SliderGraphYAxis.js +1 -1
  66. package/dist/esm/systems/Platform/Tab/Tab.js +1 -1
  67. package/dist/esm/systems/Platform/TestItem/TestItem.js +1 -1
  68. package/dist/esm/systems/Platform/TestStatus/TestStatus.js +1 -1
  69. package/dist/esm/systems/Platform/TimeToFindGraph/TimeToFindGraph.js +1 -1
  70. package/dist/esm/systems/Platform/TimeToFindResult/TimeToFindResult.js +1 -1
  71. package/dist/esm/systems/Platform/VideoControls/VideoControls.js +1 -1
  72. package/dist/esm/systems/Platform/VideoControls2/VideoControls2.js +1 -1
  73. package/dist/esm/systems/Platform/VideoControls2/components/Timeline/components/FullscreenControls/FullscreenControls.js +1 -1
  74. package/dist/esm/systems/WebCore/FormBuilder/Field.js +1 -0
  75. package/dist/esm/systems/WebCore/FormBuilder/FieldCollapse.js +1 -0
  76. package/dist/esm/systems/WebCore/FormBuilder/FieldMessage.js +1 -0
  77. package/dist/esm/systems/WebCore/FormBuilder/FormActions.js +1 -0
  78. package/dist/esm/systems/WebCore/FormBuilder/FormBuilder.js +1 -0
  79. package/dist/esm/systems/WebCore/FormBuilder/components/StrengthIndicator/StrengthIndicator.js +1 -0
  80. package/dist/esm/systems/WebCore/FormBuilder/components/StrengthIndicator/components/LinearBar/LinearBar.js +1 -0
  81. package/dist/esm/systems/WebCore/FormBuilder/components/StrengthIndicator/helpers/getColorBasedOnScore.js +1 -0
  82. package/dist/esm/systems/WebCore/FormBuilder/fieldRegistry.js +1 -0
  83. package/dist/esm/systems/WebCore/InputLabelHelp/InputLabelHelp.js +1 -1
  84. package/dist/index.d.ts +2 -0
  85. package/dist/index.js +1 -1
  86. package/dist/systems/Marketing/PlanFeatureTable/PlanFeatureTableSkeleton.js +1 -1
  87. package/dist/systems/Marketing/PlanTierCard/PlanTierCard.js +1 -1
  88. package/dist/systems/Marketing/PlanTierCard/PlanTierCardSkeleton.js +1 -1
  89. package/dist/systems/Marketing/PlanTierCard/SavingsPill.js +1 -1
  90. package/dist/systems/Platform/AIInsight/AIInsight.js +1 -1
  91. package/dist/systems/Platform/AISummary/AISummary.d.ts +1 -0
  92. package/dist/systems/Platform/AISummary/AISummary.js +1 -1
  93. package/dist/systems/Platform/AIWrittenByLockUp/AiWrittenByLockUp.js +1 -1
  94. package/dist/systems/Platform/AssetItem/AssetItem.d.ts +1 -0
  95. package/dist/systems/Platform/AssetItem/AssetItem.js +1 -1
  96. package/dist/systems/Platform/AssetItem/_partials/AssetItemMenu.js +1 -1
  97. package/dist/systems/Platform/AssetItem/_partials/CoverTypeIndicator.js +1 -1
  98. package/dist/systems/Platform/AssetItem/_partials/ImageTile.js +1 -1
  99. package/dist/systems/Platform/CommentCard/CommentCard.js +1 -1
  100. package/dist/systems/Platform/CommentCard/types.d.ts +1 -0
  101. package/dist/systems/Platform/CommentFeedbackCard/CommentFeedbackCard.d.ts +2 -2
  102. package/dist/systems/Platform/DataPointInfo/DataPointInfo.js +1 -1
  103. package/dist/systems/Platform/DataPointInfo/_partials/DataSourceItem.js +1 -1
  104. package/dist/systems/Platform/DataPointInfo/_partials/EmptyStateMessage.js +1 -1
  105. package/dist/systems/Platform/DataPointInfo/_partials/StatValue.js +1 -1
  106. package/dist/systems/Platform/DemographicSelectionSection/DemographicSelectionSection.js +1 -1
  107. package/dist/systems/Platform/EmojiListItem/EmojiListItem.d.ts +1 -0
  108. package/dist/systems/Platform/EmojiListItem/EmojiListItem.js +1 -1
  109. package/dist/systems/Platform/EmojiListItem/_partials/StyledSurface.js +1 -1
  110. package/dist/systems/Platform/EmojiQuestionEditorOption/EmojiQuestionEditorOption.d.ts +1 -0
  111. package/dist/systems/Platform/EmojiQuestionEditorOption/EmojiQuestionEditorOption.js +1 -1
  112. package/dist/systems/Platform/EmptyStateCard/EmptyStateCard.d.ts +1 -0
  113. package/dist/systems/Platform/EmptyStateCard/EmptyStateCard.js +1 -1
  114. package/dist/systems/Platform/ExtendedTestStatus/ExtendedTestStatus.js +1 -1
  115. package/dist/systems/Platform/FilterCount/FilterCount.js +1 -1
  116. package/dist/systems/Platform/FilterGroupAccordion/FilterGroupAccordion.js +1 -1
  117. package/dist/systems/Platform/FilterPyramidGraph/FilterPyramidGraph.js +1 -1
  118. package/dist/systems/Platform/FilterRow/FilterRow.d.ts +1 -0
  119. package/dist/systems/Platform/FilterRow/FilterRow.js +1 -1
  120. package/dist/systems/Platform/FilteredItemsCard/FilteredItemsCard.js +1 -1
  121. package/dist/systems/Platform/GraphBar/_partials/UnitText/UnitText.d.ts +1 -0
  122. package/dist/systems/Platform/GraphBar/_partials/UnitText/UnitText.js +1 -1
  123. package/dist/systems/Platform/Header/Header.js +1 -1
  124. package/dist/systems/Platform/KpiDataPopover/KpiDataPopover.js +1 -1
  125. package/dist/systems/Platform/KpiDataPopover/KpiDetails.js +1 -1
  126. package/dist/systems/Platform/KpiDataPopover/QuestionStatsCard.js +1 -1
  127. package/dist/systems/Platform/LikertGraph/_partials/LikertActionController/LikertActionController.js +1 -1
  128. package/dist/systems/Platform/LikertGraph/_partials/LikertGraphBar/LikertGraphBar.js +1 -1
  129. package/dist/systems/Platform/LikertGraph/types.d.ts +1 -0
  130. package/dist/systems/Platform/LinkExpired/LinkExpired.js +1 -1
  131. package/dist/systems/Platform/LoopItem/LoopItem.js +1 -1
  132. package/dist/systems/Platform/LoopItemEmpty/LoopItemEmpty.js +1 -1
  133. package/dist/systems/Platform/LoopVideoNudge/LoopVideoNudge.js +1 -1
  134. package/dist/systems/Platform/MFACodeVerify/MFACodeVerify.js +1 -1
  135. package/dist/systems/Platform/MiniResultCard/MiniResultCard.js +1 -1
  136. package/dist/systems/Platform/PaginationControl/PaginationControl.js +1 -1
  137. package/dist/systems/Platform/PinchIndicator/PinchIndicator.js +1 -1
  138. package/dist/systems/Platform/PinchIndicator/_partials/StyledSurface/StyledSurface.js +1 -1
  139. package/dist/systems/Platform/ProjectItem/ProjectItemGridView.js +1 -1
  140. package/dist/systems/Platform/ProjectItem/ProjectItemListView.js +1 -1
  141. package/dist/systems/Platform/ProjectItem/_partials/NoThumbnailPlaceholder.js +1 -1
  142. package/dist/systems/Platform/ProjectItem/_partials/styledPartials.js +1 -1
  143. package/dist/systems/Platform/QuestionBar/QuestionBar.js +1 -1
  144. package/dist/systems/Platform/QuestionBlock/QuestionBlock.d.ts +1 -0
  145. package/dist/systems/Platform/QuestionBlock/QuestionBlock.js +1 -1
  146. package/dist/systems/Platform/QuestionSelector/QuestionSelector.d.ts +1 -0
  147. package/dist/systems/Platform/QuestionSelector/QuestionSelector.js +1 -1
  148. package/dist/systems/Platform/ScrollIndicator/ScrollIndicator.d.ts +4 -2
  149. package/dist/systems/Platform/ScrollIndicator/ScrollIndicator.js +1 -1
  150. package/dist/systems/Platform/SearchInput/SearchInput.js +1 -1
  151. package/dist/systems/Platform/SectionHeader/SectionHeader.js +1 -1
  152. package/dist/systems/Platform/SentimentArrow/SentimentArrow.js +1 -1
  153. package/dist/systems/Platform/SliderGraph/_partials/SliderGraphBar/SliderGraphBar.js +1 -1
  154. package/dist/systems/Platform/SliderGraph/_partials/SliderGraphYAxis/SliderGraphYAxis.js +1 -1
  155. package/dist/systems/Platform/SliderGraph/types.d.ts +1 -0
  156. package/dist/systems/Platform/Tab/Tab.js +1 -1
  157. package/dist/systems/Platform/TestItem/TestItem.js +1 -1
  158. package/dist/systems/Platform/TestStatus/TestStatus.js +1 -1
  159. package/dist/systems/Platform/TimeToFindGraph/TimeToFindGraph.js +1 -1
  160. package/dist/systems/Platform/TimeToFindResult/TimeToFindResult.js +1 -1
  161. package/dist/systems/Platform/VideoControls/VideoControls.d.ts +1 -0
  162. package/dist/systems/Platform/VideoControls/VideoControls.js +1 -1
  163. package/dist/systems/Platform/VideoControls/components/Timeline/components/Markers/Markers.d.ts +1 -0
  164. package/dist/systems/Platform/VideoControls2/VideoControls2.d.ts +1 -0
  165. package/dist/systems/Platform/VideoControls2/VideoControls2.js +1 -1
  166. package/dist/systems/Platform/VideoControls2/components/Timeline/components/FullscreenControls/FullscreenControls.js +1 -1
  167. package/dist/systems/Platform/VideoControls2/components/Timeline/components/Markers/Markers.d.ts +1 -0
  168. package/dist/systems/Platform/VideoControls2/components/VideoOverlayControl/VideoOverlayControl.d.ts +1 -1
  169. package/dist/systems/WebCore/ExpandableTypographyClamp/ExpandableTypographyClamp.d.ts +1 -1
  170. package/dist/systems/WebCore/FormBuilder/Field.js +1 -0
  171. package/dist/systems/WebCore/FormBuilder/FieldCollapse.js +1 -0
  172. package/dist/systems/WebCore/FormBuilder/FieldMessage.js +1 -0
  173. package/dist/systems/WebCore/FormBuilder/FormActions.js +1 -0
  174. package/dist/systems/WebCore/FormBuilder/FormBuilder.d.ts +13 -0
  175. package/dist/systems/WebCore/FormBuilder/FormBuilder.js +1 -0
  176. package/dist/systems/WebCore/FormBuilder/components/StrengthIndicator/StrengthIndicator.js +1 -0
  177. package/dist/systems/WebCore/FormBuilder/components/StrengthIndicator/components/LinearBar/LinearBar.js +1 -0
  178. package/dist/systems/WebCore/FormBuilder/components/StrengthIndicator/helpers/getColorBasedOnScore.js +1 -0
  179. package/dist/systems/WebCore/FormBuilder/fieldRegistry.d.ts +140 -0
  180. package/dist/systems/WebCore/FormBuilder/fieldRegistry.js +1 -0
  181. package/dist/systems/WebCore/FormBuilder/types.d.ts +70 -0
  182. package/dist/systems/WebCore/FormGenerator/FormGenerator.d.ts +4 -0
  183. package/dist/systems/WebCore/FormGenerator/types.d.ts +8 -8
  184. package/dist/systems/WebCore/InputLabelHelp/InputLabelHelp.d.ts +2 -0
  185. package/dist/systems/WebCore/InputLabelHelp/InputLabelHelp.js +1 -1
  186. package/dist/systems/WebCore/Select/types.d.ts +2 -1
  187. package/package.json +4 -2
@@ -0,0 +1,140 @@
1
+ import { CustomFieldProps } from '../CustomField/CustomField.js';
2
+ import { RichTextFieldProps } from '../RichTextField/RichTextField.js';
3
+ import * as react from 'react';
4
+ import { ComponentProps, ReactElement } from 'react';
5
+ import { RankProps } from '../Rank/types.js';
6
+ import { RadioGroupProps } from '../RadioGroup/RadioGroup.js';
7
+ import { LikertProps } from '../Likert/Likert.js';
8
+ import { DifferentialProps } from '../Differential/Differential.js';
9
+ import { StarRatingProps } from '../StarRating/StarRating.js';
10
+ import { SliderProps } from '../Slider/Slider.js';
11
+ import { SwitchProps } from '../Switch/Switch.js';
12
+ import { CheckboxGroupProps } from '../CheckboxGroup/CheckboxGroup.js';
13
+ import { CheckboxProps } from '../Checkbox/Checkbox.js';
14
+ import { AutocompleteFieldProps } from '../AutocompleteSingle/types.js';
15
+ import { SelectProps } from '../Select/types.js';
16
+ import { CreatableAutocompleteProps } from '../CreatableAutocomplete/CreatableAutocomplete.js';
17
+ import { TextareaProps } from '../Textarea/Textarea.js';
18
+ import { NumberFieldProps } from '../NumberField/types.js';
19
+ import { TextFieldProps } from '../TextField/TextField.js';
20
+ import { FieldValues } from 'react-hook-form';
21
+ import { BaseField } from './types.js';
22
+
23
+ /** Props handed to a field's component on every render — supplied by the form, never the config. */
24
+ interface RhfFieldProps {
25
+ value: unknown;
26
+ onChange: (value: any) => void;
27
+ }
28
+ /**
29
+ * Single source of truth for controlled field types — the `fieldType` union, per-type config
30
+ * props and default values are all derived from it. Add a field type = add one entry here.
31
+ */
32
+ declare const FIELD_REGISTRY: {
33
+ textfield: {
34
+ component: react.FunctionComponent<TextFieldProps>;
35
+ getDefault: (f: any) => string;
36
+ };
37
+ numberfield: {
38
+ component: react.NamedExoticComponent<NumberFieldProps>;
39
+ getDefault: (f: any) => number;
40
+ };
41
+ textarea: {
42
+ component: react.FunctionComponent<TextareaProps>;
43
+ getDefault: (f: any) => string;
44
+ };
45
+ creatableautocomplete: {
46
+ component: react.FunctionComponent<CreatableAutocompleteProps>;
47
+ getDefault: (f: any) => string;
48
+ };
49
+ select: {
50
+ component: react.FunctionComponent<SelectProps>;
51
+ getDefault: (f: any) => any;
52
+ };
53
+ autocomplete: {
54
+ component: react.FunctionComponent<AutocompleteFieldProps>;
55
+ getDefault: (f: any) => any;
56
+ adapt: (_field: Record<string, any>, rhf: RhfFieldProps) => {
57
+ onChange: (_event: unknown, value: unknown) => void;
58
+ };
59
+ };
60
+ checkbox: {
61
+ component: react.FunctionComponent<CheckboxProps>;
62
+ getDefault: (f: any) => boolean;
63
+ };
64
+ checkboxGroup: {
65
+ component: react.FunctionComponent<CheckboxGroupProps>;
66
+ getDefault: (f: any) => string[];
67
+ };
68
+ switch: {
69
+ component: react.FunctionComponent<SwitchProps>;
70
+ getDefault: (f: any) => boolean;
71
+ adapt: (field: Record<string, any>) => {
72
+ label: any;
73
+ };
74
+ };
75
+ slider: {
76
+ component: react.FunctionComponent<SliderProps>;
77
+ getDefault: (f: any) => any;
78
+ adapt: (_field: Record<string, any>, rhf: RhfFieldProps) => {
79
+ onChange: (_event: unknown, value: number | number[]) => void;
80
+ };
81
+ };
82
+ starRating: {
83
+ component: react.FunctionComponent<StarRatingProps>;
84
+ getDefault: (f: any) => number;
85
+ adapt: (_field: Record<string, any>, rhf: RhfFieldProps) => {
86
+ onChange: (_event: unknown, value: number | null) => void;
87
+ };
88
+ };
89
+ differential: {
90
+ component: react.FunctionComponent<DifferentialProps>;
91
+ getDefault: (f: any) => any;
92
+ };
93
+ likert: {
94
+ component: react.FunctionComponent<LikertProps>;
95
+ getDefault: (f: any) => number;
96
+ };
97
+ radioGroup: {
98
+ component: react.FunctionComponent<RadioGroupProps>;
99
+ getDefault: (f: any) => string;
100
+ };
101
+ ranking: {
102
+ component: react.FunctionComponent<RankProps>;
103
+ getDefault: (f: any) => any;
104
+ };
105
+ richTextfield: {
106
+ component: react.FunctionComponent<RichTextFieldProps>;
107
+ getDefault: (f: any) => any;
108
+ };
109
+ customfield: {
110
+ component: react.FunctionComponent<CustomFieldProps>;
111
+ getDefault: (f: any) => any;
112
+ };
113
+ };
114
+ type DynamicFieldType = keyof typeof FIELD_REGISTRY;
115
+ type ControlProps<K extends DynamicFieldType> = ComponentProps<(typeof FIELD_REGISTRY)[K]['component']>;
116
+ interface FieldTypeExtras {
117
+ textfield: {
118
+ strengthIndicator?: boolean;
119
+ };
120
+ }
121
+ type ExtrasFor<K> = K extends keyof FieldTypeExtras ? FieldTypeExtras[K] : unknown;
122
+ type ControlField<K extends DynamicFieldType, TValues extends FieldValues = FieldValues> = BaseField<TValues> & {
123
+ fieldType: K;
124
+ defaultValue?: ControlProps<K> extends {
125
+ value?: infer V;
126
+ } ? V : unknown;
127
+ } & ExtrasFor<K> & Partial<Omit<ControlProps<K>, 'value' | 'onChange' | 'name' | 'inputRef' | 'internalChange' | 'defaultValue'>>;
128
+ type DynamicField<TValues extends FieldValues = FieldValues> = {
129
+ [K in DynamicFieldType]: ControlField<K, TValues>;
130
+ }[DynamicFieldType];
131
+ type HtmlField<TValues extends FieldValues = FieldValues> = Omit<BaseField<TValues>, 'name'> & {
132
+ name: string;
133
+ fieldType: 'html';
134
+ content: ReactElement;
135
+ };
136
+ type FieldTypes<TValues extends FieldValues = FieldValues> = DynamicField<TValues> | HtmlField<TValues>;
137
+ type FieldType = FieldTypes['fieldType'];
138
+
139
+ export { FIELD_REGISTRY };
140
+ export type { DynamicField, DynamicFieldType, FieldType, FieldTypes, HtmlField };
@@ -0,0 +1 @@
1
+ "use strict";var e=require("../AutocompleteField/AutocompleteField.js"),t=require("../Checkbox/Checkbox.js");require("../Checkbox/StyledCheckbox.js");var l=require("../CheckboxGroup/CheckboxGroup.js"),a=require("../CreatableAutocomplete/CreatableAutocomplete.js"),u=require("../CustomField/CustomField.js"),r=require("../Differential/Differential.js"),o=require("../Likert/Likert.js"),n=require("../NumberField/NumberField.js"),i=require("../RadioGroup/RadioGroup.js"),f=require("../Rank/Rank.js"),d=require("../RichTextField/RichTextField.js");require("../SelectItem/SelectItem.js");var s=require("../Select/Select.js"),c=require("../Slider/Slider.js"),p=require("../StarRating/StarRating.js"),m=require("../Switch/Switch.js"),g=require("../Textarea/Textarea.js");const h={textfield:{component:require("../TextField/TextField.js"),getDefault:e=>e.defaultValue??""},numberfield:{component:n.default,getDefault:e=>e.defaultValue??0},textarea:{component:g,getDefault:e=>e.defaultValue??""},creatableautocomplete:{component:a,getDefault:e=>e.defaultValue??""},select:{component:s,getDefault:e=>e.defaultValue??""},autocomplete:{component:e,getDefault:e=>e.defaultValue,adapt:(e,t)=>({onChange:(e,l)=>t.onChange(l)})},checkbox:{component:t,getDefault:e=>e.defaultValue??!1},checkboxGroup:{component:l,getDefault:e=>e.defaultValue??[]},switch:{component:m,getDefault:e=>e.defaultValue??!1,adapt:e=>({label:e.label})},slider:{component:c,getDefault:e=>Array.isArray(e.defaultValue)?e.defaultValue:e.defaultValue??e.min??0,adapt:(e,t)=>({onChange:(e,l)=>t.onChange(l)})},starRating:{component:p,getDefault:e=>e.defaultValue??0,adapt:(e,t)=>({onChange:(e,l)=>t.onChange(l)})},differential:{component:r,getDefault:e=>e.defaultValue??""},likert:{component:o,getDefault:e=>e.defaultValue??""},radioGroup:{component:i,getDefault:e=>e.defaultValue??""},ranking:{component:f,getDefault:e=>e.defaultValue?e.defaultValue.map(t=>e.options.find(e=>e.id===t)):e.options},richTextfield:{component:d,getDefault:e=>e.defaultValue??""},customfield:{component:u,getDefault:e=>e.defaultValue??""}},x=["fieldType","name","ref","label","labelProps","helperText","helpTextProps","content","styleOverrides","strengthIndicator","defaultValue","hidden"],D=e=>{if(e.noneOfThese)return!0;return(e.name||e.value||"").replace(/-/g,"_").includes("none_of_these")};exports.FIELD_REGISTRY=h,exports.extractNoneOfThese=e=>{if(!e.other?.enabled||!Array.isArray(e.options))return e;const t=e.options,l=t.findIndex(D);return-1===l?e:{...e,options:t.filter((e,t)=>t!==l),noneOfTheseOption:t[l]}},exports.getDefaultValues=e=>e.reduce((e,t)=>("html"!==t.fieldType&&(e[t.name]=h[t.fieldType].getDefault(t)),e),{}),exports.getFieldDefault=e=>"html"===e.fieldType?void 0:h[e.fieldType].getDefault(e),exports.getFieldDefinition=e=>h[e],exports.splitFieldProps=e=>{const t={};for(const l of Object.keys(e))x.includes(l)||(t[l]=e[l]);return t};
@@ -0,0 +1,70 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ import { Ref, ReactElement, ReactNode } from 'react';
3
+ import { FieldValues, FieldPath, Resolver, SubmitHandler, FieldErrors, UseFormSetValue, UseFormGetFieldState, UseFormTrigger, UseFormWatch } from 'react-hook-form';
4
+ import '../../../index.js';
5
+ import '../Text/types.js';
6
+ import { ZodType } from 'zod';
7
+ import { FieldTypes } from './fieldRegistry.js';
8
+ export { DynamicFieldType, FieldType, HtmlField } from './fieldRegistry.js';
9
+ import { InputLabelProps } from '../InputLabel/InputLabel.js';
10
+ import { InputLabelHelpProps } from '../InputLabelHelp/InputLabelHelp.js';
11
+
12
+ interface BaseField<TValues extends FieldValues = FieldValues> {
13
+ name: FieldPath<TValues>;
14
+ id?: string;
15
+ ref?: Ref<HTMLElement>;
16
+ label?: string | ReactElement;
17
+ labelProps?: InputLabelProps;
18
+ helperText?: string | ReactNode;
19
+ helpTextProps?: InputLabelHelpProps;
20
+ hidden?: boolean;
21
+ disabled?: boolean;
22
+ styleOverrides?: {
23
+ sxInputWrapper?: SxProps<Theme>;
24
+ sxInputBase?: SxProps<Theme>;
25
+ sxInputStack?: SxProps<Theme>;
26
+ };
27
+ }
28
+ interface FormBuilderConfig<TValues extends FieldValues = FieldValues> {
29
+ fields: FieldTypes<TValues>[];
30
+ schema?: ZodType<TValues>;
31
+ resolver?: Resolver<TValues>;
32
+ autoComplete?: 'off';
33
+ mode?: 'onSubmit' | 'onBlur' | 'onChange';
34
+ reValidateMode?: 'onSubmit' | 'onBlur' | 'onChange';
35
+ formId?: string;
36
+ validateOnInit?: boolean;
37
+ disableInvalidSubmit?: boolean;
38
+ preserveHiddenValues?: boolean;
39
+ styleOverrides?: {
40
+ sxForm?: SxProps<Theme>;
41
+ sxButtons?: SxProps<Theme>;
42
+ sxStack?: SxProps<Theme>;
43
+ };
44
+ }
45
+ interface FormBuilderHandle<TValues extends FieldValues = FieldValues> {
46
+ submit: () => void;
47
+ reset: () => void;
48
+ values: () => TValues;
49
+ valid: () => boolean;
50
+ errors: () => FieldErrors<TValues>;
51
+ focus: (name: FieldPath<TValues>) => void;
52
+ setValue: UseFormSetValue<TValues>;
53
+ getFieldState: UseFormGetFieldState<TValues>;
54
+ trigger: UseFormTrigger<TValues>;
55
+ watch: UseFormWatch<TValues>;
56
+ }
57
+ interface FormBuilderProps<TValues extends FieldValues = FieldValues> {
58
+ formConfig: FormBuilderConfig<TValues>;
59
+ onSubmit?: SubmitHandler<TValues>;
60
+ onChange?: (values: TValues) => void;
61
+ submitButton?: ReactElement;
62
+ secondaryButton?: ReactElement;
63
+ /** @deprecated alias for `onSubmit`. */
64
+ onFormSubmit?: SubmitHandler<TValues>;
65
+ /** @deprecated alias for `onChange`. */
66
+ onFormChange?: (values: TValues) => void;
67
+ }
68
+
69
+ export { FieldTypes };
70
+ export type { BaseField, FormBuilderConfig, FormBuilderHandle, FormBuilderProps };
@@ -1,5 +1,9 @@
1
1
  import { FormGeneratorProps } from './types.js';
2
2
 
3
+ /**
4
+ * @deprecated Use `FormBuilder` instead — same config shape plus zod schema validation and
5
+ * per-field render isolation. FormGenerator will be removed in a future major version.
6
+ */
3
7
  declare const FormGenerator: FormGeneratorProps;
4
8
 
5
9
  export { FormGenerator as default };
@@ -9,19 +9,19 @@ import { CreatableAutocompleteProps } from '../CreatableAutocomplete/CreatableAu
9
9
  import { CustomFieldProps } from '../CustomField/CustomField.js';
10
10
  import { DifferentialProps } from '../Differential/Differential.js';
11
11
  import '../Text/types.js';
12
- import { HtmlProps } from '../Html/Html.js';
13
- import { InputLabelProps } from '../InputLabel/InputLabel.js';
14
- import { InputLabelHelpProps } from '../InputLabelHelp/InputLabelHelp.js';
15
- import { LikertProps } from '../Likert/Likert.js';
16
- import { NumberFieldProps } from '../NumberField/types.js';
17
- import { RadioGroupProps } from '../RadioGroup/RadioGroup.js';
18
- import { RankProps } from '../Rank/types.js';
19
12
  import { RichTextFieldProps } from '../RichTextField/RichTextField.js';
20
- import { SliderProps } from '../Slider/Slider.js';
13
+ import { RankProps } from '../Rank/types.js';
14
+ import { RadioGroupProps } from '../RadioGroup/RadioGroup.js';
15
+ import { LikertProps } from '../Likert/Likert.js';
21
16
  import { StarRatingProps } from '../StarRating/StarRating.js';
17
+ import { SliderProps } from '../Slider/Slider.js';
22
18
  import { SwitchProps } from '../Switch/Switch.js';
23
19
  import { TextareaProps } from '../Textarea/Textarea.js';
20
+ import { NumberFieldProps } from '../NumberField/types.js';
24
21
  import { TextFieldProps } from '../TextField/TextField.js';
22
+ import { HtmlProps } from '../Html/Html.js';
23
+ import { InputLabelProps } from '../InputLabel/InputLabel.js';
24
+ import { InputLabelHelpProps } from '../InputLabelHelp/InputLabelHelp.js';
25
25
 
26
26
  /**
27
27
  * Form Generator Core Types
@@ -9,6 +9,8 @@ interface InputLabelHelpProps {
9
9
  disabled?: boolean;
10
10
  required?: boolean;
11
11
  paddingLeft?: string | number;
12
+ id?: string;
13
+ role?: string;
12
14
  }
13
15
  declare const InputLabelHelp: FunctionComponent<InputLabelHelpProps>;
14
16
 
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("@mui/icons-material"),s=require("@mui/material"),a=require("../../BrandCore/Icon/Icon.js"),i=require("../InputLabelBase/InputLabelBase.js"),r=require("../utils/typography.util.js");module.exports=n=>{const{icon:l=null,state:o="default",disabled:d,showicon:u=!0,paddingLeft:c,...p}=n,x=s.useTheme();return e.jsxs(s.Box,{sx:{display:"inline-flex",alignItems:"center",paddingLeft:c,color:d?x.custom.palette.text.disabled:(()=>{switch(o){case"disabled":return x.custom.palette.text.disabled;case"positive":return x.custom.palette.text.positive;case"negative":return x.custom.palette.text.negative;default:return x.custom.palette.text.secondary}})(),"& svg":{marginRight:x.spacing(x.custom.margin.xs),width:a.iconSizeMap.xs,height:a.iconSizeMap.xs,color:"inherit"}},children:[(()=>{if(!u)return null;if(l)return l;switch(o){case"disabled":default:return e.jsx(s.Box,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:e.jsx(t.InfoOutlined,{})});case"positive":return e.jsx(s.Box,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:e.jsx(t.Check,{})});case"negative":return e.jsx(s.Box,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:e.jsx(t.ErrorOutlined,{})})}})(),e.jsx(i,{...p,disabled:d,sx:{fontSize:{xs:r.typographyVariantMap.sm.body.sm,sm:r.typographyVariantMap.sm.body.sm,md:r.typographyVariantMap.sm.body.sm,lg:r.typographyVariantMap.lg.body.sm,xl:r.typographyVariantMap.lg.body.sm}}})]})};
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("@mui/icons-material"),i=require("@mui/material"),s=require("../../BrandCore/Icon/Icon.js"),a=require("../InputLabelBase/InputLabelBase.js"),r=require("../utils/typography.util.js");module.exports=l=>{const{icon:n=null,state:o="default",disabled:d,showicon:u=!0,paddingLeft:c,id:p,role:x,...g}=l,m=i.useTheme();return e.jsxs(i.Box,{id:p,role:x,sx:{display:"inline-flex",alignItems:"center",paddingLeft:c,color:d?m.custom.palette.text.disabled:(()=>{switch(o){case"disabled":return m.custom.palette.text.disabled;case"positive":return m.custom.palette.text.positive;case"negative":return m.custom.palette.text.negative;default:return m.custom.palette.text.secondary}})(),"& svg":{marginRight:m.spacing(m.custom.margin.xs),width:s.iconSizeMap.xs,height:s.iconSizeMap.xs,color:"inherit"}},children:[(()=>{if(!u)return null;if(n)return n;switch(o){case"disabled":default:return e.jsx(i.Box,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:e.jsx(t.InfoOutlined,{})});case"positive":return e.jsx(i.Box,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:e.jsx(t.Check,{})});case"negative":return e.jsx(i.Box,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:e.jsx(t.ErrorOutlined,{})})}})(),e.jsx(a,{...g,disabled:d,sx:{fontSize:{xs:r.typographyVariantMap.sm.body.sm,sm:r.typographyVariantMap.sm.body.sm,md:r.typographyVariantMap.sm.body.sm,lg:r.typographyVariantMap.lg.body.sm,xl:r.typographyVariantMap.lg.body.sm}}})]})};
@@ -1,7 +1,8 @@
1
1
  import { SelectProps as SelectProps$1 } from '@mui/material';
2
- import { GenericSizeMap } from 'index';
2
+ import '../../../index.js';
3
3
  import { ReactElement } from 'react';
4
4
  import { SelectOption, SelectItemProps } from '../SelectItem/types.js';
5
+ import { GenericSizeMap } from '../../BrandCore/primitiveVariables.js';
5
6
 
6
7
  type InputSizing = Exclude<GenericSizeMap, 'none' | 'xxs' | 'xxl' | 'xxxl'>;
7
8
  type SelectProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useloops/design-system",
3
- "version": "1.4.720",
3
+ "version": "1.4.722",
4
4
  "description": "The official React based Loops design system",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -221,6 +221,7 @@
221
221
  "@dnd-kit/utilities": "^3.2.2",
222
222
  "@gsap/react": "^2.1.2",
223
223
  "@hookform/error-message": "^2.0.1",
224
+ "@hookform/resolvers": "^5.4.0",
224
225
  "@lottiefiles/dotlottie-react": "^0.13.5",
225
226
  "@mui/lab": "^9.0.0-beta.4",
226
227
  "@number-flow/react": "^0.5.14",
@@ -251,7 +252,8 @@
251
252
  "react-truncate-list": "^1.0.5",
252
253
  "stylis": "^4.4.0",
253
254
  "stylis-plugin-rtl": "^2.1.1",
254
- "yup": "^1.7.1"
255
+ "yup": "^1.7.1",
256
+ "zod": "^4.4.3"
255
257
  },
256
258
  "overrides": {
257
259
  "serialize-javascript": "7.0.5",