contentoh-components-library 21.6.60 → 21.6.61

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 (76) hide show
  1. package/dist/components/organisms/ServicesNavigation/ServiceToolbar.js +210 -0
  2. package/dist/components/organisms/ServicesNavigation/ServicesNavigation.stories.js +138 -0
  3. package/dist/components/organisms/ServicesNavigation/ServicesRail.js +705 -0
  4. package/dist/components/organisms/ServicesNavigation/catalog.js +505 -0
  5. package/dist/components/organisms/ServicesNavigation/index.js +337 -0
  6. package/dist/components/organisms/ServicesNavigation/model.js +167 -0
  7. package/dist/components/organisms/ServicesNavigation/ui.js +371 -0
  8. package/dist/components/organisms/ServicesNavigation/views.js +1237 -0
  9. package/dist/components/organisms/ServicesWorkspace/AssigneePicker.js +459 -0
  10. package/dist/components/organisms/ServicesWorkspace/ServicesWorkspace.stories.js +119 -0
  11. package/dist/components/organisms/ServicesWorkspace/demo.js +137 -0
  12. package/dist/components/organisms/ServicesWorkspace/index.js +813 -0
  13. package/dist/components/organisms/ServicesWorkspace/servicesModel.js +351 -0
  14. package/dist/components/organisms/ServicesWorkspace/tooltipStyles.js +37 -0
  15. package/dist/components/pages/CreatorsProductEdition/mocks/mockApi.js +40 -0
  16. package/dist/components/pages/CreatorsProductEdition/mocks/productServices.fixtures.js +387 -0
  17. package/dist/components/pages/CreatorsProductEdition/sections/StatusChip.js +13 -4
  18. package/dist/components/pages/ProductEdition/ProductEdition.stories.js +148 -0
  19. package/dist/components/pages/ProductEdition/ProductEditionView.js +1355 -0
  20. package/dist/components/pages/ProductEdition/ServiceHeader.js +142 -0
  21. package/dist/components/pages/ProductEdition/api.js +256 -0
  22. package/dist/components/pages/ProductEdition/index.js +37 -0
  23. package/dist/components/pages/ProductEdition/permissions.js +200 -0
  24. package/dist/components/pages/ProductEdition/permissions.test.js +320 -0
  25. package/dist/components/pages/ProductEdition/sections/CatalogServicePanel.js +237 -0
  26. package/dist/components/pages/ProductEdition/sections/EditionTopBar.js +174 -0
  27. package/dist/components/pages/ProductEdition/sections/ImagePanel.js +440 -0
  28. package/dist/components/pages/ProductEdition/sections/ServiceTeam.js +275 -0
  29. package/dist/components/pages/ProductEdition/sections/ServiceTools.js +186 -0
  30. package/dist/components/pages/ProductEdition/services.js +233 -0
  31. package/dist/components/pages/ProductEdition/services.test.js +195 -0
  32. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +15 -2
  33. package/dist/components/pages/RetailerProductEdition/index.js +57 -40
  34. package/dist/components/pages/RetailerProductEdition/utils.js +6 -2
  35. package/dist/index.js +13 -0
  36. package/package.json +1 -1
  37. package/src/components/organisms/ServicesNavigation/ServiceToolbar.jsx +143 -0
  38. package/src/components/organisms/ServicesNavigation/ServicesNavigation.stories.js +101 -0
  39. package/src/components/organisms/ServicesNavigation/ServicesRail.jsx +591 -0
  40. package/src/components/organisms/ServicesNavigation/catalog.js +180 -0
  41. package/src/components/organisms/ServicesNavigation/index.jsx +232 -0
  42. package/src/components/organisms/ServicesNavigation/model.js +85 -0
  43. package/src/components/organisms/ServicesNavigation/ui.jsx +229 -0
  44. package/src/components/organisms/ServicesNavigation/views.jsx +705 -0
  45. package/src/components/organisms/ServicesWorkspace/AssigneePicker.js +348 -0
  46. package/src/components/organisms/ServicesWorkspace/ServicesWorkspace.stories.js +61 -0
  47. package/src/components/organisms/ServicesWorkspace/demo.js +58 -0
  48. package/src/components/organisms/ServicesWorkspace/index.js +556 -0
  49. package/src/components/organisms/ServicesWorkspace/servicesModel.js +203 -0
  50. package/src/components/organisms/ServicesWorkspace/tooltipStyles.js +27 -0
  51. package/src/components/pages/CreatorsProductEdition/mocks/mockApi.js +17 -0
  52. package/src/components/pages/CreatorsProductEdition/mocks/productServices.fixtures.js +175 -0
  53. package/src/components/pages/CreatorsProductEdition/sections/StatusChip.jsx +8 -4
  54. package/src/components/pages/ProductEdition/ProductEdition.stories.js +106 -0
  55. package/src/components/pages/ProductEdition/ProductEditionView.jsx +1142 -0
  56. package/src/components/pages/ProductEdition/ServiceHeader.jsx +104 -0
  57. package/src/components/pages/ProductEdition/api.js +84 -0
  58. package/src/components/pages/ProductEdition/index.js +21 -0
  59. package/src/components/pages/ProductEdition/permissions.js +128 -0
  60. package/src/components/pages/ProductEdition/permissions.test.js +249 -0
  61. package/src/components/pages/ProductEdition/sections/CatalogServicePanel.jsx +123 -0
  62. package/src/components/pages/ProductEdition/sections/EditionTopBar.jsx +134 -0
  63. package/src/components/pages/ProductEdition/sections/ImagePanel.jsx +342 -0
  64. package/src/components/pages/ProductEdition/sections/ServiceTeam.jsx +184 -0
  65. package/src/components/pages/ProductEdition/sections/ServiceTools.jsx +134 -0
  66. package/src/components/pages/ProductEdition/services.js +187 -0
  67. package/src/components/pages/ProductEdition/services.test.js +88 -0
  68. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +12 -0
  69. package/src/components/pages/RetailerProductEdition/index.js +28 -3
  70. package/src/components/pages/RetailerProductEdition/utils.js +5 -0
  71. package/src/index.js +1 -0
  72. package/.claude/settings.local.json +0 -7
  73. package/dist/ai/prompts/attribute.prompt.js +0 -28
  74. package/dist/ai/prompts/description.prompt.js +0 -33
  75. package/dist/ai/schemas/attribute.schema.js +0 -35
  76. package/dist/ai/schemas/description.schema.js +0 -27
@@ -0,0 +1,229 @@
1
+ import { Avatar, Box, Tooltip } from "@mui/material";
2
+ import ListAltOutlinedIcon from "@mui/icons-material/ListAltOutlined";
3
+ import LocalShippingOutlinedIcon from "@mui/icons-material/LocalShippingOutlined";
4
+ import ShoppingCartOutlinedIcon from "@mui/icons-material/ShoppingCartOutlined";
5
+ import ArticleOutlinedIcon from "@mui/icons-material/ArticleOutlined";
6
+ import TitleOutlinedIcon from "@mui/icons-material/TitleOutlined";
7
+ import TravelExploreOutlinedIcon from "@mui/icons-material/TravelExploreOutlined";
8
+ import TranslateOutlinedIcon from "@mui/icons-material/TranslateOutlined";
9
+ import ImageOutlinedIcon from "@mui/icons-material/ImageOutlined";
10
+ import PhotoCameraOutlinedIcon from "@mui/icons-material/PhotoCameraOutlined";
11
+ import AutoFixHighOutlinedIcon from "@mui/icons-material/AutoFixHighOutlined";
12
+ import AspectRatioOutlinedIcon from "@mui/icons-material/AspectRatioOutlined";
13
+ import DashboardCustomizeOutlinedIcon from "@mui/icons-material/DashboardCustomizeOutlined";
14
+ import WorkspacePremiumOutlinedIcon from "@mui/icons-material/WorkspacePremiumOutlined";
15
+ import MovieOutlinedIcon from "@mui/icons-material/MovieOutlined";
16
+ import ViewInArOutlinedIcon from "@mui/icons-material/ViewInArOutlined";
17
+ import StorefrontOutlinedIcon from "@mui/icons-material/StorefrontOutlined";
18
+ import WebOutlinedIcon from "@mui/icons-material/WebOutlined";
19
+ import InsertChartOutlinedIcon from "@mui/icons-material/InsertChartOutlined";
20
+ import VerifiedOutlinedIcon from "@mui/icons-material/VerifiedOutlined";
21
+ import FactCheckOutlinedIcon from "@mui/icons-material/FactCheckOutlined";
22
+ import PlaylistAddCheckOutlinedIcon from "@mui/icons-material/PlaylistAddCheckOutlined";
23
+ import PublishOutlinedIcon from "@mui/icons-material/PublishOutlined";
24
+ import SpaceDashboardOutlinedIcon from "@mui/icons-material/SpaceDashboardOutlined";
25
+ import InsertDriveFileOutlinedIcon from "@mui/icons-material/InsertDriveFileOutlined";
26
+ import EventRepeatOutlinedIcon from "@mui/icons-material/EventRepeatOutlined";
27
+ import BuildOutlinedIcon from "@mui/icons-material/BuildOutlined";
28
+ import GTranslateOutlinedIcon from "@mui/icons-material/GTranslateOutlined";
29
+ import AutoAwesomeOutlinedIcon from "@mui/icons-material/AutoAwesomeOutlined";
30
+ import ChairOutlinedIcon from "@mui/icons-material/ChairOutlined";
31
+ import RuleOutlinedIcon from "@mui/icons-material/RuleOutlined";
32
+ import ThumbsUpDownOutlinedIcon from "@mui/icons-material/ThumbsUpDownOutlined";
33
+ import FormatListBulletedOutlinedIcon from "@mui/icons-material/FormatListBulletedOutlined";
34
+ import EmojiEventsOutlinedIcon from "@mui/icons-material/EmojiEventsOutlined";
35
+ import ViewCarouselOutlinedIcon from "@mui/icons-material/ViewCarouselOutlined";
36
+ import ThreeDRotationOutlinedIcon from "@mui/icons-material/ThreeDRotationOutlined";
37
+ import ThreeSixtyOutlinedIcon from "@mui/icons-material/ThreeSixtyOutlined";
38
+ import MenuBookOutlinedIcon from "@mui/icons-material/MenuBookOutlined";
39
+ import CloudUploadOutlinedIcon from "@mui/icons-material/CloudUploadOutlined";
40
+ import CameraEnhanceOutlinedIcon from "@mui/icons-material/CameraEnhanceOutlined";
41
+ import PortraitOutlinedIcon from "@mui/icons-material/PortraitOutlined";
42
+ import WeekendOutlinedIcon from "@mui/icons-material/WeekendOutlined";
43
+ import HighQualityOutlinedIcon from "@mui/icons-material/HighQualityOutlined";
44
+ import ImageSearchOutlinedIcon from "@mui/icons-material/ImageSearchOutlined";
45
+ import HandymanOutlinedIcon from "@mui/icons-material/HandymanOutlined";
46
+
47
+ /*
48
+ Colores, tipografía y la etiqueta de estatus son los de la edición de
49
+ Creators (CreatorsProductEdition), para que el prototipo se vea como ella.
50
+ Si la propuesta se aprueba, estas piezas deberían salir de la página a un
51
+ lugar compartido.
52
+ */
53
+ import { COLORS, FONTS, statusColor as statusColorOf } from "../../pages/CreatorsProductEdition/sections/tokens";
54
+
55
+ export { COLORS, FONTS };
56
+ export { StatusChip } from "../../pages/CreatorsProductEdition/sections/StatusChip";
57
+
58
+ /**
59
+ * Props de StatusChip para un servicio de la lista. Los de flujo simple del
60
+ * catálogo (casilla, avance) muestran su nombre y su color en lugar del código.
61
+ */
62
+ export const serviceStatusColor = (service) =>
63
+ (service?.status_flow_type === "simple" && service.status_color) || statusColorOf(service?.status);
64
+
65
+ export const serviceStatusProps = (service) =>
66
+ service?.status_flow_type === "simple"
67
+ ? { status: service.status, label: service.status_label ?? service.status, color: service.status_color ?? undefined }
68
+ : { status: service?.status };
69
+ export { statusColor, statusName } from "../../pages/CreatorsProductEdition/sections/tokens";
70
+
71
+ export const FONT_STACK = `${FONTS.Lato}, "Avenir Next", sans-serif`;
72
+ export const TITLE_STACK = `${FONTS.Raleway}, ${FONTS.Lato}, sans-serif`;
73
+
74
+ const ICONS = {
75
+ summary: SpaceDashboardOutlinedIcon,
76
+ // Logística: mismas llaves que cat_service.icon_name.
77
+ pickup: LocalShippingOutlinedIcon,
78
+ purchase: ShoppingCartOutlinedIcon,
79
+ assembly: HandymanOutlinedIcon,
80
+ datasheet: ListAltOutlinedIcon,
81
+ description: ArticleOutlinedIcon,
82
+ header: TitleOutlinedIcon,
83
+ seo: TravelExploreOutlinedIcon,
84
+ translation: TranslateOutlinedIcon,
85
+ images: ImageOutlinedIcon,
86
+ photo: PhotoCameraOutlinedIcon,
87
+ edition: AutoFixHighOutlinedIcon,
88
+ resize: AspectRatioOutlinedIcon,
89
+ adaptations: DashboardCustomizeOutlinedIcon,
90
+ premium: WorkspacePremiumOutlinedIcon,
91
+ video: MovieOutlinedIcon,
92
+ image360: ThreeSixtyOutlinedIcon,
93
+ brandstore: StorefrontOutlinedIcon,
94
+ aplus: WebOutlinedIcon,
95
+ infographics: InsertChartOutlinedIcon,
96
+ quality: VerifiedOutlinedIcon,
97
+ audit: FactCheckOutlinedIcon,
98
+ secodat: PlaylistAddCheckOutlinedIcon,
99
+ upload: PublishOutlinedIcon,
100
+ followUp: EventRepeatOutlinedIcon,
101
+ maintenance: BuildOutlinedIcon,
102
+ graphicTranslation: GTranslateOutlinedIcon,
103
+ visualUpdate: AutoAwesomeOutlinedIcon,
104
+ ambient: ChairOutlinedIcon,
105
+ inputReview: RuleOutlinedIcon,
106
+ clientReview: ThumbsUpDownOutlinedIcon,
107
+ bullets: FormatListBulletedOutlinedIcon,
108
+ specialPhoto: CameraEnhanceOutlinedIcon,
109
+ modelPhoto: PortraitOutlinedIcon,
110
+ premiumAmbient: WeekendOutlinedIcon,
111
+ golden: EmojiEventsOutlinedIcon,
112
+ banner: ViewCarouselOutlinedIcon,
113
+ render: ThreeDRotationOutlinedIcon,
114
+ arModel: ViewInArOutlinedIcon,
115
+ manual: MenuBookOutlinedIcon,
116
+ visualQuality: HighQualityOutlinedIcon,
117
+ visualAudit: ImageSearchOutlinedIcon,
118
+ gdsn: CloudUploadOutlinedIcon,
119
+ visualMaintenance: HandymanOutlinedIcon,
120
+ };
121
+
122
+ export const ServiceIcon = ({ icon, sx }) => {
123
+ const Icon = ICONS[icon] ?? InsertDriveFileOutlinedIcon;
124
+ return <Icon sx={{ fontSize: 18, ...sx }} />;
125
+ };
126
+
127
+ /** Punto rosa: «te toca a ti». */
128
+ export const PendingDot = ({ size = 8, withTooltip = true }) => {
129
+ const dot = (
130
+ <Box
131
+ component="span"
132
+ aria-label="Te toca a ti"
133
+ sx={{
134
+ width: size,
135
+ height: size,
136
+ borderRadius: "50%",
137
+ bgcolor: COLORS.magenta_s2,
138
+ flexShrink: 0,
139
+ display: "inline-block",
140
+ }}
141
+ />
142
+ );
143
+ return withTooltip ? (
144
+ <Tooltip title="Te toca a ti" arrow placement="top">
145
+ {dot}
146
+ </Tooltip>
147
+ ) : (
148
+ dot
149
+ );
150
+ };
151
+
152
+ /** Iniciales de una persona; la persona que está viendo lleva borde rosa. */
153
+ export const PersonAvatar = ({ user, isMe = false, size = 26, title }) => (
154
+ <Tooltip title={title ?? ""} arrow placement="top" disableHoverListener={!title}>
155
+ <Avatar
156
+ sx={{
157
+ width: size,
158
+ height: size,
159
+ fontSize: size * 0.42,
160
+ fontFamily: FONT_STACK,
161
+ fontWeight: 700,
162
+ bgcolor: user ? COLORS.s2 : COLORS.white,
163
+ color: user ? COLORS.s5 : COLORS.s3,
164
+ border: `2px solid ${isMe ? COLORS.magenta_s2 : COLORS.white}`,
165
+ outline: user ? "none" : `1px dashed ${COLORS.s3}`,
166
+ outlineOffset: -3,
167
+ }}
168
+ >
169
+ {user ? `${user.name?.[0] ?? ""}${user.last_name?.[0] ?? ""}`.toUpperCase() : "?"}
170
+ </Avatar>
171
+ </Tooltip>
172
+ );
173
+
174
+ /** Botones redondeados de la plataforma (rosa lleno y contorno). */
175
+ export const pillButtonSx = {
176
+ textTransform: "none",
177
+ borderRadius: "20px",
178
+ fontFamily: FONT_STACK,
179
+ fontSize: 13,
180
+ fontWeight: 700,
181
+ height: 32,
182
+ px: 2,
183
+ boxShadow: "none",
184
+ whiteSpace: "nowrap",
185
+ };
186
+
187
+ export const primaryButtonSx = {
188
+ ...pillButtonSx,
189
+ bgcolor: COLORS.magenta_s2,
190
+ color: COLORS.white,
191
+ "&:hover": { bgcolor: COLORS.secondary_magenta, boxShadow: "none" },
192
+ };
193
+
194
+ export const outlineButtonSx = {
195
+ ...pillButtonSx,
196
+ color: COLORS.s5,
197
+ border: `1px solid ${COLORS.s3}`,
198
+ bgcolor: COLORS.white,
199
+ "&:hover": { bgcolor: COLORS.s2, borderColor: COLORS.s3 },
200
+ "&.Mui-disabled": { color: COLORS.s3, borderColor: COLORS.s2 },
201
+ };
202
+
203
+ /** Campo de texto con el foco rosa de la plataforma. */
204
+ export const fieldSx = {
205
+ "& .MuiOutlinedInput-root": {
206
+ borderRadius: "6px",
207
+ fontFamily: FONT_STACK,
208
+ fontSize: 14,
209
+ color: COLORS.color_gray,
210
+ bgcolor: COLORS.white,
211
+ "& fieldset": { borderColor: COLORS.s3 },
212
+ "&:hover fieldset": { borderColor: COLORS.s4 },
213
+ "&.Mui-focused fieldset": { borderColor: COLORS.magenta_s2 },
214
+ },
215
+ };
216
+
217
+ export const labelSx = {
218
+ fontFamily: FONT_STACK,
219
+ fontSize: 13,
220
+ fontWeight: 700,
221
+ color: COLORS.s5,
222
+ mb: 0.5,
223
+ };
224
+
225
+ export const captionSx = {
226
+ fontFamily: FONT_STACK,
227
+ fontSize: 12,
228
+ color: COLORS.s4,
229
+ };