@qwickapps/react-framework 1.3.3 → 1.3.5

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 (43) hide show
  1. package/README.md +227 -0
  2. package/dist/components/blocks/Content.d.ts.map +1 -1
  3. package/dist/components/blocks/ProductCard.d.ts.map +1 -1
  4. package/dist/components/forms/FormBlock.d.ts +1 -1
  5. package/dist/components/forms/FormBlock.d.ts.map +1 -1
  6. package/dist/components/input/SwitchInputField.d.ts +28 -0
  7. package/dist/components/input/SwitchInputField.d.ts.map +1 -0
  8. package/dist/components/input/index.d.ts +2 -0
  9. package/dist/components/input/index.d.ts.map +1 -1
  10. package/dist/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts +34 -0
  11. package/dist/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts.map +1 -0
  12. package/dist/components/layout/CollapsibleLayout/index.d.ts +9 -0
  13. package/dist/components/layout/CollapsibleLayout/index.d.ts.map +1 -0
  14. package/dist/components/layout/index.d.ts +2 -0
  15. package/dist/components/layout/index.d.ts.map +1 -1
  16. package/dist/contexts/ThemeContext.d.ts.map +1 -1
  17. package/dist/index.esm.js +963 -105
  18. package/dist/index.js +967 -101
  19. package/dist/schemas/CollapsibleLayoutSchema.d.ts +31 -0
  20. package/dist/schemas/CollapsibleLayoutSchema.d.ts.map +1 -0
  21. package/dist/schemas/SwitchInputFieldSchema.d.ts +18 -0
  22. package/dist/schemas/SwitchInputFieldSchema.d.ts.map +1 -0
  23. package/dist/types/CollapsibleLayout.d.ts +142 -0
  24. package/dist/types/CollapsibleLayout.d.ts.map +1 -0
  25. package/dist/types/index.d.ts +1 -0
  26. package/dist/types/index.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/src/components/blocks/Content.tsx +25 -77
  29. package/src/components/blocks/ProductCard.tsx +50 -51
  30. package/src/components/forms/FormBlock.tsx +2 -2
  31. package/src/components/input/SwitchInputField.tsx +165 -0
  32. package/src/components/input/index.ts +2 -0
  33. package/src/components/layout/CollapsibleLayout/CollapsibleLayout.tsx +554 -0
  34. package/src/components/layout/CollapsibleLayout/__tests__/CollapsibleLayout.test.tsx +1469 -0
  35. package/src/components/layout/CollapsibleLayout/index.tsx +17 -0
  36. package/src/components/layout/index.ts +4 -1
  37. package/src/components/pages/FormPage.tsx +1 -1
  38. package/src/contexts/ThemeContext.tsx +1 -2
  39. package/src/schemas/CollapsibleLayoutSchema.ts +276 -0
  40. package/src/schemas/SwitchInputFieldSchema.ts +99 -0
  41. package/src/stories/CollapsibleLayout.stories.tsx +1566 -0
  42. package/src/types/CollapsibleLayout.ts +231 -0
  43. package/src/types/index.ts +1 -0
@@ -0,0 +1,31 @@
1
+ /**
2
+ * CollapsibleLayout Schema - Data model for collapsible layout component
3
+ *
4
+ * Advanced expandable/collapsible container with header controls, animations,
5
+ * content management, and state persistence capabilities.
6
+ *
7
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
8
+ */
9
+ import { Model } from '@qwickapps/schema';
10
+ export declare class CollapsibleLayoutModel extends Model {
11
+ collapsed?: boolean;
12
+ defaultCollapsed?: boolean;
13
+ title?: string;
14
+ subtitle?: string;
15
+ leadIcon?: string;
16
+ headerActions?: string;
17
+ collapsedView?: string;
18
+ children?: string;
19
+ footerView?: string;
20
+ triggerArea?: 'button' | 'header' | 'both';
21
+ animationStyle?: 'fade' | 'slide' | 'scale';
22
+ persistState?: boolean;
23
+ collapsedIcon?: string;
24
+ expandedIcon?: string;
25
+ showDivider?: boolean;
26
+ variant?: 'default' | 'outlined' | 'elevated' | 'filled';
27
+ headerSpacing?: 'compact' | 'comfortable' | 'spacious';
28
+ contentSpacing?: 'compact' | 'comfortable' | 'spacious';
29
+ }
30
+ export default CollapsibleLayoutModel;
31
+ //# sourceMappingURL=CollapsibleLayoutSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapsibleLayoutSchema.d.ts","sourceRoot":"","sources":["../../src/schemas/CollapsibleLayoutSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAIL,KAAK,EAEN,MAAM,mBAAmB,CAAC;AAG3B,qBACa,sBAAuB,SAAQ,KAAK;IAc/C,SAAS,CAAC,EAAE,OAAO,CAAC;IAUpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAe3B,KAAK,CAAC,EAAE,MAAM,CAAC;IAWf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAWlB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAWlB,aAAa,CAAC,EAAE,MAAM,CAAC;IAevB,aAAa,CAAC,EAAE,MAAM,CAAC;IAWvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAWlB,UAAU,CAAC,EAAE,MAAM,CAAC;IAqBpB,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;IAiB3C,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IAU5C,YAAY,CAAC,EAAE,OAAO,CAAC;IAevB,aAAa,CAAC,EAAE,MAAM,CAAC;IAWvB,YAAY,CAAC,EAAE,MAAM,CAAC;IActB,WAAW,CAAC,EAAE,OAAO,CAAC;IAsBtB,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;IAiBzD,aAAa,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;IAiBvD,cAAc,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;CACzD;AAED,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * SwitchInputField Schema - Data model for switch input field component
3
+ *
4
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
5
+ */
6
+ import { Model } from '@qwickapps/schema';
7
+ export declare class SwitchInputFieldModel extends Model {
8
+ label?: string;
9
+ checked?: boolean;
10
+ required?: boolean;
11
+ disabled?: boolean;
12
+ error?: string;
13
+ helperText?: string;
14
+ size?: 'small' | 'medium';
15
+ color?: 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
16
+ }
17
+ export default SwitchInputFieldModel;
18
+ //# sourceMappingURL=SwitchInputFieldSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwitchInputFieldSchema.d.ts","sourceRoot":"","sources":["../../src/schemas/SwitchInputFieldSchema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAIL,KAAK,EAEN,MAAM,mBAAmB,CAAC;AAG3B,qBACa,qBAAsB,SAAQ,KAAK;IAS9C,KAAK,CAAC,EAAE,MAAM,CAAC;IAUf,OAAO,CAAC,EAAE,OAAO,CAAC;IAUlB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAUnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAUnB,KAAK,CAAC,EAAE,MAAM,CAAC;IAUf,UAAU,CAAC,EAAE,MAAM,CAAC;IAUpB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAU1B,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;CACxF;AAED,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,142 @@
1
+ /**
2
+ * TypeScript type definitions for CollapsibleLayout component
3
+ *
4
+ * Provides TypeScript interfaces that extend the schema model with React-specific types
5
+ * and component-level functionality for the CollapsibleLayout component.
6
+ *
7
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
8
+ */
9
+ import { ReactNode } from 'react';
10
+ import type { WithDataBinding, ModelProps } from '@qwickapps/schema';
11
+ import type { WithBaseProps } from '../hooks/useBaseProps';
12
+ import CollapsibleLayoutModel from '../schemas/CollapsibleLayoutSchema';
13
+ /**
14
+ * Core CollapsibleLayout properties extending the schema model
15
+ *
16
+ * This interface combines the schema-defined properties with React-specific types
17
+ * and additional component functionality not captured in the schema.
18
+ */
19
+ export type CollapsibleLayoutViewProps = ModelProps<CollapsibleLayoutModel> & WithBaseProps & {
20
+ /**
21
+ * Callback fired when the collapsed state changes
22
+ * @param collapsed - The new collapsed state
23
+ */
24
+ onToggle?: (collapsed: boolean) => void;
25
+ /** Lead icon as React node (overrides string-based leadIcon from schema) */
26
+ leadIcon?: ReactNode;
27
+ /** Header actions as React node (overrides string-based headerActions from schema) */
28
+ headerActions?: ReactNode;
29
+ /** Collapsed view content as React node (overrides string-based collapsedView from schema) */
30
+ collapsedView?: ReactNode;
31
+ /** Main content as React node (overrides string-based children from schema) */
32
+ children?: ReactNode;
33
+ /** Footer content as React node (overrides string-based footerView from schema) */
34
+ footerView?: ReactNode;
35
+ /** Collapsed state icon as React node (overrides string-based collapsedIcon from schema) */
36
+ collapsedIcon?: ReactNode;
37
+ /** Expanded state icon as React node (overrides string-based expandedIcon from schema) */
38
+ expandedIcon?: ReactNode;
39
+ /**
40
+ * Unique key for local storage persistence (when persistState is true)
41
+ * Defaults to component id or generates one automatically
42
+ */
43
+ storageKey?: string;
44
+ /**
45
+ * Animation duration in milliseconds
46
+ * @default 300
47
+ */
48
+ animationDuration?: number;
49
+ /**
50
+ * Disable all animations (useful for testing or accessibility)
51
+ * @default false
52
+ */
53
+ disableAnimations?: boolean;
54
+ /**
55
+ * Custom CSS class for the container
56
+ */
57
+ containerClassName?: string;
58
+ /**
59
+ * Custom CSS class for the header
60
+ */
61
+ headerClassName?: string;
62
+ /**
63
+ * Custom CSS class for the content area
64
+ */
65
+ contentClassName?: string;
66
+ /**
67
+ * Custom CSS class for the footer
68
+ */
69
+ footerClassName?: string;
70
+ /**
71
+ * ARIA label for the toggle button
72
+ * @default "Toggle content visibility"
73
+ */
74
+ toggleAriaLabel?: string;
75
+ /**
76
+ * ID of element that describes the collapsible content
77
+ */
78
+ 'aria-describedby'?: string;
79
+ /**
80
+ * Additional ARIA attributes for the content region
81
+ */
82
+ contentAriaProps?: {
83
+ 'aria-label'?: string;
84
+ 'aria-labelledby'?: string;
85
+ role?: string;
86
+ };
87
+ };
88
+ /**
89
+ * Complete CollapsibleLayout component props interface
90
+ *
91
+ * This is the interface that should be used by the CollapsibleLayout component.
92
+ * It combines the view props with data binding capabilities.
93
+ */
94
+ export interface CollapsibleLayoutProps extends CollapsibleLayoutViewProps, WithDataBinding {
95
+ }
96
+ /**
97
+ * Type guard to check if a component has CollapsibleLayout props
98
+ */
99
+ export declare function isCollapsibleLayoutProps(props: any): props is CollapsibleLayoutProps;
100
+ /**
101
+ * Default props for CollapsibleLayout component
102
+ */
103
+ export declare const defaultCollapsibleLayoutProps: Partial<CollapsibleLayoutProps>;
104
+ /**
105
+ * Animation style configurations
106
+ */
107
+ export interface AnimationConfig {
108
+ duration: number;
109
+ easing: string;
110
+ transform?: string;
111
+ opacity?: [number, number];
112
+ }
113
+ export declare const animationConfigs: Record<NonNullable<CollapsibleLayoutProps['animationStyle']>, AnimationConfig>;
114
+ /**
115
+ * Spacing configurations
116
+ */
117
+ export interface SpacingConfig {
118
+ padding: string;
119
+ gap?: string;
120
+ }
121
+ export declare const spacingConfigs: Record<NonNullable<CollapsibleLayoutProps['headerSpacing'] | CollapsibleLayoutProps['contentSpacing']>, SpacingConfig>;
122
+ /**
123
+ * Utility type for extracting controlled vs uncontrolled props
124
+ */
125
+ export type ControlledCollapsibleLayoutProps = CollapsibleLayoutProps & {
126
+ collapsed: boolean;
127
+ onToggle: (collapsed: boolean) => void;
128
+ };
129
+ export type UncontrolledCollapsibleLayoutProps = CollapsibleLayoutProps & {
130
+ defaultCollapsed?: boolean;
131
+ onToggle?: (collapsed: boolean) => void;
132
+ };
133
+ /**
134
+ * Hook return type for managing collapsed state
135
+ */
136
+ export interface UseCollapsibleLayoutState {
137
+ collapsed: boolean;
138
+ toggle: () => void;
139
+ setCollapsed: (collapsed: boolean) => void;
140
+ isControlled: boolean;
141
+ }
142
+ //# sourceMappingURL=CollapsibleLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapsibleLayout.d.ts","sour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kC,GAAG,sBAAsB,GAAG;IACxE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,YAAY,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,YAAY,EAAE,OAAO,CAAC;CACvB"}
@@ -74,6 +74,7 @@ export type ColorIntensity = 'light' | 'main' | 'dark';
74
74
  */
75
75
  export type LoadingState = 'idle' | 'loading' | 'success' | 'error';
76
76
  export * from './CacheProvider';
77
+ export * from './CollapsibleLayout';
77
78
  export * from './ContentProxy';
78
79
  export * from './DataTypes';
79
80
  export * from './TemplateProvider';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEpF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;AAE9F;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,kBAAkB,GAAG,KAAK,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;AAE5D;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,aAAa,GAAG,MAAM,GAA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,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEvF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAGpE,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwickapps/react-framework",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "type": "module",
5
5
  "description": "Complete React framework with responsive navigation, flexible layouts, theming system, and reusable components for building modern applications.",
6
6
  "main": "dist/index.js",
@@ -61,85 +61,33 @@ function ContentView({
61
61
  }
62
62
  };
63
63
 
64
- // Content wrapper based on variant
65
- const ContentWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => {
66
- const paddingValue = getPadding();
67
- const mappedMaxWidth = mapToMUIBreakpoint(contentMaxWidth === 'false' ? false : contentMaxWidth as BreakpointValue);
68
- const commonSx: SxProps<Theme> = {
69
- textAlign: centered ? 'center' : 'left',
70
- maxWidth: mappedMaxWidth !== false
71
- ? theme.breakpoints.values[mappedMaxWidth]
72
- : '100%',
73
- width: '100%',
74
- ...(centered && contentMaxWidth && {
75
- mx: 'auto',
76
- }),
77
- p: paddingValue,
78
- ...styleProps.sx,
79
- };
80
-
81
- switch (variant) {
82
- case 'elevated':
83
- return (
84
- <Paper
85
- elevation={4}
86
- {...htmlProps}
87
- {...otherProps}
88
- sx={{
89
- ...commonSx,
90
- backgroundColor: theme.palette.background.paper,
91
- }}
92
- >
93
- {children}
94
- </Paper>
95
- );
96
- case 'outlined':
97
- return (
98
- <Paper
99
- variant="outlined"
100
- elevation={0}
101
- {...htmlProps}
102
- {...otherProps}
103
- sx={{
104
- ...commonSx,
105
- backgroundColor: 'var(--theme-surface)',
106
- borderColor: 'var(--theme-border-main)', // Use theme border color
107
- borderWidth: 1,
108
- borderStyle: 'solid',
109
- }}
110
- >
111
- {children}
112
- </Paper>
113
- );
114
- case 'filled':
115
- return (
116
- <Box
117
- {...htmlProps}
118
- {...otherProps}
119
- sx={{
120
- ...commonSx,
121
- backgroundColor: 'var(--theme-surface-variant)', // Use theme surface variant
122
- borderRadius: 1,
123
- }}
124
- >
125
- {children}
126
- </Box>
127
- );
128
- default:
129
- return (
130
- <Box
131
- {...htmlProps}
132
- {...otherProps}
133
- sx={commonSx}
134
- >
135
- {children}
136
- </Box>
137
- );
138
- }
64
+ // Compute stable wrapper element (avoid recreating component type each render which caused remount & focus loss)
65
+ const paddingValue = getPadding();
66
+ const mappedMaxWidth = mapToMUIBreakpoint(contentMaxWidth === 'false' ? false : contentMaxWidth as BreakpointValue);
67
+ const commonSx: SxProps<Theme> = {
68
+ textAlign: centered ? 'center' : 'left',
69
+ maxWidth: mappedMaxWidth !== false ? theme.breakpoints.values[mappedMaxWidth] : '100%',
70
+ width: '100%',
71
+ ...(centered && contentMaxWidth && { mx: 'auto' }),
72
+ p: paddingValue,
73
+ ...styleProps.sx,
139
74
  };
140
75
 
76
+ let Wrapper: React.ElementType = Box;
77
+ let wrapperProps: Record<string, any> = { ...htmlProps, ...otherProps, sx: commonSx };
78
+ if (variant === 'elevated') {
79
+ Wrapper = Paper;
80
+ wrapperProps = { ...wrapperProps, elevation: 4, sx: { ...commonSx, backgroundColor: theme.palette.background.paper } };
81
+ } else if (variant === 'outlined') {
82
+ Wrapper = Paper;
83
+ wrapperProps = { ...wrapperProps, variant: 'outlined', elevation: 0, sx: { ...commonSx, backgroundColor: 'var(--theme-surface)', borderColor: 'var(--theme-border-main)', borderWidth: 1, borderStyle: 'solid' } };
84
+ } else if (variant === 'filled') {
85
+ Wrapper = Box;
86
+ wrapperProps = { ...wrapperProps, sx: { ...commonSx, backgroundColor: 'var(--theme-surface-variant)', borderRadius: 1 } };
87
+ }
88
+
141
89
  return (
142
- <ContentWrapper>
90
+ <Wrapper {...wrapperProps}>
143
91
  <Stack spacing={2}>
144
92
  {/* Header */}
145
93
  {(title || subtitle) && (
@@ -210,7 +158,7 @@ function ContentView({
210
158
  </Stack>
211
159
  )}
212
160
  </Stack>
213
- </ContentWrapper>
161
+ </Wrapper>
214
162
  );
215
163
  }
216
164
 
@@ -141,26 +141,29 @@ function ProductCardView({
141
141
 
142
142
  const displayActions = actions || getDefaultActions();
143
143
 
144
- const FeaturesList = () => {
145
- const featuresToShow = variant === 'compact'
144
+ // INLINE WRAPPERS REFACTORED: Instead of inline component declarations (which cause remounts),
145
+ // compute JSX fragments via plain variables/functions and inject directly.
146
+
147
+ const featuresListElement = (() => {
148
+ const featuresToShow = variant === 'compact'
146
149
  ? (product.features || []).slice(0, maxFeaturesCompact)
147
150
  : (product.features || []);
148
151
 
149
152
  return (
150
153
  <Box sx={{ mb: variant === 'detailed' ? 2.5 : 2 }}>
151
- <Typography
152
- variant="h6"
154
+ <Typography
155
+ variant="h6"
153
156
  component="h4"
154
- sx={{
155
- mb: 1.5,
157
+ sx={{
158
+ mb: 1.5,
156
159
  fontSize: '1.1rem',
157
160
  fontWeight: 600
158
161
  }}
159
162
  >
160
163
  Key Features:
161
164
  </Typography>
162
- <Box component="ul" sx={{
163
- m: 0,
165
+ <Box component="ul" sx={{
166
+ m: 0,
164
167
  p: 0,
165
168
  listStyle: 'none'
166
169
  }}>
@@ -185,9 +188,9 @@ function ProductCardView({
185
188
  flexShrink: 0
186
189
  }}
187
190
  />
188
- <Typography
189
- variant="body2"
190
- sx={{
191
+ <Typography
192
+ variant="body2"
193
+ sx={{
191
194
  fontSize: '0.95rem',
192
195
  lineHeight: 1.4,
193
196
  opacity: 0.8
@@ -198,10 +201,10 @@ function ProductCardView({
198
201
  </Box>
199
202
  ))}
200
203
  {variant === 'compact' && (product.features || []).length > maxFeaturesCompact && (
201
- <Typography
202
- variant="body2"
204
+ <Typography
205
+ variant="body2"
203
206
  color="primary"
204
- sx={{
207
+ sx={{
205
208
  fontSize: '0.9rem',
206
209
  pl: 2.5,
207
210
  fontWeight: 500
@@ -213,41 +216,37 @@ function ProductCardView({
213
216
  </Box>
214
217
  </Box>
215
218
  );
216
- };
217
-
218
- const TechnologiesSection = () => {
219
- if (!showTechnologies || variant === 'compact') return null;
219
+ })();
220
220
 
221
- return (
222
- <Box sx={{ mb: 3 }}>
223
- <Typography
224
- variant="h6"
225
- component="h4"
226
- sx={{
227
- mb: 1.5,
228
- fontSize: '1rem',
229
- fontWeight: 600
230
- }}
231
- >
232
- Technologies:
233
- </Typography>
234
- <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1 }}>
235
- {product.technologies.map((tech, index) => (
236
- <Chip
237
- key={index}
238
- label={tech}
239
- variant="outlined"
240
- size="small"
241
- sx={{
242
- fontSize: '0.8rem',
243
- fontWeight: 500
244
- }}
245
- />
246
- ))}
247
- </Box>
221
+ const technologiesSectionElement = (!showTechnologies || variant === 'compact') ? null : (
222
+ <Box sx={{ mb: 3 }}>
223
+ <Typography
224
+ variant="h6"
225
+ component="h4"
226
+ sx={{
227
+ mb: 1.5,
228
+ fontSize: '1rem',
229
+ fontWeight: 600
230
+ }}
231
+ >
232
+ Technologies:
233
+ </Typography>
234
+ <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1 }}>
235
+ {product.technologies.map((tech, index) => (
236
+ <Chip
237
+ key={index}
238
+ label={tech}
239
+ variant="outlined"
240
+ size="small"
241
+ sx={{
242
+ fontSize: '0.8rem',
243
+ fontWeight: 500
244
+ }}
245
+ />
246
+ ))}
248
247
  </Box>
249
- );
250
- };
248
+ </Box>
249
+ );
251
250
 
252
251
  return (
253
252
  <Box
@@ -364,11 +363,11 @@ function ProductCardView({
364
363
  </Typography>
365
364
  </Box>
366
365
 
367
- {/* Features */}
368
- <FeaturesList />
366
+ {/* Features */}
367
+ {featuresListElement}
369
368
 
370
- {/* Technologies */}
371
- <TechnologiesSection />
369
+ {/* Technologies */}
370
+ {technologiesSectionElement}
372
371
 
373
372
  {/* Action Buttons */}
374
373
  <Box sx={{
@@ -46,7 +46,7 @@ type FormBlockViewProps = ModelProps<FormBlockModel> & {
46
46
  /**
47
47
  * Form content
48
48
  */
49
- form?: React.ReactNode;
49
+ children?: React.ReactNode;
50
50
 
51
51
  /**
52
52
  * Footer content (links, additional text, etc.)
@@ -99,7 +99,7 @@ function FormBlockView({
99
99
  title,
100
100
  description,
101
101
  coverImage,
102
- form,
102
+ children: form,
103
103
  footer,
104
104
  status,
105
105
  message,