@qwickapps/react-framework 1.5.12 → 1.5.13
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.
- package/README.md +23 -0
- package/dist/components/blocks/ImageGallery.d.ts +30 -0
- package/dist/components/blocks/ImageGallery.d.ts.map +1 -0
- package/dist/components/blocks/OptionSelector.d.ts +45 -0
- package/dist/components/blocks/OptionSelector.d.ts.map +1 -0
- package/dist/components/blocks/index.d.ts +4 -0
- package/dist/components/blocks/index.d.ts.map +1 -1
- package/dist/index.esm.js +1192 -265
- package/dist/index.js +1194 -263
- package/dist/palettes/manifest.json +19 -19
- package/dist/schemas/ImageGallerySchema.d.ts +27 -0
- package/dist/schemas/ImageGallerySchema.d.ts.map +1 -0
- package/dist/schemas/OptionSelectorSchema.d.ts +34 -0
- package/dist/schemas/OptionSelectorSchema.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/blocks/Article.tsx +1 -1
- package/src/components/blocks/ImageGallery.tsx +464 -0
- package/src/components/blocks/OptionSelector.tsx +459 -0
- package/src/components/blocks/index.ts +4 -0
- package/src/schemas/ImageGallerySchema.ts +148 -0
- package/src/schemas/OptionSelectorSchema.ts +216 -0
- package/src/schemas/index.ts +2 -0
- package/src/stories/ImageGallery.stories.tsx +497 -0
- package/src/stories/OptionSelector.stories.tsx +506 -0
- /package/dist/palettes/{palette-autumn.1.5.12.css → palette-autumn.1.5.13.css} +0 -0
- /package/dist/palettes/{palette-autumn.1.5.12.min.css → palette-autumn.1.5.13.min.css} +0 -0
- /package/dist/palettes/{palette-cosmic.1.5.12.css → palette-cosmic.1.5.13.css} +0 -0
- /package/dist/palettes/{palette-cosmic.1.5.12.min.css → palette-cosmic.1.5.13.min.css} +0 -0
- /package/dist/palettes/{palette-default.1.5.12.css → palette-default.1.5.13.css} +0 -0
- /package/dist/palettes/{palette-default.1.5.12.min.css → palette-default.1.5.13.min.css} +0 -0
- /package/dist/palettes/{palette-ocean.1.5.12.css → palette-ocean.1.5.13.css} +0 -0
- /package/dist/palettes/{palette-ocean.1.5.12.min.css → palette-ocean.1.5.13.min.css} +0 -0
- /package/dist/palettes/{palette-spring.1.5.12.css → palette-spring.1.5.13.css} +0 -0
- /package/dist/palettes/{palette-spring.1.5.12.min.css → palette-spring.1.5.13.min.css} +0 -0
- /package/dist/palettes/{palette-winter.1.5.12.css → palette-winter.1.5.13.css} +0 -0
- /package/dist/palettes/{palette-winter.1.5.12.min.css → palette-winter.1.5.13.min.css} +0 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema for OptionSelector component - Universal option selection with visual modes
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { IsBoolean, IsOptional, IsString, IsNumber, IsIn, IsArray, ValidateNested } from 'class-validator';
|
|
8
|
+
import { Type } from 'class-transformer';
|
|
9
|
+
import 'reflect-metadata';
|
|
10
|
+
import { Editor, Field, Schema, FieldType, DataType } from '@qwickapps/schema';
|
|
11
|
+
import { ViewSchema } from './ViewSchema';
|
|
12
|
+
|
|
13
|
+
// Select option model
|
|
14
|
+
export class SelectOptionModel {
|
|
15
|
+
@Field({ dataType: DataType.STRING })
|
|
16
|
+
@IsString()
|
|
17
|
+
id!: string;
|
|
18
|
+
|
|
19
|
+
@Field({ dataType: DataType.STRING })
|
|
20
|
+
@IsString()
|
|
21
|
+
label!: string;
|
|
22
|
+
|
|
23
|
+
@Field({ dataType: DataType.BOOLEAN })
|
|
24
|
+
@IsBoolean()
|
|
25
|
+
available!: boolean;
|
|
26
|
+
|
|
27
|
+
@Field({ dataType: DataType.NUMBER })
|
|
28
|
+
@IsOptional()
|
|
29
|
+
@IsNumber()
|
|
30
|
+
price?: number;
|
|
31
|
+
|
|
32
|
+
@Field({ dataType: DataType.STRING })
|
|
33
|
+
@Editor({
|
|
34
|
+
field_type: FieldType.TEXT,
|
|
35
|
+
label: 'Hex Color Value',
|
|
36
|
+
description: 'Hex color code for color swatches (e.g., #FF0000)',
|
|
37
|
+
placeholder: '#FF0000'
|
|
38
|
+
})
|
|
39
|
+
@IsOptional()
|
|
40
|
+
@IsString()
|
|
41
|
+
hexValue?: string;
|
|
42
|
+
|
|
43
|
+
@Field({ dataType: DataType.STRING })
|
|
44
|
+
@Editor({
|
|
45
|
+
field_type: FieldType.TEXT,
|
|
46
|
+
label: 'Image URL',
|
|
47
|
+
description: 'Image URL for image/pattern display mode',
|
|
48
|
+
placeholder: '/patterns/stripes.jpg'
|
|
49
|
+
})
|
|
50
|
+
@IsOptional()
|
|
51
|
+
@IsString()
|
|
52
|
+
imageUrl?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Display modes
|
|
56
|
+
export type DisplayMode = 'text' | 'color' | 'image';
|
|
57
|
+
|
|
58
|
+
// Display variants
|
|
59
|
+
export type OptionVariant = 'buttons' | 'dropdown' | 'grid';
|
|
60
|
+
|
|
61
|
+
// Layout options
|
|
62
|
+
export type OptionLayout = 'horizontal' | 'vertical' | 'wrap';
|
|
63
|
+
|
|
64
|
+
// Visual sizes
|
|
65
|
+
export type VisualSize = 'small' | 'medium' | 'large';
|
|
66
|
+
|
|
67
|
+
@Schema('OptionSelector', '1.0.0')
|
|
68
|
+
export class OptionSelectorModel extends ViewSchema {
|
|
69
|
+
@Field({ dataType: DataType.ARRAY })
|
|
70
|
+
@Editor({
|
|
71
|
+
field_type: FieldType.ARRAY,
|
|
72
|
+
label: 'Available Options',
|
|
73
|
+
description: 'Array of options to display',
|
|
74
|
+
})
|
|
75
|
+
@IsArray()
|
|
76
|
+
@ValidateNested({ each: true })
|
|
77
|
+
@Type(() => SelectOptionModel)
|
|
78
|
+
options!: SelectOptionModel[];
|
|
79
|
+
|
|
80
|
+
@Field({ dataType: DataType.STRING })
|
|
81
|
+
@Editor({
|
|
82
|
+
field_type: FieldType.TEXT,
|
|
83
|
+
label: 'Selected Option',
|
|
84
|
+
description: 'Currently selected option ID',
|
|
85
|
+
placeholder: 'm'
|
|
86
|
+
})
|
|
87
|
+
@IsOptional()
|
|
88
|
+
@IsString()
|
|
89
|
+
selectedOption?: string;
|
|
90
|
+
|
|
91
|
+
@Field({ defaultValue: 'text', dataType: DataType.STRING })
|
|
92
|
+
@Editor({
|
|
93
|
+
field_type: FieldType.SELECT,
|
|
94
|
+
label: 'Display Mode',
|
|
95
|
+
description: 'Visual display mode for options',
|
|
96
|
+
validation: {
|
|
97
|
+
options: [
|
|
98
|
+
{ label: 'Text (buttons with labels)', value: 'text' },
|
|
99
|
+
{ label: 'Color (swatches)', value: 'color' },
|
|
100
|
+
{ label: 'Image (patterns/textures)', value: 'image' }
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
@IsOptional()
|
|
105
|
+
@IsString()
|
|
106
|
+
@IsIn(['text', 'color', 'image'])
|
|
107
|
+
displayMode?: DisplayMode;
|
|
108
|
+
|
|
109
|
+
@Field({ defaultValue: 'grid', dataType: DataType.STRING })
|
|
110
|
+
@Editor({
|
|
111
|
+
field_type: FieldType.SELECT,
|
|
112
|
+
label: 'Display Variant',
|
|
113
|
+
description: 'How to display the selector',
|
|
114
|
+
validation: {
|
|
115
|
+
options: [
|
|
116
|
+
{ label: 'Buttons', value: 'buttons' },
|
|
117
|
+
{ label: 'Dropdown', value: 'dropdown' },
|
|
118
|
+
{ label: 'Grid', value: 'grid' }
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
@IsOptional()
|
|
123
|
+
@IsString()
|
|
124
|
+
@IsIn(['buttons', 'dropdown', 'grid'])
|
|
125
|
+
variant?: OptionVariant;
|
|
126
|
+
|
|
127
|
+
@Field({ defaultValue: 'wrap', dataType: DataType.STRING })
|
|
128
|
+
@Editor({
|
|
129
|
+
field_type: FieldType.SELECT,
|
|
130
|
+
label: 'Layout Direction',
|
|
131
|
+
description: 'Layout direction for buttons/grid variant',
|
|
132
|
+
validation: {
|
|
133
|
+
options: [
|
|
134
|
+
{ label: 'Horizontal', value: 'horizontal' },
|
|
135
|
+
{ label: 'Vertical', value: 'vertical' },
|
|
136
|
+
{ label: 'Wrap', value: 'wrap' }
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
@IsOptional()
|
|
141
|
+
@IsString()
|
|
142
|
+
@IsIn(['horizontal', 'vertical', 'wrap'])
|
|
143
|
+
layout?: OptionLayout;
|
|
144
|
+
|
|
145
|
+
@Field({ defaultValue: 'medium', dataType: DataType.STRING })
|
|
146
|
+
@Editor({
|
|
147
|
+
field_type: FieldType.SELECT,
|
|
148
|
+
label: 'Visual Size',
|
|
149
|
+
description: 'Size for color/image display modes',
|
|
150
|
+
validation: {
|
|
151
|
+
options: [
|
|
152
|
+
{ label: 'Small (32px)', value: 'small' },
|
|
153
|
+
{ label: 'Medium (44px)', value: 'medium' },
|
|
154
|
+
{ label: 'Large (56px)', value: 'large' }
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
@IsOptional()
|
|
159
|
+
@IsString()
|
|
160
|
+
@IsIn(['small', 'medium', 'large'])
|
|
161
|
+
visualSize?: VisualSize;
|
|
162
|
+
|
|
163
|
+
@Field({ defaultValue: false, dataType: DataType.BOOLEAN })
|
|
164
|
+
@Editor({
|
|
165
|
+
field_type: FieldType.BOOLEAN,
|
|
166
|
+
label: 'Show Label',
|
|
167
|
+
description: 'Show label below visual (for color/image modes)'
|
|
168
|
+
})
|
|
169
|
+
@IsOptional()
|
|
170
|
+
@IsBoolean()
|
|
171
|
+
showLabel?: boolean;
|
|
172
|
+
|
|
173
|
+
@Field({ defaultValue: false, dataType: DataType.BOOLEAN })
|
|
174
|
+
@Editor({
|
|
175
|
+
field_type: FieldType.BOOLEAN,
|
|
176
|
+
label: 'Disabled',
|
|
177
|
+
description: 'Disable all option selections'
|
|
178
|
+
})
|
|
179
|
+
@IsOptional()
|
|
180
|
+
@IsBoolean()
|
|
181
|
+
disabled?: boolean;
|
|
182
|
+
|
|
183
|
+
@Field({ defaultValue: 'Select Option', dataType: DataType.STRING })
|
|
184
|
+
@Editor({
|
|
185
|
+
field_type: FieldType.TEXT,
|
|
186
|
+
label: 'Label',
|
|
187
|
+
description: 'Label text for the selector',
|
|
188
|
+
placeholder: 'Select Option'
|
|
189
|
+
})
|
|
190
|
+
@IsOptional()
|
|
191
|
+
@IsString()
|
|
192
|
+
label?: string;
|
|
193
|
+
|
|
194
|
+
@Field({ dataType: DataType.STRING })
|
|
195
|
+
@Editor({
|
|
196
|
+
field_type: FieldType.TEXT,
|
|
197
|
+
label: 'Data Source',
|
|
198
|
+
description: 'Data source for dynamic option loading',
|
|
199
|
+
placeholder: 'product-options'
|
|
200
|
+
})
|
|
201
|
+
@IsOptional()
|
|
202
|
+
@IsString()
|
|
203
|
+
dataSource?: string;
|
|
204
|
+
|
|
205
|
+
@Field({ dataType: DataType.OBJECT })
|
|
206
|
+
@Editor({
|
|
207
|
+
field_type: FieldType.TEXTAREA,
|
|
208
|
+
label: 'Binding Options',
|
|
209
|
+
description: 'Data binding configuration (JSON format)',
|
|
210
|
+
placeholder: '{ "filter": {}, "sort": {} }'
|
|
211
|
+
})
|
|
212
|
+
@IsOptional()
|
|
213
|
+
bindingOptions?: Record<string, unknown>;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export default OptionSelectorModel;
|
package/src/schemas/index.ts
CHANGED
|
@@ -41,6 +41,8 @@ export * from './MetadataItemSchema';
|
|
|
41
41
|
export * from './PageBannerHeaderSchema';
|
|
42
42
|
export * from './PaletteSwitcherSchema';
|
|
43
43
|
export * from './ProductCardSchema';
|
|
44
|
+
export * from './ImageGallerySchema';
|
|
45
|
+
export * from './OptionSelectorSchema';
|
|
44
46
|
export * from './SafeSpanSchema';
|
|
45
47
|
export * from './SectionSchema';
|
|
46
48
|
export * from './TextInputFieldSchema';
|