contentoh-components-library 21.5.85 → 21.5.86
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/dist/components/atoms/GeneralButton/styles.js +1 -1
- package/dist/components/organisms/ChangeStatusModal/index.js +531 -0
- package/dist/components/organisms/ChangeStatusModal/styles.js +85 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +108 -231
- package/dist/components/pages/RetailerProductEdition/context/reducers/product.js +48 -2
- package/dist/components/pages/RetailerProductEdition/index.js +329 -101
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/global-files/statusDictionary.js +103 -0
- package/package.json +1 -1
- package/src/components/atoms/GeneralButton/styles.js +4 -0
- package/src/components/organisms/ChangeStatusModal/index.jsx +488 -0
- package/src/components/organisms/ChangeStatusModal/styles.js +333 -0
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +107 -259
- package/src/components/pages/RetailerProductEdition/context/reducers/product.js +55 -0
- package/src/components/pages/RetailerProductEdition/index.js +236 -78
- package/src/components/pages/RetailerProductEdition/styles.js +6 -0
- package/src/contexts/AiProductEdition.jsx +1 -0
- package/src/global-files/statusDictionary.js +103 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Dialog, Box, Button, TextField, Select, Chip, FormControl } from '@mui/material';
|
|
3
|
+
|
|
4
|
+
export const colors = {
|
|
5
|
+
background: 'rgba(0, 0, 0, 0.4)',
|
|
6
|
+
paper: '#FFFFFF',
|
|
7
|
+
primary: '#E039A7',
|
|
8
|
+
primaryHover: '#C82A91',
|
|
9
|
+
textMain: '#121212',
|
|
10
|
+
textMuted: '#666666',
|
|
11
|
+
border: '#E0E0E0',
|
|
12
|
+
inputBg: '#FFFFFF',
|
|
13
|
+
summaryBg: '#F9F9F9',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const StyledDialog = styled(Dialog)`
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
|
|
21
|
+
.MuiDialog-container {
|
|
22
|
+
width: 100%;
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
align-items: center;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.MuiDialog-paper {
|
|
29
|
+
background-color: ${colors.paper};
|
|
30
|
+
color: ${colors.textMain};
|
|
31
|
+
border-radius: 5px;
|
|
32
|
+
padding: 0;
|
|
33
|
+
max-width: 38.5rem;
|
|
34
|
+
max-height: 90vh;
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
width: 100%;
|
|
39
|
+
box-shadow: 0 8px 32px rgba(0,0,0,0.15);
|
|
40
|
+
font-family: "Raleway", sans-serif;
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
export const ModalHeader = styled(Box)`
|
|
45
|
+
flex-shrink: 0;
|
|
46
|
+
position: relative;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
padding: 20px 24px 16px;
|
|
50
|
+
gap: 1rem;
|
|
51
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
52
|
+
margin-bottom: 0.5rem;
|
|
53
|
+
|
|
54
|
+
.close-icon {
|
|
55
|
+
position: absolute;
|
|
56
|
+
top: 12px;
|
|
57
|
+
right: 12px;
|
|
58
|
+
color: ${colors.primary};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
h2 {
|
|
62
|
+
font-size: 1.35rem;
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
p {
|
|
67
|
+
margin: 0;
|
|
68
|
+
color: ${colors.textMuted};
|
|
69
|
+
font-size: 0.8rem;
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
export const BadgeCircle = styled(Box)`
|
|
74
|
+
width: 40px;
|
|
75
|
+
height: 40px;
|
|
76
|
+
border-radius: 50%;
|
|
77
|
+
border: 2px solid ${colors.primary};
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
background-color: ${colors.paper};
|
|
82
|
+
color: ${colors.primary};
|
|
83
|
+
|
|
84
|
+
svg {
|
|
85
|
+
font-size: 1.5rem;
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
export const MainSection = styled(Box)`
|
|
90
|
+
flex: 1;
|
|
91
|
+
overflow-y: auto;
|
|
92
|
+
padding-bottom: 20px;
|
|
93
|
+
|
|
94
|
+
&::-webkit-scrollbar {
|
|
95
|
+
width: 8px;
|
|
96
|
+
}
|
|
97
|
+
&::-webkit-scrollbar-track {
|
|
98
|
+
background: transparent;
|
|
99
|
+
}
|
|
100
|
+
&::-webkit-scrollbar-thumb {
|
|
101
|
+
background: #CCCCCC;
|
|
102
|
+
border-radius: 4px;
|
|
103
|
+
}
|
|
104
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
105
|
+
background: #999999;
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
108
|
+
|
|
109
|
+
export const Section = styled(Box)`
|
|
110
|
+
padding: 10px 32px;
|
|
111
|
+
`;
|
|
112
|
+
|
|
113
|
+
export const SectionTitle = styled.h3`
|
|
114
|
+
font-size: 0.9rem;
|
|
115
|
+
font-family: "Raleway-500", "Raleway", sans-serif;
|
|
116
|
+
color: ${colors.textMuted};
|
|
117
|
+
margin-bottom: 12px;
|
|
118
|
+
`;
|
|
119
|
+
|
|
120
|
+
export const ScopeButtonGroup = styled(Box)`
|
|
121
|
+
display: grid;
|
|
122
|
+
grid-template-columns: repeat(3, 1fr);
|
|
123
|
+
gap: 12px;
|
|
124
|
+
margin-bottom: 8px;
|
|
125
|
+
`;
|
|
126
|
+
|
|
127
|
+
export const ScopeButton = styled(Button)`
|
|
128
|
+
&& {
|
|
129
|
+
border-radius: 5px;
|
|
130
|
+
text-transform: none;
|
|
131
|
+
text-wrap: nowrap;
|
|
132
|
+
font-weight: 600;
|
|
133
|
+
font-size: 12px;
|
|
134
|
+
padding: 0.4rem 1rem;
|
|
135
|
+
background-color: ${(props) => (props.active ? colors.primary : 'transparent')};
|
|
136
|
+
color: ${(props) => (props.active ? '#FFFFFF' : colors.textMuted)};
|
|
137
|
+
border: 1px solid ${(props) => (props.active ? colors.primary : colors.border)};
|
|
138
|
+
font-family: "Raleway-500", "Raleway", sans-serif;
|
|
139
|
+
|
|
140
|
+
&:hover {
|
|
141
|
+
background-color: ${(props) => (props.active ? colors.primaryHover : colors.summaryBg)};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
svg {
|
|
145
|
+
margin-right: 8px;
|
|
146
|
+
font-size: 18px;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
`;
|
|
150
|
+
|
|
151
|
+
export const HelperText = styled.p`
|
|
152
|
+
font-size: 0.8rem;
|
|
153
|
+
color: ${colors.textMuted};
|
|
154
|
+
margin: 8px 0 0;
|
|
155
|
+
font-family: "Raleway", sans-serif;
|
|
156
|
+
`;
|
|
157
|
+
|
|
158
|
+
export const StatusPill = styled(Chip)`
|
|
159
|
+
&& {
|
|
160
|
+
background-color: ${(props) => (props.selected ? colors.primary : props.disabled ? '#603888' : 'transparent')};
|
|
161
|
+
color: ${(props) => (props.selected ? '#FFFFFF' : props.disabled ? 'white' : 'rgba(0, 0, 0, 0.45)')};
|
|
162
|
+
border: 1px solid ${(props) => props.selected ? colors.primary : 'rgba(0, 0, 0, 0.25)'};
|
|
163
|
+
font-weight: 600;
|
|
164
|
+
border-radius: 5px;
|
|
165
|
+
opacity: 1 !important;
|
|
166
|
+
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
|
|
167
|
+
font-family: "Raleway", sans-serif;
|
|
168
|
+
|
|
169
|
+
&:hover {
|
|
170
|
+
background-color: ${(props) =>
|
|
171
|
+
props.disabled
|
|
172
|
+
? 'transparent'
|
|
173
|
+
: (props.selected ? colors.primaryHover : 'rgba(0, 0, 0, 0.05)')};
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
`;
|
|
177
|
+
|
|
178
|
+
export const StatusGrid = styled(Box)`
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-wrap: wrap;
|
|
181
|
+
gap: 12px;
|
|
182
|
+
`;
|
|
183
|
+
|
|
184
|
+
export const StyledTextArea = styled(TextField)`
|
|
185
|
+
&& {
|
|
186
|
+
width: 100%;
|
|
187
|
+
background-color: ${colors.inputBg};
|
|
188
|
+
border-radius: 8px;
|
|
189
|
+
|
|
190
|
+
.MuiOutlinedInput-root {
|
|
191
|
+
font-size: 14px;
|
|
192
|
+
font-family: "Raleway", sans-serif;
|
|
193
|
+
color: ${colors.textMain};
|
|
194
|
+
fieldset {
|
|
195
|
+
border-color: ${colors.border};
|
|
196
|
+
}
|
|
197
|
+
&:hover fieldset {
|
|
198
|
+
border-color: #BDBDBD;
|
|
199
|
+
}
|
|
200
|
+
&.Mui-focused fieldset {
|
|
201
|
+
border-color: ${colors.primary};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
`;
|
|
206
|
+
|
|
207
|
+
export const StyledSelect = styled(Select)`
|
|
208
|
+
&& {
|
|
209
|
+
width: 100%;
|
|
210
|
+
background-color: ${colors.inputBg};
|
|
211
|
+
border-radius: 5px;
|
|
212
|
+
font-family: "Raleway", sans-serif;
|
|
213
|
+
font-size: 0.85rem;
|
|
214
|
+
margin-bottom: 12px;
|
|
215
|
+
|
|
216
|
+
.MuiSelect-select {
|
|
217
|
+
padding: 8px 12px;
|
|
218
|
+
display: flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
min-height: auto !important;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.MuiOutlinedInput-notchedOutline {
|
|
224
|
+
border-color: ${colors.border};
|
|
225
|
+
}
|
|
226
|
+
&:hover .MuiOutlinedInput-notchedOutline {
|
|
227
|
+
border-color: #BDBDBD;
|
|
228
|
+
}
|
|
229
|
+
&.Mui-focused .MuiOutlinedInput-notchedOutline {
|
|
230
|
+
border-color: ${colors.primary};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.MuiSvgIcon-root {
|
|
234
|
+
color: ${colors.textMuted};
|
|
235
|
+
font-size: 1.2rem;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
`;
|
|
239
|
+
|
|
240
|
+
export const StyledFormControl = styled(FormControl)`
|
|
241
|
+
&& {
|
|
242
|
+
.MuiInputLabel-root {
|
|
243
|
+
font-family: "Raleway", sans-serif;
|
|
244
|
+
font-size: 0.85rem;
|
|
245
|
+
color: ${colors.textMuted};
|
|
246
|
+
transform: translate(14px, 10px) scale(1);
|
|
247
|
+
|
|
248
|
+
&.MuiInputLabel-shrink {
|
|
249
|
+
transform: translate(14px, -8px) scale(0.75);
|
|
250
|
+
color: ${colors.primary};
|
|
251
|
+
background-color: #fff;
|
|
252
|
+
padding: 0 6px;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
`;
|
|
257
|
+
|
|
258
|
+
export const FooterActions = styled(Box)`
|
|
259
|
+
flex-shrink: 0;
|
|
260
|
+
display: flex;
|
|
261
|
+
justify-content: flex-end;
|
|
262
|
+
gap: 16px;
|
|
263
|
+
padding: 16px 32px;
|
|
264
|
+
background-color: ${colors.paper};
|
|
265
|
+
border-top: 1px solid ${colors.border};
|
|
266
|
+
`;
|
|
267
|
+
|
|
268
|
+
export const ActionButton = styled(Button)`
|
|
269
|
+
&& {
|
|
270
|
+
text-transform: none;
|
|
271
|
+
font-family: "Raleway-500", "Raleway", sans-serif;
|
|
272
|
+
padding: 4px 16px;
|
|
273
|
+
border-radius: 5px;
|
|
274
|
+
|
|
275
|
+
&.cancel {
|
|
276
|
+
color: ${colors.textMain};
|
|
277
|
+
border: 1px solid ${colors.border};
|
|
278
|
+
&:hover {
|
|
279
|
+
background-color: ${colors.summaryBg};
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
&.submit {
|
|
284
|
+
background-color: ${colors.primary};
|
|
285
|
+
color: #FFFFFF;
|
|
286
|
+
&:hover {
|
|
287
|
+
background-color: ${colors.primaryHover};
|
|
288
|
+
}
|
|
289
|
+
&:disabled {
|
|
290
|
+
opacity: 0.5;
|
|
291
|
+
background-color: #CCCCCC;
|
|
292
|
+
color: #888888;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
`;
|
|
297
|
+
|
|
298
|
+
export const ImpactSummary = styled(Box)`
|
|
299
|
+
margin: 0 32px 32px;
|
|
300
|
+
padding: 20px;
|
|
301
|
+
background-color: ${colors.summaryBg};
|
|
302
|
+
border: 1px solid ${colors.border};
|
|
303
|
+
border-radius: 12px;
|
|
304
|
+
|
|
305
|
+
.summary-title {
|
|
306
|
+
font-family: "Raleway-500", "Raleway", sans-serif;
|
|
307
|
+
font-size: 0.9rem;
|
|
308
|
+
color: ${colors.textMuted};
|
|
309
|
+
margin-bottom: 16px;
|
|
310
|
+
display: block;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.status-flow {
|
|
314
|
+
display: flex;
|
|
315
|
+
align-items: center;
|
|
316
|
+
gap: 12px;
|
|
317
|
+
margin-bottom: 16px;
|
|
318
|
+
color: ${colors.textMain};
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.impact-counts {
|
|
322
|
+
display: flex;
|
|
323
|
+
gap: 24px;
|
|
324
|
+
color: ${colors.textMuted};
|
|
325
|
+
font-size: 0.85rem;
|
|
326
|
+
|
|
327
|
+
div {
|
|
328
|
+
display: flex;
|
|
329
|
+
align-items: center;
|
|
330
|
+
gap: 8px;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
`;
|