@fluid-app/portal-core 0.1.16

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 (195) hide show
  1. package/dist/chunk-CKQMccvm.cjs +28 -0
  2. package/dist/data-sources/DataAwareWidget.cjs +50 -0
  3. package/dist/data-sources/DataAwareWidget.cjs.map +1 -0
  4. package/dist/data-sources/DataAwareWidget.d.cts +24 -0
  5. package/dist/data-sources/DataAwareWidget.d.cts.map +1 -0
  6. package/dist/data-sources/DataAwareWidget.d.mts +24 -0
  7. package/dist/data-sources/DataAwareWidget.d.mts.map +1 -0
  8. package/dist/data-sources/DataAwareWidget.mjs +48 -0
  9. package/dist/data-sources/DataAwareWidget.mjs.map +1 -0
  10. package/dist/data-sources/ErrorState.cjs +20 -0
  11. package/dist/data-sources/ErrorState.cjs.map +1 -0
  12. package/dist/data-sources/ErrorState.d.cts +7 -0
  13. package/dist/data-sources/ErrorState.d.cts.map +1 -0
  14. package/dist/data-sources/ErrorState.d.mts +7 -0
  15. package/dist/data-sources/ErrorState.d.mts.map +1 -0
  16. package/dist/data-sources/ErrorState.mjs +18 -0
  17. package/dist/data-sources/ErrorState.mjs.map +1 -0
  18. package/dist/data-sources/context.cjs +24 -0
  19. package/dist/data-sources/context.cjs.map +1 -0
  20. package/dist/data-sources/context.d.cts +21 -0
  21. package/dist/data-sources/context.d.cts.map +1 -0
  22. package/dist/data-sources/context.d.mts +21 -0
  23. package/dist/data-sources/context.d.mts.map +1 -0
  24. package/dist/data-sources/context.mjs +21 -0
  25. package/dist/data-sources/context.mjs.map +1 -0
  26. package/dist/data-sources/fetchers/api.cjs +65 -0
  27. package/dist/data-sources/fetchers/api.cjs.map +1 -0
  28. package/dist/data-sources/fetchers/api.d.cts +10 -0
  29. package/dist/data-sources/fetchers/api.d.cts.map +1 -0
  30. package/dist/data-sources/fetchers/api.d.mts +10 -0
  31. package/dist/data-sources/fetchers/api.d.mts.map +1 -0
  32. package/dist/data-sources/fetchers/api.mjs +64 -0
  33. package/dist/data-sources/fetchers/api.mjs.map +1 -0
  34. package/dist/data-sources/fetchers/custom.cjs +108 -0
  35. package/dist/data-sources/fetchers/custom.cjs.map +1 -0
  36. package/dist/data-sources/fetchers/custom.d.cts +17 -0
  37. package/dist/data-sources/fetchers/custom.d.cts.map +1 -0
  38. package/dist/data-sources/fetchers/custom.d.mts +17 -0
  39. package/dist/data-sources/fetchers/custom.d.mts.map +1 -0
  40. package/dist/data-sources/fetchers/custom.mjs +107 -0
  41. package/dist/data-sources/fetchers/custom.mjs.map +1 -0
  42. package/dist/data-sources/fetchers/static.cjs +161 -0
  43. package/dist/data-sources/fetchers/static.cjs.map +1 -0
  44. package/dist/data-sources/fetchers/static.d.cts +40 -0
  45. package/dist/data-sources/fetchers/static.d.cts.map +1 -0
  46. package/dist/data-sources/fetchers/static.d.mts +40 -0
  47. package/dist/data-sources/fetchers/static.d.mts.map +1 -0
  48. package/dist/data-sources/fetchers/static.mjs +158 -0
  49. package/dist/data-sources/fetchers/static.mjs.map +1 -0
  50. package/dist/data-sources/preview-context.cjs +21 -0
  51. package/dist/data-sources/preview-context.cjs.map +1 -0
  52. package/dist/data-sources/preview-context.d.cts +13 -0
  53. package/dist/data-sources/preview-context.d.cts.map +1 -0
  54. package/dist/data-sources/preview-context.d.mts +13 -0
  55. package/dist/data-sources/preview-context.d.mts.map +1 -0
  56. package/dist/data-sources/preview-context.mjs +18 -0
  57. package/dist/data-sources/preview-context.mjs.map +1 -0
  58. package/dist/data-sources/registry-context.cjs +53 -0
  59. package/dist/data-sources/registry-context.cjs.map +1 -0
  60. package/dist/data-sources/registry-context.d.cts +48 -0
  61. package/dist/data-sources/registry-context.d.cts.map +1 -0
  62. package/dist/data-sources/registry-context.d.mts +48 -0
  63. package/dist/data-sources/registry-context.d.mts.map +1 -0
  64. package/dist/data-sources/registry-context.mjs +49 -0
  65. package/dist/data-sources/registry-context.mjs.map +1 -0
  66. package/dist/data-sources/registry.cjs +31 -0
  67. package/dist/data-sources/registry.cjs.map +1 -0
  68. package/dist/data-sources/registry.d.cts +19 -0
  69. package/dist/data-sources/registry.d.cts.map +1 -0
  70. package/dist/data-sources/registry.d.mts +19 -0
  71. package/dist/data-sources/registry.d.mts.map +1 -0
  72. package/dist/data-sources/registry.mjs +29 -0
  73. package/dist/data-sources/registry.mjs.map +1 -0
  74. package/dist/data-sources/transformers.cjs +154 -0
  75. package/dist/data-sources/transformers.cjs.map +1 -0
  76. package/dist/data-sources/transformers.d.cts +10 -0
  77. package/dist/data-sources/transformers.d.cts.map +1 -0
  78. package/dist/data-sources/transformers.d.mts +10 -0
  79. package/dist/data-sources/transformers.d.mts.map +1 -0
  80. package/dist/data-sources/transformers.mjs +153 -0
  81. package/dist/data-sources/transformers.mjs.map +1 -0
  82. package/dist/data-sources/types.cjs +0 -0
  83. package/dist/data-sources/types.d.cts +2 -0
  84. package/dist/data-sources/types.d.mts +2 -0
  85. package/dist/data-sources/types.mjs +1 -0
  86. package/dist/data-sources/use-widget-data.cjs +111 -0
  87. package/dist/data-sources/use-widget-data.cjs.map +1 -0
  88. package/dist/data-sources/use-widget-data.d.cts +17 -0
  89. package/dist/data-sources/use-widget-data.d.cts.map +1 -0
  90. package/dist/data-sources/use-widget-data.d.mts +17 -0
  91. package/dist/data-sources/use-widget-data.d.mts.map +1 -0
  92. package/dist/data-sources/use-widget-data.mjs +109 -0
  93. package/dist/data-sources/use-widget-data.mjs.map +1 -0
  94. package/dist/index-B5cTNde-.d.cts +246 -0
  95. package/dist/index-B5cTNde-.d.cts.map +1 -0
  96. package/dist/index-Cqt2JzkQ.d.mts +246 -0
  97. package/dist/index-Cqt2JzkQ.d.mts.map +1 -0
  98. package/dist/registries/index.cjs +243 -0
  99. package/dist/registries/index.cjs.map +1 -0
  100. package/dist/registries/index.d.cts +338 -0
  101. package/dist/registries/index.d.cts.map +1 -0
  102. package/dist/registries/index.d.mts +338 -0
  103. package/dist/registries/index.d.mts.map +1 -0
  104. package/dist/registries/index.mjs +229 -0
  105. package/dist/registries/index.mjs.map +1 -0
  106. package/dist/shell/AppShellLayout.cjs +49 -0
  107. package/dist/shell/AppShellLayout.cjs.map +1 -0
  108. package/dist/shell/AppShellLayout.d.cts +39 -0
  109. package/dist/shell/AppShellLayout.d.cts.map +1 -0
  110. package/dist/shell/AppShellLayout.d.mts +39 -0
  111. package/dist/shell/AppShellLayout.d.mts.map +1 -0
  112. package/dist/shell/AppShellLayout.mjs +46 -0
  113. package/dist/shell/AppShellLayout.mjs.map +1 -0
  114. package/dist/shell/ScreenHeader.cjs +44 -0
  115. package/dist/shell/ScreenHeader.cjs.map +1 -0
  116. package/dist/shell/ScreenHeader.d.cts +12 -0
  117. package/dist/shell/ScreenHeader.d.cts.map +1 -0
  118. package/dist/shell/ScreenHeader.d.mts +12 -0
  119. package/dist/shell/ScreenHeader.d.mts.map +1 -0
  120. package/dist/shell/ScreenHeader.mjs +42 -0
  121. package/dist/shell/ScreenHeader.mjs.map +1 -0
  122. package/dist/shell/ScreenHeaderContext.cjs +91 -0
  123. package/dist/shell/ScreenHeaderContext.cjs.map +1 -0
  124. package/dist/shell/ScreenHeaderContext.d.cts +35 -0
  125. package/dist/shell/ScreenHeaderContext.d.cts.map +1 -0
  126. package/dist/shell/ScreenHeaderContext.d.mts +35 -0
  127. package/dist/shell/ScreenHeaderContext.d.mts.map +1 -0
  128. package/dist/shell/ScreenHeaderContext.mjs +86 -0
  129. package/dist/shell/ScreenHeaderContext.mjs.map +1 -0
  130. package/dist/shell/ThemeModeContext.cjs +70 -0
  131. package/dist/shell/ThemeModeContext.cjs.map +1 -0
  132. package/dist/shell/ThemeModeContext.d.cts +33 -0
  133. package/dist/shell/ThemeModeContext.d.cts.map +1 -0
  134. package/dist/shell/ThemeModeContext.d.mts +33 -0
  135. package/dist/shell/ThemeModeContext.d.mts.map +1 -0
  136. package/dist/shell/ThemeModeContext.mjs +66 -0
  137. package/dist/shell/ThemeModeContext.mjs.map +1 -0
  138. package/dist/shell/index.cjs +43 -0
  139. package/dist/shell/index.d.cts +7 -0
  140. package/dist/shell/index.d.mts +7 -0
  141. package/dist/shell/index.mjs +7 -0
  142. package/dist/shell/sidebar.cjs +390 -0
  143. package/dist/shell/sidebar.cjs.map +1 -0
  144. package/dist/shell/sidebar.d.cts +85 -0
  145. package/dist/shell/sidebar.d.cts.map +1 -0
  146. package/dist/shell/sidebar.d.mts +85 -0
  147. package/dist/shell/sidebar.d.mts.map +1 -0
  148. package/dist/shell/sidebar.mjs +364 -0
  149. package/dist/shell/sidebar.mjs.map +1 -0
  150. package/dist/shell/use-mobile.cjs +51 -0
  151. package/dist/shell/use-mobile.cjs.map +1 -0
  152. package/dist/shell/use-mobile.d.cts +7 -0
  153. package/dist/shell/use-mobile.d.cts.map +1 -0
  154. package/dist/shell/use-mobile.d.mts +7 -0
  155. package/dist/shell/use-mobile.d.mts.map +1 -0
  156. package/dist/shell/use-mobile.mjs +47 -0
  157. package/dist/shell/use-mobile.mjs.map +1 -0
  158. package/dist/theme/index.cjs +758 -0
  159. package/dist/theme/index.cjs.map +1 -0
  160. package/dist/theme/index.d.cts +131 -0
  161. package/dist/theme/index.d.cts.map +1 -0
  162. package/dist/theme/index.d.mts +131 -0
  163. package/dist/theme/index.d.mts.map +1 -0
  164. package/dist/theme/index.mjs +728 -0
  165. package/dist/theme/index.mjs.map +1 -0
  166. package/dist/types/index.cjs +18 -0
  167. package/dist/types/index.d.cts +4 -0
  168. package/dist/types/index.d.mts +4 -0
  169. package/dist/types/index.mjs +2 -0
  170. package/dist/types-27AHMek-.d.cts +85 -0
  171. package/dist/types-27AHMek-.d.cts.map +1 -0
  172. package/dist/types-BXFX9bXp.cjs +303 -0
  173. package/dist/types-BXFX9bXp.cjs.map +1 -0
  174. package/dist/types-Bjmd7Fdx.mjs +208 -0
  175. package/dist/types-Bjmd7Fdx.mjs.map +1 -0
  176. package/dist/types-C5Zs5V3E.d.mts +155 -0
  177. package/dist/types-C5Zs5V3E.d.mts.map +1 -0
  178. package/dist/types-CeCPKvOv.d.mts +85 -0
  179. package/dist/types-CeCPKvOv.d.mts.map +1 -0
  180. package/dist/types-DrzvahW8.d.cts +155 -0
  181. package/dist/types-DrzvahW8.d.cts.map +1 -0
  182. package/dist/widget-schema-BKZgsNG7.d.mts +119 -0
  183. package/dist/widget-schema-BKZgsNG7.d.mts.map +1 -0
  184. package/dist/widget-schema-BSX2fVhW.d.cts +119 -0
  185. package/dist/widget-schema-BSX2fVhW.d.cts.map +1 -0
  186. package/dist/widget-utils/index.cjs +130 -0
  187. package/dist/widget-utils/index.cjs.map +1 -0
  188. package/dist/widget-utils/index.d.cts +47 -0
  189. package/dist/widget-utils/index.d.cts.map +1 -0
  190. package/dist/widget-utils/index.d.mts +47 -0
  191. package/dist/widget-utils/index.d.mts.map +1 -0
  192. package/dist/widget-utils/index.mjs +119 -0
  193. package/dist/widget-utils/index.mjs.map +1 -0
  194. package/package.json +200 -0
  195. package/src/styles/globals.css +1 -0
@@ -0,0 +1,338 @@
1
+ import { a as WidgetSchema, o as WidgetType } from "../widget-schema-BKZgsNG7.mjs";
2
+ import { c as BorderRadiusOptions, d as ColorOptions, h as GapOptions, l as ButtonSizeOptions, n as AlignOptions, p as FontSizeOptions, t as StrictOmit, x as SectionLayoutType, y as PaddingOptions } from "../index-Cqt2JzkQ.mjs";
3
+ import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
4
+
5
+ //#region src/registries/property-schema-types.d.ts
6
+ /**
7
+ * Tab configuration for organizing properties
8
+ */
9
+ interface TabConfig {
10
+ /** Unique identifier for the tab */
11
+ id: string;
12
+ /** Display label for the tab */
13
+ label: string;
14
+ }
15
+ /**
16
+ * Property field type constant - single source of truth for field types.
17
+ * Use PROPERTY_FIELD_TYPES.text instead of "text" for type-safe comparisons.
18
+ */
19
+ declare const PROPERTY_FIELD_TYPES: {
20
+ readonly text: "text";
21
+ readonly textarea: "textarea";
22
+ readonly number: "number";
23
+ readonly boolean: "boolean";
24
+ readonly select: "select";
25
+ readonly color: "color";
26
+ readonly range: "range";
27
+ readonly dataSource: "dataSource";
28
+ readonly resource: "resource";
29
+ readonly image: "image";
30
+ readonly alignment: "alignment";
31
+ readonly slider: "slider";
32
+ readonly colorPicker: "colorPicker";
33
+ readonly sectionHeader: "sectionHeader";
34
+ readonly separator: "separator";
35
+ readonly buttonGroup: "buttonGroup";
36
+ readonly colorSelect: "colorSelect";
37
+ readonly sectionLayoutSelect: "sectionLayoutSelect";
38
+ readonly background: "background";
39
+ readonly contentPosition: "contentPosition";
40
+ readonly textSizeSelect: "textSizeSelect";
41
+ readonly cssUnit: "cssUnit";
42
+ };
43
+ /**
44
+ * Union type of all property field types, derived from PROPERTY_FIELD_TYPES constant.
45
+ * @see deriving-typeof-for-object-keys pattern
46
+ */
47
+ type PropertyFieldType = (typeof PROPERTY_FIELD_TYPES)[keyof typeof PROPERTY_FIELD_TYPES];
48
+ /**
49
+ * Runtime validation for property field types.
50
+ * @param value - The value to check
51
+ * @returns true if value is a valid PropertyFieldType
52
+ */
53
+ declare function isPropertyFieldType(value: string): value is PropertyFieldType;
54
+ /**
55
+ * Base schema for a property field
56
+ */
57
+ interface PropertyFieldSchema {
58
+ /** Property key in the widget props */
59
+ key: string;
60
+ /** Display label for the field */
61
+ label: string;
62
+ /** Field type determines the input control */
63
+ type: PropertyFieldType;
64
+ /** Optional description/help text */
65
+ description?: string;
66
+ /** Optional default value */
67
+ defaultValue?: unknown;
68
+ /** Optional tab ID (must match a TabConfig id if widget has tabsConfig) */
69
+ tab?: string;
70
+ /** Optional group for organizing fields within a tab */
71
+ group?: string;
72
+ /**
73
+ * @deprecated Use requiresKeyValue instead
74
+ */
75
+ requiresKeyToBeTrue?: string;
76
+ /** Optional requires a specific key to have a specific value */
77
+ requiresKeyValue?: {
78
+ key: string;
79
+ value: unknown;
80
+ };
81
+ }
82
+ /**
83
+ * Text field schema
84
+ */
85
+ interface TextFieldSchema extends PropertyFieldSchema {
86
+ type: "text";
87
+ placeholder?: string;
88
+ maxLength?: number;
89
+ }
90
+ /**
91
+ * Textarea field schema
92
+ */
93
+ interface TextareaFieldSchema extends PropertyFieldSchema {
94
+ type: "textarea";
95
+ placeholder?: string;
96
+ rows?: number;
97
+ maxLength?: number;
98
+ }
99
+ /**
100
+ * Number field schema
101
+ */
102
+ interface NumberFieldSchema extends PropertyFieldSchema {
103
+ type: "number";
104
+ min?: number;
105
+ max?: number;
106
+ step?: number;
107
+ }
108
+ /**
109
+ * Boolean field schema
110
+ */
111
+ interface BooleanFieldSchema extends PropertyFieldSchema {
112
+ type: "boolean";
113
+ }
114
+ /**
115
+ * Select field schema with type-safe option values.
116
+ * Uses StrictOmit to ensure "defaultValue" key exists on PropertyFieldSchema.
117
+ */
118
+ interface SelectFieldSchema<T extends string | number = string | number> extends StrictOmit<PropertyFieldSchema, "defaultValue"> {
119
+ type: "select";
120
+ options: Array<{
121
+ label: string;
122
+ value: T;
123
+ }>;
124
+ defaultValue?: T;
125
+ }
126
+ /**
127
+ * Color field schema
128
+ */
129
+ interface ColorFieldSchema extends PropertyFieldSchema {
130
+ type: "color";
131
+ }
132
+ /**
133
+ * Range slider field schema
134
+ */
135
+ interface RangeFieldSchema extends PropertyFieldSchema {
136
+ type: "range";
137
+ min: number;
138
+ max: number;
139
+ step?: number;
140
+ }
141
+ /**
142
+ * Data source field schema for configuring widget data sources
143
+ */
144
+ interface DataSourceFieldSchema extends PropertyFieldSchema {
145
+ type: "dataSource";
146
+ }
147
+ /**
148
+ * Resource field schema for selecting a single resource from the selection modal
149
+ */
150
+ interface ResourceFieldSchema extends PropertyFieldSchema {
151
+ type: "resource";
152
+ /** Optional filter to specific shareable types */
153
+ allowedTypes?: string[];
154
+ }
155
+ /**
156
+ * Image field schema for selecting a single image from the image picker
157
+ */
158
+ interface ImageFieldSchema extends PropertyFieldSchema {
159
+ type: "image";
160
+ }
161
+ /**
162
+ * Alignment field schema
163
+ */
164
+ interface AlignmentFieldSchema extends PropertyFieldSchema {
165
+ type: "alignment";
166
+ options: {
167
+ verticalEnabled: boolean;
168
+ horizontalEnabled: boolean;
169
+ };
170
+ defaultValue?: AlignOptions;
171
+ }
172
+ /**
173
+ * Slider field schema with optional unit suffix (e.g., "rem", "px")
174
+ */
175
+ interface SliderFieldSchema extends PropertyFieldSchema {
176
+ type: "slider";
177
+ min: number;
178
+ max: number;
179
+ step?: number;
180
+ unit?: string;
181
+ }
182
+ /**
183
+ * Color picker field schema with optional swatches
184
+ */
185
+ interface ColorPickerFieldSchema extends PropertyFieldSchema {
186
+ type: "colorPicker";
187
+ swatches?: string[];
188
+ }
189
+ /**
190
+ * Section header field schema for visual grouping
191
+ */
192
+ interface SectionHeaderFieldSchema extends PropertyFieldSchema {
193
+ type: "sectionHeader";
194
+ subtitle?: string;
195
+ }
196
+ /**
197
+ * Separator field schema for visual separation
198
+ */
199
+ interface SeparatorFieldSchema extends PropertyFieldSchema {
200
+ type: "separator";
201
+ }
202
+ /**
203
+ * Button group field schema.
204
+ * Uses StrictOmit to ensure "defaultValue" key exists on PropertyFieldSchema.
205
+ */
206
+ interface ButtonGroupFieldSchema<T extends string | number = string | number> extends StrictOmit<PropertyFieldSchema, "defaultValue"> {
207
+ type: "buttonGroup";
208
+ options: Array<{
209
+ label?: string;
210
+ icon?: IconDefinition;
211
+ value: T;
212
+ }>;
213
+ defaultValue?: T;
214
+ }
215
+ /**
216
+ * Color select field schema
217
+ */
218
+ interface ColorSelectFieldSchema extends PropertyFieldSchema {
219
+ type: "colorSelect";
220
+ defaultValue?: ColorOptions;
221
+ }
222
+ /**
223
+ * Section layout select field schema for visual masonry layout selector
224
+ */
225
+ interface SectionLayoutSelectFieldSchema extends PropertyFieldSchema {
226
+ type: "sectionLayoutSelect";
227
+ defaultValue?: SectionLayoutType;
228
+ }
229
+ /**
230
+ * Background field combines resource selection and color properties.
231
+ * Uses StrictOmit to exclude conflicting "type" discriminant from parents.
232
+ */
233
+ interface BackgroundFieldSchema extends StrictOmit<ResourceFieldSchema, "type">, StrictOmit<ColorFieldSchema, "type"> {
234
+ type: "background";
235
+ }
236
+ /**
237
+ * Content position field schema for 3x3 grid position picker
238
+ */
239
+ interface ContentPositionFieldSchema extends PropertyFieldSchema {
240
+ type: "contentPosition";
241
+ defaultValue?: string;
242
+ }
243
+ /**
244
+ * Text size select field schema for visual font size selector
245
+ */
246
+ interface TextSizeSelectFieldSchema extends PropertyFieldSchema {
247
+ type: "textSizeSelect";
248
+ defaultValue?: FontSizeOptions;
249
+ }
250
+ /**
251
+ * CSS unit type for height/width fields
252
+ */
253
+ type CssUnit = "px" | "rem" | "vh";
254
+ /**
255
+ * CSS unit field schema for numeric values with selectable units (px, rem, vh)
256
+ */
257
+ interface CssUnitFieldSchema extends PropertyFieldSchema {
258
+ type: "cssUnit";
259
+ min?: number;
260
+ max?: number;
261
+ step?: number;
262
+ allowedUnits?: CssUnit[];
263
+ defaultUnit?: CssUnit;
264
+ }
265
+ /**
266
+ * Union of all field schema types
267
+ */
268
+ type PropertyField = TextFieldSchema | TextareaFieldSchema | NumberFieldSchema | BooleanFieldSchema | SelectFieldSchema<string | number> | ColorFieldSchema | RangeFieldSchema | DataSourceFieldSchema | ResourceFieldSchema | ImageFieldSchema | AlignmentFieldSchema | SliderFieldSchema | ColorPickerFieldSchema | SectionHeaderFieldSchema | SeparatorFieldSchema | ButtonGroupFieldSchema<string | number> | ColorSelectFieldSchema | SectionLayoutSelectFieldSchema | BackgroundFieldSchema | ContentPositionFieldSchema | TextSizeSelectFieldSchema | CssUnitFieldSchema;
269
+ /**
270
+ * Schema for per-item configuration in custom data sources.
271
+ * Widgets can define this to allow users to configure widget-specific
272
+ * settings for each selected item (e.g., title, description, button).
273
+ */
274
+ interface ItemConfigSchema {
275
+ /** Fields available for per-item configuration */
276
+ fields: PropertyField[];
277
+ /** Optional description shown at top of item config panel */
278
+ description?: string;
279
+ }
280
+ /**
281
+ * Schema for a widget's editable properties
282
+ */
283
+ interface WidgetPropertySchema {
284
+ /** Widget type this schema applies to */
285
+ widgetType: WidgetType;
286
+ /** Display name for the widget */
287
+ displayName: string;
288
+ /** Optional tab configuration - if present, tabs are enabled */
289
+ tabsConfig?: TabConfig[];
290
+ /** Editable property fields */
291
+ fields: PropertyField[];
292
+ /** Optional custom validator function */
293
+ validate?: (props: Record<string, unknown>) => string | null;
294
+ /** Props that can be populated from data sources */
295
+ dataSourceTargetProps?: string[];
296
+ /** Optional schema for per-item configurations in custom data sources */
297
+ itemConfigSchema?: ItemConfigSchema;
298
+ }
299
+ /**
300
+ * Registry mapping widget types to their property schemas
301
+ */
302
+ type PropertySchemaRegistry = Record<WidgetType, WidgetPropertySchema>;
303
+ /**
304
+ * Group property fields by their group property
305
+ */
306
+ declare function groupPropertyFields(fields: readonly PropertyField[]): Record<string, PropertyField[]>;
307
+ /**
308
+ * Extract current values from widget props based on property fields
309
+ */
310
+ declare function extractPropertyValues(widget: Readonly<WidgetSchema>, fields: readonly PropertyField[]): Record<string, unknown>;
311
+ /**
312
+ * Apply property values to widget props
313
+ */
314
+ declare function applyPropertyValues(widget: Readonly<WidgetSchema>, values: Readonly<Record<string, unknown>>): WidgetSchema;
315
+ //#endregion
316
+ //#region src/registries/field-helpers.d.ts
317
+ declare const getColorField: (props: Readonly<Omit<ColorSelectFieldSchema, "type">>) => ColorSelectFieldSchema;
318
+ declare const getBorderRadiusField: (props: Readonly<Omit<ButtonGroupFieldSchema<BorderRadiusOptions>, "options" | "type">>) => ButtonGroupFieldSchema<BorderRadiusOptions>;
319
+ declare const getPaddingField: (props: Readonly<Omit<ButtonGroupFieldSchema<PaddingOptions>, "options" | "type">>) => ButtonGroupFieldSchema<PaddingOptions>;
320
+ declare const getButtonSizeField: (props: Readonly<Omit<ButtonGroupFieldSchema<ButtonSizeOptions>, "options" | "type">>) => ButtonGroupFieldSchema<ButtonSizeOptions>;
321
+ declare const getFontSizeField: (props: Readonly<Omit<TextSizeSelectFieldSchema, "type">>) => TextSizeSelectFieldSchema;
322
+ declare const getGapField: (props: Readonly<Omit<ButtonGroupFieldSchema<GapOptions>, "options" | "type">>) => ButtonGroupFieldSchema<GapOptions>;
323
+ declare const getHeightField: (props: Readonly<Omit<CssUnitFieldSchema, "type">>) => CssUnitFieldSchema;
324
+ /**
325
+ * Gap value mapping - use `as const satisfies` for compile-time validation
326
+ * with literal type preservation.
327
+ */
328
+ declare const gapValues: {
329
+ readonly none: 0;
330
+ readonly xs: 1;
331
+ readonly sm: 2;
332
+ readonly md: 4;
333
+ readonly lg: 6;
334
+ readonly xl: 8;
335
+ };
336
+ //#endregion
337
+ export { type AlignmentFieldSchema, type BackgroundFieldSchema, type BooleanFieldSchema, type ButtonGroupFieldSchema, type ColorFieldSchema, type ColorPickerFieldSchema, type ColorSelectFieldSchema, type ContentPositionFieldSchema, type CssUnit, type CssUnitFieldSchema, type DataSourceFieldSchema, type ImageFieldSchema, type ItemConfigSchema, type NumberFieldSchema, PROPERTY_FIELD_TYPES, type PropertyField, type PropertyFieldSchema, type PropertyFieldType, type PropertySchemaRegistry, type RangeFieldSchema, type ResourceFieldSchema, type SectionHeaderFieldSchema, type SectionLayoutSelectFieldSchema, type SelectFieldSchema, type SeparatorFieldSchema, type SliderFieldSchema, type TabConfig, type TextFieldSchema, type TextSizeSelectFieldSchema, type TextareaFieldSchema, type WidgetPropertySchema, applyPropertyValues, extractPropertyValues, gapValues, getBorderRadiusField, getButtonSizeField, getColorField, getFontSizeField, getGapField, getHeightField, getPaddingField, groupPropertyFields, isPropertyFieldType };
338
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/registries/property-schema-types.ts","../../src/registries/field-helpers.ts"],"mappings":";;;;;;;;UAciB,SAAA;EAAjB;EAEE,EAAA;;EAEA,KAAA;AAAA;AAWF;;;;AAAA,cAAa,oBAAA;EAAA,SACX,IAAA;EAAA,SACA,QAAA;EAAA,SACA,MAAA;EAAA,SACA,OAAA;EAAA,SACA,MAAA;EAAA,SACA,KAAA;EAAA,SACA,KAAA;EA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,IAAA,CAAK,sBAAA,CAAuB,iBAAA,4BAE7B,sBAAA,CAAuB,iBAAA;AAAA,cAab,gBAAA,GACX,KAAA,EAAO,QAAA,CAAS,IAAA,CAAK,yBAAA,eACpB,yBAAA;AAAA,cAOU,WAAA,GACX,KAAA,EAAO,QAAA,CAAS,IAAA,CAAK,sBAAA,CAAuB,UAAA,4BAC3C,sBAAA,CAAuB,UAAA;AAAA,cAeb,cAAA,GACX,KAAA,EAAO,QAAA,CAAS,IAAA,CAAK,kBAAA,eACpB,kBAAA;;;AD7EH;;cCwFa,SAAA;EAAA,SACF,IAAA;EAAA,SACA,EAAA;EAAA,SACA,EAAA;EAAA,SACA,EAAA;EAAA,SACA,EAAA;EAAA,SACA,EAAA;AAAA"}
@@ -0,0 +1,229 @@
1
+ import { faBan } from "@fortawesome/pro-regular-svg-icons";
2
+ //#region src/registries/property-schema-types.ts
3
+ /**
4
+ * Property field type constant - single source of truth for field types.
5
+ * Use PROPERTY_FIELD_TYPES.text instead of "text" for type-safe comparisons.
6
+ */
7
+ const PROPERTY_FIELD_TYPES = {
8
+ text: "text",
9
+ textarea: "textarea",
10
+ number: "number",
11
+ boolean: "boolean",
12
+ select: "select",
13
+ color: "color",
14
+ range: "range",
15
+ dataSource: "dataSource",
16
+ resource: "resource",
17
+ image: "image",
18
+ alignment: "alignment",
19
+ slider: "slider",
20
+ colorPicker: "colorPicker",
21
+ sectionHeader: "sectionHeader",
22
+ separator: "separator",
23
+ buttonGroup: "buttonGroup",
24
+ colorSelect: "colorSelect",
25
+ sectionLayoutSelect: "sectionLayoutSelect",
26
+ background: "background",
27
+ contentPosition: "contentPosition",
28
+ textSizeSelect: "textSizeSelect",
29
+ cssUnit: "cssUnit"
30
+ };
31
+ /**
32
+ * Runtime validation for property field types.
33
+ * @param value - The value to check
34
+ * @returns true if value is a valid PropertyFieldType
35
+ */
36
+ function isPropertyFieldType(value) {
37
+ return Object.values(PROPERTY_FIELD_TYPES).includes(value);
38
+ }
39
+ /**
40
+ * Group property fields by their group property
41
+ */
42
+ function groupPropertyFields(fields) {
43
+ const grouped = {};
44
+ fields.forEach((field) => {
45
+ const group = field.group || "General";
46
+ if (!grouped[group]) grouped[group] = [];
47
+ grouped[group].push(field);
48
+ });
49
+ return grouped;
50
+ }
51
+ /**
52
+ * Extract current values from widget props based on property fields
53
+ */
54
+ function extractPropertyValues(widget, fields) {
55
+ const values = {};
56
+ fields.forEach((field) => {
57
+ const value = widget.props[field.key];
58
+ values[field.key] = value !== void 0 ? value : field.defaultValue;
59
+ });
60
+ return values;
61
+ }
62
+ /**
63
+ * Apply property values to widget props
64
+ */
65
+ function applyPropertyValues(widget, values) {
66
+ return {
67
+ ...widget,
68
+ props: {
69
+ ...widget.props,
70
+ ...values
71
+ }
72
+ };
73
+ }
74
+ //#endregion
75
+ //#region src/registries/field-helpers.ts
76
+ const getColorField = (props) => {
77
+ return {
78
+ ...props,
79
+ type: "colorSelect"
80
+ };
81
+ };
82
+ const getBorderRadiusField = (props) => {
83
+ return {
84
+ ...props,
85
+ type: "buttonGroup",
86
+ options: [
87
+ {
88
+ icon: faBan,
89
+ value: "none"
90
+ },
91
+ {
92
+ label: "SM",
93
+ value: "sm"
94
+ },
95
+ {
96
+ label: "MD",
97
+ value: "md"
98
+ },
99
+ {
100
+ label: "LG",
101
+ value: "lg"
102
+ },
103
+ {
104
+ label: "XL",
105
+ value: "xl"
106
+ },
107
+ {
108
+ label: "FULL",
109
+ value: "full"
110
+ }
111
+ ]
112
+ };
113
+ };
114
+ const getPaddingField = (props) => {
115
+ return {
116
+ ...props,
117
+ type: "buttonGroup",
118
+ options: [
119
+ {
120
+ icon: faBan,
121
+ value: 0
122
+ },
123
+ {
124
+ label: "SM",
125
+ value: 2
126
+ },
127
+ {
128
+ label: "MD",
129
+ value: 4
130
+ },
131
+ {
132
+ label: "LG",
133
+ value: 6
134
+ },
135
+ {
136
+ label: "XL",
137
+ value: 8
138
+ },
139
+ {
140
+ label: "FULL",
141
+ value: 10
142
+ }
143
+ ]
144
+ };
145
+ };
146
+ const getButtonSizeField = (props) => {
147
+ return {
148
+ ...props,
149
+ type: "buttonGroup",
150
+ options: [
151
+ {
152
+ label: "SM",
153
+ value: "sm"
154
+ },
155
+ {
156
+ label: "MD",
157
+ value: "default"
158
+ },
159
+ {
160
+ label: "LG",
161
+ value: "lg"
162
+ },
163
+ {
164
+ label: "XL",
165
+ value: "xl"
166
+ }
167
+ ]
168
+ };
169
+ };
170
+ const getFontSizeField = (props) => {
171
+ return {
172
+ ...props,
173
+ type: "textSizeSelect"
174
+ };
175
+ };
176
+ const getGapField = (props) => {
177
+ return {
178
+ ...props,
179
+ type: "buttonGroup",
180
+ options: [
181
+ {
182
+ icon: faBan,
183
+ value: "none"
184
+ },
185
+ {
186
+ label: "XS",
187
+ value: "xs"
188
+ },
189
+ {
190
+ label: "SM",
191
+ value: "sm"
192
+ },
193
+ {
194
+ label: "MD",
195
+ value: "md"
196
+ },
197
+ {
198
+ label: "LG",
199
+ value: "lg"
200
+ },
201
+ {
202
+ label: "XL",
203
+ value: "xl"
204
+ }
205
+ ]
206
+ };
207
+ };
208
+ const getHeightField = (props) => {
209
+ return {
210
+ ...props,
211
+ type: "cssUnit"
212
+ };
213
+ };
214
+ /**
215
+ * Gap value mapping - use `as const satisfies` for compile-time validation
216
+ * with literal type preservation.
217
+ */
218
+ const gapValues = {
219
+ none: 0,
220
+ xs: 1,
221
+ sm: 2,
222
+ md: 4,
223
+ lg: 6,
224
+ xl: 8
225
+ };
226
+ //#endregion
227
+ export { PROPERTY_FIELD_TYPES, applyPropertyValues, extractPropertyValues, gapValues, getBorderRadiusField, getButtonSizeField, getColorField, getFontSizeField, getGapField, getHeightField, getPaddingField, groupPropertyFields, isPropertyFieldType };
228
+
229
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/registries/property-schema-types.ts","../../src/registries/field-helpers.ts"],"sourcesContent":["import type { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\nimport type {\n WidgetType,\n WidgetSchema,\n AlignOptions,\n ColorOptions,\n FontSizeOptions,\n SectionLayoutType,\n StrictOmit,\n} from \"../types\";\n\n/**\n * Tab configuration for organizing properties\n */\nexport interface TabConfig {\n /** Unique identifier for the tab */\n id: string;\n /** Display label for the tab */\n label: string;\n}\n\n// ============================================================================\n// Property Field Types - Derive from constant for single source of truth\n// ============================================================================\n\n/**\n * Property field type constant - single source of truth for field types.\n * Use PROPERTY_FIELD_TYPES.text instead of \"text\" for type-safe comparisons.\n */\nexport const PROPERTY_FIELD_TYPES = {\n text: \"text\",\n textarea: \"textarea\",\n number: \"number\",\n boolean: \"boolean\",\n select: \"select\",\n color: \"color\",\n range: \"range\",\n dataSource: \"dataSource\",\n resource: \"resource\",\n image: \"image\",\n alignment: \"alignment\",\n slider: \"slider\",\n colorPicker: \"colorPicker\",\n sectionHeader: \"sectionHeader\",\n separator: \"separator\",\n buttonGroup: \"buttonGroup\",\n colorSelect: \"colorSelect\",\n sectionLayoutSelect: \"sectionLayoutSelect\",\n background: \"background\",\n contentPosition: \"contentPosition\",\n textSizeSelect: \"textSizeSelect\",\n cssUnit: \"cssUnit\",\n} as const;\n\n/**\n * Union type of all property field types, derived from PROPERTY_FIELD_TYPES constant.\n * @see deriving-typeof-for-object-keys pattern\n */\nexport type PropertyFieldType =\n (typeof PROPERTY_FIELD_TYPES)[keyof typeof PROPERTY_FIELD_TYPES];\n\n/**\n * Runtime validation for property field types.\n * @param value - The value to check\n * @returns true if value is a valid PropertyFieldType\n */\nexport function isPropertyFieldType(value: string): value is PropertyFieldType {\n return Object.values(PROPERTY_FIELD_TYPES).includes(\n value as PropertyFieldType,\n );\n}\n\n/**\n * Base schema for a property field\n */\nexport interface PropertyFieldSchema {\n /** Property key in the widget props */\n key: string;\n /** Display label for the field */\n label: string;\n /** Field type determines the input control */\n type: PropertyFieldType;\n /** Optional description/help text */\n description?: string;\n /** Optional default value */\n defaultValue?: unknown;\n /** Optional tab ID (must match a TabConfig id if widget has tabsConfig) */\n tab?: string;\n /** Optional group for organizing fields within a tab */\n group?: string;\n /**\n * @deprecated Use requiresKeyValue instead\n */\n requiresKeyToBeTrue?: string;\n /** Optional requires a specific key to have a specific value */\n requiresKeyValue?: { key: string; value: unknown };\n}\n\n/**\n * Text field schema\n */\nexport interface TextFieldSchema extends PropertyFieldSchema {\n type: \"text\";\n placeholder?: string;\n maxLength?: number;\n}\n\n/**\n * Textarea field schema\n */\nexport interface TextareaFieldSchema extends PropertyFieldSchema {\n type: \"textarea\";\n placeholder?: string;\n rows?: number;\n maxLength?: number;\n}\n\n/**\n * Number field schema\n */\nexport interface NumberFieldSchema extends PropertyFieldSchema {\n type: \"number\";\n min?: number;\n max?: number;\n step?: number;\n}\n\n/**\n * Boolean field schema\n */\nexport interface BooleanFieldSchema extends PropertyFieldSchema {\n type: \"boolean\";\n}\n\n/**\n * Select field schema with type-safe option values.\n * Uses StrictOmit to ensure \"defaultValue\" key exists on PropertyFieldSchema.\n */\nexport interface SelectFieldSchema<\n T extends string | number = string | number,\n> extends StrictOmit<PropertyFieldSchema, \"defaultValue\"> {\n type: \"select\";\n options: Array<{ label: string; value: T }>;\n defaultValue?: T;\n}\n\n/**\n * Color field schema\n */\nexport interface ColorFieldSchema extends PropertyFieldSchema {\n type: \"color\";\n}\n\n/**\n * Range slider field schema\n */\nexport interface RangeFieldSchema extends PropertyFieldSchema {\n type: \"range\";\n min: number;\n max: number;\n step?: number;\n}\n\n/**\n * Data source field schema for configuring widget data sources\n */\nexport interface DataSourceFieldSchema extends PropertyFieldSchema {\n type: \"dataSource\";\n}\n\n/**\n * Resource field schema for selecting a single resource from the selection modal\n */\nexport interface ResourceFieldSchema extends PropertyFieldSchema {\n type: \"resource\";\n /** Optional filter to specific shareable types */\n allowedTypes?: string[];\n}\n\n/**\n * Image field schema for selecting a single image from the image picker\n */\nexport interface ImageFieldSchema extends PropertyFieldSchema {\n type: \"image\";\n}\n\n/**\n * Alignment field schema\n */\nexport interface AlignmentFieldSchema extends PropertyFieldSchema {\n type: \"alignment\";\n options: {\n verticalEnabled: boolean;\n horizontalEnabled: boolean;\n };\n defaultValue?: AlignOptions;\n}\n\n/**\n * Slider field schema with optional unit suffix (e.g., \"rem\", \"px\")\n */\nexport interface SliderFieldSchema extends PropertyFieldSchema {\n type: \"slider\";\n min: number;\n max: number;\n step?: number;\n unit?: string;\n}\n\n/**\n * Color picker field schema with optional swatches\n */\nexport interface ColorPickerFieldSchema extends PropertyFieldSchema {\n type: \"colorPicker\";\n swatches?: string[];\n}\n\n/**\n * Section header field schema for visual grouping\n */\nexport interface SectionHeaderFieldSchema extends PropertyFieldSchema {\n type: \"sectionHeader\";\n subtitle?: string;\n}\n\n/**\n * Separator field schema for visual separation\n */\nexport interface SeparatorFieldSchema extends PropertyFieldSchema {\n type: \"separator\";\n}\n\n/**\n * Button group field schema.\n * Uses StrictOmit to ensure \"defaultValue\" key exists on PropertyFieldSchema.\n */\nexport interface ButtonGroupFieldSchema<\n T extends string | number = string | number,\n> extends StrictOmit<PropertyFieldSchema, \"defaultValue\"> {\n type: \"buttonGroup\";\n options: Array<{ label?: string; icon?: IconDefinition; value: T }>;\n defaultValue?: T;\n}\n\n/**\n * Color select field schema\n */\nexport interface ColorSelectFieldSchema extends PropertyFieldSchema {\n type: \"colorSelect\";\n defaultValue?: ColorOptions;\n}\n\n/**\n * Section layout select field schema for visual masonry layout selector\n */\nexport interface SectionLayoutSelectFieldSchema extends PropertyFieldSchema {\n type: \"sectionLayoutSelect\";\n defaultValue?: SectionLayoutType;\n}\n\n/**\n * Background field combines resource selection and color properties.\n * Uses StrictOmit to exclude conflicting \"type\" discriminant from parents.\n */\nexport interface BackgroundFieldSchema\n extends\n StrictOmit<ResourceFieldSchema, \"type\">,\n StrictOmit<ColorFieldSchema, \"type\"> {\n type: \"background\";\n}\n\n/**\n * Content position field schema for 3x3 grid position picker\n */\nexport interface ContentPositionFieldSchema extends PropertyFieldSchema {\n type: \"contentPosition\";\n defaultValue?: string;\n}\n\n/**\n * Text size select field schema for visual font size selector\n */\nexport interface TextSizeSelectFieldSchema extends PropertyFieldSchema {\n type: \"textSizeSelect\";\n defaultValue?: FontSizeOptions;\n}\n\n/**\n * CSS unit type for height/width fields\n */\nexport type CssUnit = \"px\" | \"rem\" | \"vh\";\n\n/**\n * CSS unit field schema for numeric values with selectable units (px, rem, vh)\n */\nexport interface CssUnitFieldSchema extends PropertyFieldSchema {\n type: \"cssUnit\";\n min?: number;\n max?: number;\n step?: number;\n allowedUnits?: CssUnit[];\n defaultUnit?: CssUnit;\n}\n\n/**\n * Union of all field schema types\n */\nexport type PropertyField =\n | TextFieldSchema\n | TextareaFieldSchema\n | NumberFieldSchema\n | BooleanFieldSchema\n | SelectFieldSchema<string | number>\n | ColorFieldSchema\n | RangeFieldSchema\n | DataSourceFieldSchema\n | ResourceFieldSchema\n | ImageFieldSchema\n | AlignmentFieldSchema\n | SliderFieldSchema\n | ColorPickerFieldSchema\n | SectionHeaderFieldSchema\n | SeparatorFieldSchema\n | ButtonGroupFieldSchema<string | number>\n | ColorSelectFieldSchema\n | SectionLayoutSelectFieldSchema\n | BackgroundFieldSchema\n | ContentPositionFieldSchema\n | TextSizeSelectFieldSchema\n | CssUnitFieldSchema;\n\n/**\n * Schema for per-item configuration in custom data sources.\n * Widgets can define this to allow users to configure widget-specific\n * settings for each selected item (e.g., title, description, button).\n */\nexport interface ItemConfigSchema {\n /** Fields available for per-item configuration */\n fields: PropertyField[];\n /** Optional description shown at top of item config panel */\n description?: string;\n}\n\n/**\n * Schema for a widget's editable properties\n */\nexport interface WidgetPropertySchema {\n /** Widget type this schema applies to */\n widgetType: WidgetType;\n /** Display name for the widget */\n displayName: string;\n /** Optional tab configuration - if present, tabs are enabled */\n tabsConfig?: TabConfig[];\n /** Editable property fields */\n fields: PropertyField[];\n /** Optional custom validator function */\n validate?: (props: Record<string, unknown>) => string | null;\n /** Props that can be populated from data sources */\n dataSourceTargetProps?: string[];\n /** Optional schema for per-item configurations in custom data sources */\n itemConfigSchema?: ItemConfigSchema;\n}\n\n/**\n * Registry mapping widget types to their property schemas\n */\nexport type PropertySchemaRegistry = Record<WidgetType, WidgetPropertySchema>;\n\n/**\n * Group property fields by their group property\n */\nexport function groupPropertyFields(\n fields: readonly PropertyField[],\n): Record<string, PropertyField[]> {\n const grouped: Record<string, PropertyField[]> = {};\n\n fields.forEach((field) => {\n const group = field.group || \"General\";\n if (!grouped[group]) {\n grouped[group] = [];\n }\n grouped[group].push(field);\n });\n\n return grouped;\n}\n\n/**\n * Extract current values from widget props based on property fields\n */\nexport function extractPropertyValues(\n widget: Readonly<WidgetSchema>,\n fields: readonly PropertyField[],\n): Record<string, unknown> {\n const values: Record<string, unknown> = {};\n\n fields.forEach((field) => {\n const value = widget.props[field.key];\n values[field.key] = value !== undefined ? value : field.defaultValue;\n });\n\n return values;\n}\n\n/**\n * Apply property values to widget props\n */\nexport function applyPropertyValues(\n widget: Readonly<WidgetSchema>,\n values: Readonly<Record<string, unknown>>,\n): WidgetSchema {\n return {\n ...widget,\n props: {\n ...widget.props,\n ...values,\n },\n };\n}\n","import type {\n ButtonGroupFieldSchema,\n ColorSelectFieldSchema,\n CssUnitFieldSchema,\n TextSizeSelectFieldSchema,\n} from \"./property-schema-types\";\nimport type {\n BorderRadiusOptions,\n PaddingOptions,\n ButtonSizeOptions,\n GapOptions,\n} from \"../types\";\nimport { faBan } from \"@fortawesome/pro-regular-svg-icons\";\n\nexport const getColorField = (\n props: Readonly<Omit<ColorSelectFieldSchema, \"type\">>,\n): ColorSelectFieldSchema => {\n return {\n ...props,\n type: \"colorSelect\",\n };\n};\n\nexport const getBorderRadiusField = (\n props: Readonly<\n Omit<ButtonGroupFieldSchema<BorderRadiusOptions>, \"options\" | \"type\">\n >,\n): ButtonGroupFieldSchema<BorderRadiusOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { icon: faBan, value: \"none\" },\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"md\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n { label: \"FULL\", value: \"full\" },\n ],\n };\n};\n\nexport const getPaddingField = (\n props: Readonly<\n Omit<ButtonGroupFieldSchema<PaddingOptions>, \"options\" | \"type\">\n >,\n): ButtonGroupFieldSchema<PaddingOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { icon: faBan, value: 0 },\n { label: \"SM\", value: 2 },\n { label: \"MD\", value: 4 },\n { label: \"LG\", value: 6 },\n { label: \"XL\", value: 8 },\n { label: \"FULL\", value: 10 },\n ],\n };\n};\n\nexport const getButtonSizeField = (\n props: Readonly<\n Omit<ButtonGroupFieldSchema<ButtonSizeOptions>, \"options\" | \"type\">\n >,\n): ButtonGroupFieldSchema<ButtonSizeOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"default\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n ],\n };\n};\n\nexport const getFontSizeField = (\n props: Readonly<Omit<TextSizeSelectFieldSchema, \"type\">>,\n): TextSizeSelectFieldSchema => {\n return {\n ...props,\n type: \"textSizeSelect\",\n };\n};\n\nexport const getGapField = (\n props: Readonly<Omit<ButtonGroupFieldSchema<GapOptions>, \"options\" | \"type\">>,\n): ButtonGroupFieldSchema<GapOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { icon: faBan, value: \"none\" },\n { label: \"XS\", value: \"xs\" },\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"md\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n ],\n };\n};\n\nexport const getHeightField = (\n props: Readonly<Omit<CssUnitFieldSchema, \"type\">>,\n): CssUnitFieldSchema => {\n return {\n ...props,\n type: \"cssUnit\",\n };\n};\n\n/**\n * Gap value mapping - use `as const satisfies` for compile-time validation\n * with literal type preservation.\n */\nexport const gapValues: {\n readonly none: 0;\n readonly xs: 1;\n readonly sm: 2;\n readonly md: 4;\n readonly lg: 6;\n readonly xl: 8;\n} = {\n none: 0,\n xs: 1,\n sm: 2,\n md: 4,\n lg: 6,\n xl: 8,\n} as const satisfies Record<GapOptions, number>;\n"],"mappings":";;;;;;AA6BA,MAAa,uBAAuB;CAClC,MAAM;CACN,UAAU;CACV,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,OAAO;CACP,OAAO;CACP,YAAY;CACZ,UAAU;CACV,OAAO;CACP,WAAW;CACX,QAAQ;CACR,aAAa;CACb,eAAe;CACf,WAAW;CACX,aAAa;CACb,aAAa;CACb,qBAAqB;CACrB,YAAY;CACZ,iBAAiB;CACjB,gBAAgB;CAChB,SAAS;CACV;;;;;;AAcD,SAAgB,oBAAoB,OAA2C;AAC7E,QAAO,OAAO,OAAO,qBAAqB,CAAC,SACzC,MACD;;;;;AA8SH,SAAgB,oBACd,QACiC;CACjC,MAAM,UAA2C,EAAE;AAEnD,QAAO,SAAS,UAAU;EACxB,MAAM,QAAQ,MAAM,SAAS;AAC7B,MAAI,CAAC,QAAQ,OACX,SAAQ,SAAS,EAAE;AAErB,UAAQ,OAAO,KAAK,MAAM;GAC1B;AAEF,QAAO;;;;;AAMT,SAAgB,sBACd,QACA,QACyB;CACzB,MAAM,SAAkC,EAAE;AAE1C,QAAO,SAAS,UAAU;EACxB,MAAM,QAAQ,OAAO,MAAM,MAAM;AACjC,SAAO,MAAM,OAAO,UAAU,KAAA,IAAY,QAAQ,MAAM;GACxD;AAEF,QAAO;;;;;AAMT,SAAgB,oBACd,QACA,QACc;AACd,QAAO;EACL,GAAG;EACH,OAAO;GACL,GAAG,OAAO;GACV,GAAG;GACJ;EACF;;;;ACnZH,MAAa,iBACX,UAC2B;AAC3B,QAAO;EACL,GAAG;EACH,MAAM;EACP;;AAGH,MAAa,wBACX,UAGgD;AAChD,QAAO;EACL,GAAG;EACH,MAAM;EACN,SAAS;GACP;IAAE,MA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CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACL"}
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const require_chunk = require("../chunk-CKQMccvm.cjs");
4
+ const require_shell_sidebar = require("./sidebar.cjs");
5
+ let react = require("react");
6
+ react = require_chunk.__toESM(react);
7
+ let react_jsx_runtime = require("react/jsx-runtime");
8
+ //#region src/shell/AppShellLayout.tsx
9
+ /**
10
+ * Pure visual frame that replicates the RepApp layout:
11
+ * - 13rem collapsible sidebar
12
+ * - 52px header area
13
+ * - rounded-xl bg-background shadow-lg content area with bg-muted gutters
14
+ *
15
+ * This component handles zero business logic — it simply provides the visual shell.
16
+ */
17
+ function AppShellLayout({ sidebarContent, headerContent, children, sidebarHeader, sidebarFooter, afterContent, useBottomNav = false }) {
18
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_shell_sidebar.SidebarProvider, {
19
+ useBottomNav,
20
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21
+ className: "bg-muted relative flex max-h-dvh w-full overflow-hidden",
22
+ children: [
23
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_shell_sidebar.Sidebar, { children: [
24
+ sidebarHeader && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_shell_sidebar.SidebarHeader, { children: sidebarHeader }),
25
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_shell_sidebar.SidebarContent, {
26
+ className: "p-4",
27
+ children: sidebarContent
28
+ }),
29
+ sidebarFooter && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_shell_sidebar.SidebarFooter, { children: sidebarFooter })
30
+ ] }),
31
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_shell_sidebar.SidebarInset, {
32
+ className: "flex flex-1 flex-col overflow-hidden",
33
+ children: [headerContent, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
34
+ className: `bg-muted flex-1 overflow-hidden md:pr-4 md:pb-4 ${useBottomNav ? "max-md:pb-[calc(4rem+env(safe-area-inset-bottom))]" : ""}`,
35
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
36
+ className: "scrollbar-none bg-background text-foreground h-full overflow-auto rounded-xl shadow-lg",
37
+ children
38
+ })
39
+ })]
40
+ }),
41
+ afterContent
42
+ ]
43
+ })
44
+ });
45
+ }
46
+ //#endregion
47
+ exports.AppShellLayout = AppShellLayout;
48
+
49
+ //# sourceMappingURL=AppShellLayout.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppShellLayout.cjs","names":["SidebarProvider","Sidebar","SidebarHeader","SidebarContent","SidebarFooter","SidebarInset"],"sources":["../../src/shell/AppShellLayout.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarHeader,\n SidebarInset,\n SidebarProvider,\n} from \"./sidebar\";\n\nexport interface AppShellLayoutProps {\n /** Navigation content rendered inside the sidebar's scrollable area */\n sidebarContent: React.ReactNode;\n /** Header content rendered above the main content area */\n headerContent: React.ReactNode;\n /** Main page content */\n children: React.ReactNode;\n /** Optional slot at the top of the sidebar (e.g. logo, search) */\n sidebarHeader?: React.ReactNode;\n /** Optional slot at the bottom of the sidebar (e.g. user info) */\n sidebarFooter?: React.ReactNode;\n /** Content rendered after SidebarInset (e.g. MobileBottomNav) */\n afterContent?: React.ReactNode;\n /** Enable bottom nav mode (hides sidebar on mobile, adds bottom padding) */\n useBottomNav?: boolean;\n}\n\n/**\n * Pure visual frame that replicates the RepApp layout:\n * - 13rem collapsible sidebar\n * - 52px header area\n * - rounded-xl bg-background shadow-lg content area with bg-muted gutters\n *\n * This component handles zero business logic — it simply provides the visual shell.\n */\nexport function AppShellLayout({\n sidebarContent,\n headerContent,\n children,\n sidebarHeader,\n sidebarFooter,\n afterContent,\n useBottomNav = false,\n}: AppShellLayoutProps): React.JSX.Element {\n return (\n <SidebarProvider useBottomNav={useBottomNav}>\n <div className=\"bg-muted relative flex max-h-dvh w-full overflow-hidden\">\n {/* Navigation Sidebar */}\n <Sidebar>\n {sidebarHeader && <SidebarHeader>{sidebarHeader}</SidebarHeader>}\n <SidebarContent className=\"p-4\">{sidebarContent}</SidebarContent>\n {sidebarFooter && <SidebarFooter>{sidebarFooter}</SidebarFooter>}\n </Sidebar>\n\n {/* Main Content Area */}\n <SidebarInset className=\"flex flex-1 flex-col overflow-hidden\">\n {/* Header */}\n {headerContent}\n\n {/* Screen Content */}\n <div\n className={`bg-muted flex-1 overflow-hidden md:pr-4 md:pb-4 ${useBottomNav ? \"max-md:pb-[calc(4rem+env(safe-area-inset-bottom))]\" : \"\"}`}\n >\n <div className=\"scrollbar-none bg-background text-foreground h-full overflow-auto rounded-xl shadow-lg\">\n {children}\n </div>\n </div>\n </SidebarInset>\n\n {/* After content (e.g. MobileBottomNav) */}\n {afterContent}\n </div>\n </SidebarProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqCA,SAAgB,eAAe,EAC7B,gBACA,eACA,UACA,eACA,eACA,cACA,eAAe,SAC0B;AACzC,QACE,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,iBAAD;EAA+B;YAC7B,iBAAA,GAAA,kBAAA,MAAC,OAAD;GAAK,WAAU;aAAf;IAEE,iBAAA,GAAA,kBAAA,MAACC,sBAAAA,SAAD,EAAA,UAAA;KACG,iBAAiB,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,eAAD,EAAA,UAAgB,eAA8B,CAAA;KAChE,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,gBAAD;MAAgB,WAAU;gBAAO;MAAgC,CAAA;KAChE,iBAAiB,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,eAAD,EAAA,UAAgB,eAA8B,CAAA;KACxD,EAAA,CAAA;IAGV,iBAAA,GAAA,kBAAA,MAACC,sBAAAA,cAAD;KAAc,WAAU;eAAxB,CAEG,eAGD,iBAAA,GAAA,kBAAA,KAAC,OAAD;MACE,WAAW,mDAAmD,eAAe,uDAAuD;gBAEpI,iBAAA,GAAA,kBAAA,KAAC,OAAD;OAAK,WAAU;OACZ;OACG,CAAA;MACF,CAAA,CACO;;IAGd;IACG;;EACU,CAAA"}