@plusscommunities/pluss-feature-builder-web-d 1.0.7 → 1.0.9-beta.3

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 (119) hide show
  1. package/dist/{index.cjs.js → index.js} +3803 -3504
  2. package/dist/index.js.map +1 -0
  3. package/package.json +20 -27
  4. package/.babelrc +0 -4
  5. package/rollup.config.js +0 -69
  6. package/src/actions/featureBuilderStringsActions.js +0 -88
  7. package/src/actions/featureDefinitionsIndex.js +0 -258
  8. package/src/actions/formActions.js +0 -301
  9. package/src/actions/index.js +0 -12
  10. package/src/actions/listingActions.js +0 -352
  11. package/src/actions/wizardActions.js +0 -228
  12. package/src/components/ActivityCardExample.jsx +0 -86
  13. package/src/components/ActivityCardExample.module.css +0 -130
  14. package/src/components/BackgroundLoader.jsx +0 -33
  15. package/src/components/BackgroundLoader.module.css +0 -46
  16. package/src/components/BaseFieldConfig.jsx +0 -305
  17. package/src/components/BaseFieldConfig.module.css +0 -42
  18. package/src/components/CenteredContainer.jsx +0 -29
  19. package/src/components/CenteredContainer.module.css +0 -171
  20. package/src/components/DeleteConfirmationPopup.jsx +0 -95
  21. package/src/components/DeleteConfirmationPopup.module.css +0 -12
  22. package/src/components/ErrorBoundary.jsx +0 -134
  23. package/src/components/ErrorBoundary.module.css +0 -77
  24. package/src/components/ErrorMessage.jsx +0 -85
  25. package/src/components/ErrorMessage.module.css +0 -116
  26. package/src/components/ExampleDisplay.jsx +0 -26
  27. package/src/components/ExampleDisplay.module.css +0 -3
  28. package/src/components/FeatureBuilderSidebar.jsx +0 -84
  29. package/src/components/FeatureBuilderSuccessPopup.jsx +0 -49
  30. package/src/components/FeatureBuilderSuccessPopup.module.css +0 -41
  31. package/src/components/FeatureBuilderWelcomePopup.jsx +0 -51
  32. package/src/components/FeatureBuilderWelcomePopup.module.css +0 -21
  33. package/src/components/FeatureListingCard.jsx +0 -104
  34. package/src/components/FeatureListingCard.module.css +0 -62
  35. package/src/components/Fields.jsx +0 -423
  36. package/src/components/Fields.module.css +0 -159
  37. package/src/components/IconLoader.jsx +0 -153
  38. package/src/components/IconLoader.module.css +0 -92
  39. package/src/components/IconSelector.jsx +0 -111
  40. package/src/components/IconSelector.module.css +0 -197
  41. package/src/components/ListingEditor.jsx +0 -405
  42. package/src/components/ListingEditor.module.css +0 -14
  43. package/src/components/ListingSuccessPopup.jsx +0 -52
  44. package/src/components/LoadingScreen.jsx +0 -54
  45. package/src/components/LoadingScreen.module.css +0 -103
  46. package/src/components/LoadingState.jsx +0 -40
  47. package/src/components/LoadingState.module.css +0 -18
  48. package/src/components/PreviewFull.js +0 -24
  49. package/src/components/PreviewFull.module.css +0 -11
  50. package/src/components/PreviewGrid.js +0 -14
  51. package/src/components/PreviewWidget.js +0 -27
  52. package/src/components/PreviewWidget.module.css +0 -15
  53. package/src/components/SidebarLayout.jsx +0 -252
  54. package/src/components/SidebarLayout.module.css +0 -71
  55. package/src/components/SkeletonLoader.jsx +0 -128
  56. package/src/components/SkeletonLoader.module.css +0 -295
  57. package/src/components/SortButtonGroup.jsx +0 -34
  58. package/src/components/SortButtonGroup.module.css +0 -51
  59. package/src/components/ToastContainer.jsx +0 -98
  60. package/src/components/ToastContainer.module.css +0 -156
  61. package/src/components/ToggleSwitch.js +0 -40
  62. package/src/components/ToggleSwitch.module.css +0 -48
  63. package/src/components/TwoColumnInput.jsx +0 -29
  64. package/src/components/TwoColumnInput.module.css +0 -32
  65. package/src/components/ViewFull.js +0 -139
  66. package/src/components/ViewFull.module.css +0 -71
  67. package/src/components/ViewWidget.js +0 -62
  68. package/src/components/ViewWidget.module.css +0 -28
  69. package/src/components/iconCategories.js +0 -135
  70. package/src/components/iconImports.js +0 -409
  71. package/src/components/index.js +0 -59
  72. package/src/components/listing/FileListItem.jsx +0 -86
  73. package/src/components/listing/GalleryDisplay.jsx +0 -330
  74. package/src/components/listing/GalleryDisplay.module.css +0 -309
  75. package/src/components/listing/ListingCTAInput.jsx +0 -82
  76. package/src/components/listing/ListingDescriptionInput.jsx +0 -73
  77. package/src/components/listing/ListingField.jsx +0 -101
  78. package/src/components/listing/ListingField.module.css +0 -106
  79. package/src/components/listing/ListingFileInput.jsx +0 -273
  80. package/src/components/listing/ListingFileInput.module.css +0 -189
  81. package/src/components/listing/ListingForm.jsx +0 -90
  82. package/src/components/listing/ListingForm.module.css +0 -38
  83. package/src/components/listing/ListingGalleryInput.jsx +0 -239
  84. package/src/components/listing/ListingGalleryInput.module.css +0 -132
  85. package/src/components/listing/ListingImageInput.jsx +0 -153
  86. package/src/components/listing/ListingTextInput.jsx +0 -72
  87. package/src/feature.config.js +0 -130
  88. package/src/helper/index.js +0 -135
  89. package/src/hooks/useFeatureDefinitionLoader.js +0 -66
  90. package/src/images/full.png +0 -0
  91. package/src/images/fullNoTitle.png +0 -0
  92. package/src/images/previewWidget.png +0 -0
  93. package/src/images/widget.png +0 -0
  94. package/src/index.js +0 -38
  95. package/src/pages/CreateListingPage.jsx +0 -49
  96. package/src/pages/EditListingPage.jsx +0 -58
  97. package/src/reducers/featureBuilderReducer.js +0 -739
  98. package/src/screens/CreateListing.module.css +0 -45
  99. package/src/screens/Form.module.css +0 -744
  100. package/src/screens/FormFieldsStep.jsx +0 -626
  101. package/src/screens/FormLayoutStep.jsx +0 -405
  102. package/src/screens/FormOverviewStep.jsx +0 -389
  103. package/src/screens/ListingScreen.jsx +0 -477
  104. package/src/screens/ListingScreen.module.css +0 -333
  105. package/src/selectors/featureBuilderSelectors.js +0 -533
  106. package/src/types/index.js +0 -91
  107. package/src/utils/textUtils.js +0 -89
  108. package/src/validators/galleryValidators.js +0 -345
  109. package/src/values.config.a.js +0 -49
  110. package/src/values.config.b.js +0 -49
  111. package/src/values.config.c.js +0 -49
  112. package/src/values.config.d.js +0 -49
  113. package/src/values.config.default.js +0 -49
  114. package/src/values.config.js +0 -49
  115. package/src/webapi/featureDefinitionActions.js +0 -0
  116. package/src/webapi/featuresActions.js +0 -90
  117. package/src/webapi/helper.js +0 -4
  118. package/src/webapi/index.js +0 -12
  119. package/src/webapi/listingActions.js +0 -176
@@ -1,330 +0,0 @@
1
- import React, { useState } from "react";
2
- import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
3
- import { Text } from "../../components";
4
- import { iconImports } from "../../components/iconImports.js";
5
- import styles from "./GalleryDisplay.module.css";
6
-
7
- export const GalleryDisplay = (props) => {
8
- const {
9
- images = [],
10
- layout = "grid",
11
- columns = 3,
12
- allowReordering = false,
13
- allowLightbox = false,
14
- style = {},
15
- onImageClick,
16
- onImageRemove,
17
- onImageReorder,
18
- } = props;
19
-
20
- const [lightboxImage, setLightboxImage] = useState(null);
21
- const [draggedIndex, setDraggedIndex] = useState(null);
22
-
23
- // Filter out empty/invalid images
24
- const validImages = images.filter((img) => img && img !== "");
25
-
26
- if (validImages.length === 0) {
27
- return (
28
- <div className={styles.emptyGallery} style={style}>
29
- <Text type="body" className={styles.emptyGalleryText}>
30
- No images in gallery
31
- </Text>
32
- </div>
33
- );
34
- }
35
-
36
- const handleImageClick = (image, index) => {
37
- if (allowLightbox) {
38
- setLightboxImage({ image, index });
39
- }
40
- if (onImageClick) {
41
- onImageClick(image, index);
42
- }
43
- };
44
-
45
- const handleDragStart = (index) => {
46
- if (allowReordering) {
47
- setDraggedIndex(index);
48
- }
49
- };
50
-
51
- const handleDragOver = (e) => {
52
- if (allowReordering) {
53
- e.preventDefault();
54
- }
55
- };
56
-
57
- const handleDrop = (e, dropIndex) => {
58
- if (allowReordering && draggedIndex !== null) {
59
- e.preventDefault();
60
- onImageReorder?.(draggedIndex, dropIndex);
61
- setDraggedIndex(null);
62
- }
63
- };
64
-
65
- const removeImage = (index, e) => {
66
- e.stopPropagation();
67
- onImageRemove?.(index);
68
- };
69
-
70
- // Grid Layout
71
- if (layout === "grid") {
72
- return (
73
- <>
74
- <div
75
- className={styles.gridContainer}
76
- style={{
77
- "--columns": columns,
78
- ...style,
79
- }}
80
- >
81
- {validImages.map((image, index) => (
82
- <div
83
- key={index}
84
- className={styles.galleryItem}
85
- onClick={() => handleImageClick(image, index)}
86
- draggable={allowReordering}
87
- onDragStart={() => handleDragStart(index)}
88
- onDragOver={handleDragOver}
89
- onDrop={(e) => handleDrop(e, index)}
90
- style={{
91
- cursor: allowLightbox || onImageClick ? "pointer" : "default",
92
- }}
93
- >
94
- <img
95
- src={image}
96
- alt={`Gallery image ${index + 1}`}
97
- className={styles.galleryItemImage}
98
- />
99
-
100
- {/* Remove button */}
101
- {onImageRemove && (
102
- <button
103
- onClick={(e) => removeImage(index, e)}
104
- className={styles.removeButton}
105
- >
106
- <FontAwesomeIcon icon={iconImports.minusCircle} />
107
- </button>
108
- )}
109
-
110
- {/* Drag indicator */}
111
- {allowReordering && (
112
- <div className={styles.dragHandle}>
113
- <FontAwesomeIcon icon={iconImports.repeat} />
114
- </div>
115
- )}
116
- </div>
117
- ))}
118
- </div>
119
-
120
- {/* Lightbox */}
121
- {lightboxImage && (
122
- <div
123
- className={styles.lightbox}
124
- onClick={() => setLightboxImage(null)}
125
- >
126
- <img
127
- src={lightboxImage.image}
128
- alt={`Gallery image ${lightboxImage.index + 1}`}
129
- className={styles.lightboxImage}
130
- onClick={(e) => e.stopPropagation()}
131
- />
132
-
133
- {/* Lightbox close button */}
134
- <button
135
- onClick={() => setLightboxImage(null)}
136
- className={styles.lightboxClose}
137
- >
138
- ×
139
- </button>
140
-
141
- {/* Lightbox navigation */}
142
- {validImages.length > 1 && (
143
- <>
144
- {lightboxImage.index > 0 && (
145
- <button
146
- onClick={(e) => {
147
- e.stopPropagation();
148
- setLightboxImage({
149
- image: validImages[lightboxImage.index - 1],
150
- index: lightboxImage.index - 1,
151
- });
152
- }}
153
- className={`${styles.carouselNav} ${styles.carouselNavPrev}`}
154
- >
155
-
156
- </button>
157
- )}
158
- {lightboxImage.index < validImages.length - 1 && (
159
- <button
160
- onClick={(e) => {
161
- e.stopPropagation();
162
- setLightboxImage({
163
- image: validImages[lightboxImage.index + 1],
164
- index: lightboxImage.index + 1,
165
- });
166
- }}
167
- className={`${styles.carouselNav} ${styles.carouselNavNext}`}
168
- >
169
-
170
- </button>
171
- )}
172
- </>
173
- )}
174
- </div>
175
- )}
176
- </>
177
- );
178
- }
179
-
180
- // List Layout
181
- if (layout === "list") {
182
- return (
183
- <div className={styles.listContainer} style={style}>
184
- {validImages.map((image, index) => (
185
- <div key={index} className={styles.listItemContent}>
186
- <img
187
- src={image}
188
- alt={`Gallery image ${index + 1}`}
189
- className={styles.listItemImage}
190
- onClick={() => handleImageClick(image, index)}
191
- style={{
192
- cursor: allowLightbox || onImageClick ? "pointer" : "default",
193
- }}
194
- />
195
-
196
- <div className={styles.listItemText}>
197
- <Text type="bodyLarge" className={styles.listItemTitle}>
198
- Image {index + 1}
199
- </Text>
200
- </div>
201
-
202
- {/* Actions */}
203
- <div
204
- className={`${styles.listItemActions} ${styles.flex} ${styles.gap8}`}
205
- >
206
- {onImageRemove && (
207
- <button
208
- onClick={() => onImageRemove(index)}
209
- className={styles.removeButton}
210
- >
211
- <FontAwesomeIcon icon={iconImports.minusCircle} />
212
- </button>
213
- )}
214
- </div>
215
- </div>
216
- ))}
217
- </div>
218
- );
219
- }
220
-
221
- // Carousel Layout (simplified version)
222
- if (layout === "carousel") {
223
- const [currentIndex, setCurrentIndex] = useState(0);
224
-
225
- return (
226
- <div className={styles.carouselContainer} style={style}>
227
- <div className={styles.carouselItem}>
228
- {/* Current image */}
229
- <img
230
- src={validImages[currentIndex]}
231
- alt={`Gallery image ${currentIndex + 1}`}
232
- className={styles.galleryItemImage}
233
- onClick={() =>
234
- handleImageClick(validImages[currentIndex], currentIndex)
235
- }
236
- style={{
237
- cursor: allowLightbox || onImageClick ? "pointer" : "default",
238
- height: "400px",
239
- }}
240
- />
241
-
242
- {/* Navigation */}
243
- {validImages.length > 1 && (
244
- <>
245
- {currentIndex > 0 && (
246
- <button
247
- onClick={() => setCurrentIndex(currentIndex - 1)}
248
- className={`${styles.carouselNav} ${styles.carouselNavPrev}`}
249
- >
250
-
251
- </button>
252
- )}
253
- {currentIndex < validImages.length - 1 && (
254
- <button
255
- onClick={() => setCurrentIndex(currentIndex + 1)}
256
- className={`${styles.carouselNav} ${styles.carouselNavNext}`}
257
- >
258
-
259
- </button>
260
- )}
261
- </>
262
- )}
263
- </div>
264
-
265
- {/* Thumbnail strip */}
266
- {validImages.length > 1 && (
267
- <div
268
- style={{
269
- display: "flex",
270
- gap: "8px",
271
- marginTop: "12px",
272
- overflowX: "auto",
273
- padding: "8px 0",
274
- }}
275
- >
276
- {validImages.map((image, index) => (
277
- <img
278
- key={index}
279
- src={image}
280
- alt={`Thumbnail ${index + 1}`}
281
- style={{
282
- width: "60px",
283
- height: "60px",
284
- objectFit: "cover",
285
- borderRadius: "4px",
286
- border:
287
- index === currentIndex
288
- ? "2px solid var(--colour-branding-primary)"
289
- : "1px solid var(--border-line-grey)",
290
- cursor: "pointer",
291
- opacity: index === currentIndex ? 1 : 0.6,
292
- }}
293
- onClick={() => setCurrentIndex(index)}
294
- />
295
- ))}
296
- </div>
297
- )}
298
- </div>
299
- );
300
- }
301
-
302
- // Fallback to grid
303
- return (
304
- <div
305
- style={{
306
- display: "grid",
307
- gridTemplateColumns: `repeat(${columns}, 1fr)`,
308
- gap: "12px",
309
- ...style,
310
- }}
311
- >
312
- {validImages.map((image, index) => (
313
- <img
314
- key={index}
315
- src={image}
316
- alt={`Gallery image ${index + 1}`}
317
- style={{
318
- width: "100%",
319
- aspectRatio: "1",
320
- objectFit: "cover",
321
- borderRadius: "8px",
322
- border: "1px solid var(--border-line-grey)",
323
- }}
324
- />
325
- ))}
326
- </div>
327
- );
328
- };
329
-
330
- export default GalleryDisplay;
@@ -1,309 +0,0 @@
1
- /* Empty gallery container */
2
- .emptyGallery {
3
- border: 2px dashed var(--border-line-grey);
4
- border-radius: var(--border-radius-lg);
5
- padding: 2.5rem 1.25rem;
6
- text-align: center;
7
- }
8
-
9
- /* Empty gallery text */
10
- .emptyGalleryText {
11
- color: var(--text-bluegrey);
12
- }
13
-
14
- /* Grid layout container */
15
- .gridContainer {
16
- display: grid;
17
- grid-template-columns: repeat(var(--columns, 3), 1fr);
18
- gap: 1rem;
19
- }
20
-
21
- /* List layout container */
22
- .listContainer {
23
- display: flex;
24
- flex-direction: column;
25
- gap: 1rem;
26
- }
27
-
28
- /* Carousel container */
29
- .carouselContainer {
30
- position: relative;
31
- overflow: hidden;
32
- border-radius: var(--border-radius-lg);
33
- }
34
-
35
- /* Carousel track */
36
- .carouselTrack {
37
- display: flex;
38
- transition: transform var(--transition-base) ease;
39
- }
40
-
41
- /* Carousel item */
42
- .carouselItem {
43
- flex: 0 0 100%;
44
- width: 100%;
45
- }
46
-
47
- /* Carousel navigation */
48
- .carouselNav {
49
- position: absolute;
50
- top: 50%;
51
- transform: translateY(-50%);
52
- background: rgba(0, 0, 0, 0.5);
53
- color: white;
54
- border: none;
55
- border-radius: var(--border-radius-full);
56
- width: 2.5rem;
57
- height: 2.5rem;
58
- display: flex;
59
- align-items: center;
60
- justify-content: center;
61
- cursor: pointer;
62
- transition: background var(--transition-base) ease;
63
- }
64
-
65
- .carouselNav:hover {
66
- background: rgba(0, 0, 0, 0.7);
67
- }
68
-
69
- .carouselNavPrev {
70
- left: 0.75rem;
71
- }
72
-
73
- .carouselNavNext {
74
- right: 0.75rem;
75
- }
76
-
77
- /* Gallery item */
78
- .galleryItem {
79
- position: relative;
80
- border-radius: var(--border-radius-lg);
81
- overflow: hidden;
82
- background-color: var(--bg-bluegrey);
83
- cursor: pointer;
84
- transition:
85
- transform var(--transition-base) ease,
86
- box-shadow var(--transition-base) ease;
87
- }
88
-
89
- .galleryItem:hover {
90
- transform: translateY(-2px);
91
- box-shadow: var(--shadow-lg);
92
- }
93
-
94
- /* Gallery item image */
95
- .galleryItemImage {
96
- width: 100%;
97
- height: 12.5rem;
98
- object-fit: cover;
99
- display: block;
100
- }
101
-
102
- /* List item image */
103
- .listItemImage {
104
- width: 120px;
105
- height: 120px;
106
- object-fit: cover;
107
- border-radius: var(--border-radius-lg);
108
- flex-shrink: 0;
109
- }
110
-
111
- /* Remove button */
112
- .removeButton {
113
- position: absolute;
114
- top: 0.5rem;
115
- right: 0.5rem;
116
- background: transparent;
117
- color: var(--colour-branding-primary);
118
- border: none;
119
- border-radius: var(--border-radius-full);
120
- width: 1.75rem;
121
- height: 1.75rem;
122
- display: flex;
123
- align-items: center;
124
- justify-content: center;
125
- cursor: pointer;
126
- opacity: 0;
127
- transition: opacity var(--transition-base) ease;
128
- }
129
-
130
- .galleryItem:hover .removeButton {
131
- opacity: 1;
132
- }
133
-
134
- /* Dragging state */
135
- .dragging {
136
- opacity: 0.5;
137
- }
138
-
139
- .dragOver {
140
- border: 2px dashed var(--colour-branding-action);
141
- }
142
-
143
- /* Lightbox */
144
- .lightbox {
145
- position: fixed;
146
- top: 0;
147
- left: 0;
148
- right: 0;
149
- bottom: 0;
150
- background: rgba(0, 0, 0, 0.9);
151
- z-index: 1000;
152
- display: flex;
153
- align-items: center;
154
- justify-content: center;
155
- }
156
-
157
- .lightboxImage {
158
- max-width: 90%;
159
- max-height: 90%;
160
- object-fit: contain;
161
- border-radius: var(--border-radius-lg);
162
- }
163
-
164
- .lightboxClose {
165
- position: absolute;
166
- top: 1.25rem;
167
- right: 1.25rem;
168
- background: rgba(255, 255, 255, 0.2);
169
- color: white;
170
- border: none;
171
- border-radius: var(--border-radius-full);
172
- width: 2.5rem;
173
- height: 2.5rem;
174
- display: flex;
175
- align-items: center;
176
- justify-content: center;
177
- cursor: pointer;
178
- transition: background var(--transition-base) ease;
179
- }
180
-
181
- .lightboxClose:hover {
182
- background: rgba(255, 255, 255, 0.3);
183
- }
184
-
185
- /* List item content */
186
- .listItemContent {
187
- display: flex;
188
- gap: 1rem;
189
- align-items: center;
190
- padding: 1rem;
191
- background-color: var(--bg-white);
192
- border-radius: var(--border-radius-lg);
193
- border: 1px solid var(--border-line-grey);
194
- }
195
-
196
- .listItemText {
197
- flex: 1;
198
- }
199
-
200
- .listItemTitle {
201
- margin-bottom: 0.1rem;
202
- }
203
-
204
- .listItemActions {
205
- display: flex;
206
- gap: 8px;
207
- }
208
-
209
- /* List layout remove button (always visible) */
210
- .listItemContent .removeButton {
211
- opacity: 1;
212
- position: static;
213
- background: transparent;
214
- color: var(--colour-branding-primary);
215
- }
216
-
217
- /* Drag handle */
218
- .dragHandle {
219
- position: absolute;
220
- top: 50%;
221
- left: 50%;
222
- transform: translate(-50%, -50%);
223
- background: rgba(0, 0, 0, 0.5);
224
- color: white;
225
- border: none;
226
- border-radius: var(--border-radius-base);
227
- padding: 0.1rem 0.2rem;
228
- font-size: var(--font-size-xs);
229
- cursor: move;
230
- opacity: 0;
231
- transition: opacity var(--transition-base) ease;
232
- }
233
-
234
- .galleryItem:hover .dragHandle {
235
- opacity: 1;
236
- }
237
-
238
- /* Carousel dots */
239
- .carouselDots {
240
- display: flex;
241
- justify-content: center;
242
- gap: 8px;
243
- margin-top: 12px;
244
- }
245
-
246
- .carouselDot {
247
- width: 8px;
248
- height: 8px;
249
- border-radius: 50%;
250
- background: var(--border-line-grey);
251
- cursor: pointer;
252
- transition: background var(--transition-base) ease;
253
- }
254
-
255
- .carouselDot.active {
256
- background: var(--colour-branding-action);
257
- }
258
-
259
- /* Reorder button */
260
- .reorderButton {
261
- background: var(--colour-branding-action);
262
- color: white;
263
- border: none;
264
- border-radius: var(--border-radius-base);
265
- padding: 0.1rem 0.2rem;
266
- font-size: var(--font-size-xs);
267
- cursor: pointer;
268
- transition: background var(--transition-base) ease;
269
- }
270
-
271
- .reorderButton:hover {
272
- background: var(--colour-branding-action-hover);
273
- }
274
-
275
- /* Text styling */
276
- .textBlueGrey {
277
- color: var(--text-bluegrey);
278
- }
279
-
280
- /* Flex utilities */
281
- .flex1 {
282
- flex: 1;
283
- }
284
-
285
- .flex {
286
- display: flex;
287
- }
288
-
289
- .gap8 {
290
- gap: 0.2rem;
291
- }
292
-
293
- .listItemActions {
294
- display: flex;
295
- gap: 0.2rem;
296
- }
297
-
298
- /* Carousel navigation specific styling for carousel layout */
299
- .carouselNav:not(.carouselNavPrev):not(.carouselNavNext) {
300
- left: 0.3rem;
301
- }
302
-
303
- .carouselNav.carouselNavPrev {
304
- left: 0.3rem;
305
- }
306
-
307
- .carouselNav.carouselNavNext {
308
- right: 12px;
309
- }
@@ -1,82 +0,0 @@
1
- import React from "react";
2
- import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
3
- import { GenericInput, Text } from "../index.js";
4
- import { iconImports } from "../iconImports.js";
5
- import styles from "./ListingField.module.css";
6
-
7
- const ListingCTAInput = ({
8
- field,
9
- value,
10
- onChange,
11
- showError,
12
- errorMessage,
13
- }) => {
14
- const { label, placeholder, isRequired } = field.values;
15
-
16
- // CTA field value should contain both label and url
17
- const fieldValue = value || {};
18
- const buttonLabel = fieldValue.label || "";
19
- const buttonUrl = fieldValue.url || "";
20
-
21
- const handleLabelChange = (e) => {
22
- const newValue = { ...fieldValue, label: e.target.value };
23
- onChange(field.id, newValue);
24
- };
25
-
26
- const handleUrlChange = (e) => {
27
- const newValue = { ...fieldValue, url: e.target.value };
28
- onChange(field.id, newValue);
29
- };
30
-
31
- const createLabel = (text, required) => (
32
- <>
33
- {text}
34
- {required && <span className={styles.requiredAsterisk}>*</span>}
35
- </>
36
- );
37
-
38
- return (
39
- <>
40
- {/* Field header with icon and description */}
41
- <div className={styles.listingField__header}>
42
- <div className={styles.listingField__icon}>
43
- <FontAwesomeIcon icon={iconImports.link} />
44
- </div>
45
- <div className={styles.listingField__content}>
46
- <h3 className={styles.listingField__title}>Action Button</h3>
47
- <p className={styles.listingField__description}>
48
- Create clickable buttons with custom text and links
49
- </p>
50
- </div>
51
- </div>
52
-
53
- <GenericInput
54
- type="text"
55
- label={createLabel(`${label} - Button Text`, isRequired)}
56
- placeholder="Enter button text"
57
- value={buttonLabel}
58
- onChange={handleLabelChange}
59
- isRequired={isRequired}
60
- isValid={!isRequired || buttonLabel.trim().length > 0}
61
- showError={showError && isRequired && buttonLabel.trim().length === 0}
62
- errorMessage="Button text is required"
63
- alwaysShowLabel
64
- />
65
- <GenericInput
66
- type="text"
67
- label={createLabel(`${label} - Button URL`, isRequired)}
68
- placeholder="Enter button URL (e.g., https://example.com)"
69
- value={buttonUrl}
70
- onChange={handleUrlChange}
71
- isRequired={isRequired}
72
- isValid={!isRequired || buttonUrl.trim().length > 0}
73
- showError={showError && isRequired && buttonUrl.trim().length === 0}
74
- errorMessage="Button URL is required"
75
- help="Enter the full URL including https:// or http://"
76
- alwaysShowLabel
77
- />
78
- </>
79
- );
80
- };
81
-
82
- export default ListingCTAInput;