design-zystem 1.0.272 → 1.0.274

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/index.css CHANGED
@@ -277,3 +277,161 @@
277
277
  color: #646b73;
278
278
  border-color: #cbd5e1;
279
279
  }
280
+
281
+ /* src/Components/Gantt/Gantt.css */
282
+ .dz-gantt {
283
+ border: 1px solid #e2e8f0;
284
+ border-radius: 10px;
285
+ overflow: hidden;
286
+ background: #fff;
287
+ color: #343a40;
288
+ width: 100%;
289
+ }
290
+ .dz-gantt__axis {
291
+ display: grid;
292
+ grid-template-columns: var(--dz-gantt-label-w) minmax(0, 1fr);
293
+ border-bottom: 1px solid #e2e8f0;
294
+ background: #f8fafc;
295
+ }
296
+ .dz-gantt__axis-label {
297
+ display: flex;
298
+ align-items: center;
299
+ height: 30px;
300
+ padding: 0 12px;
301
+ border-right: 1px solid #e2e8f0;
302
+ font-size: 10px;
303
+ font-weight: 700;
304
+ letter-spacing: 0.05em;
305
+ color: #94a3b8;
306
+ }
307
+ .dz-gantt__axis-days {
308
+ position: relative;
309
+ height: 30px;
310
+ }
311
+ .dz-gantt__axis-day {
312
+ position: absolute;
313
+ top: 0;
314
+ height: 100%;
315
+ display: flex;
316
+ align-items: center;
317
+ padding-left: 8px;
318
+ border-right: 1px solid #f1f5f9;
319
+ box-sizing: border-box;
320
+ font-size: 10px;
321
+ font-weight: 600;
322
+ color: #94a3b8;
323
+ white-space: nowrap;
324
+ }
325
+ .dz-gantt__body {
326
+ display: grid;
327
+ grid-template-columns: var(--dz-gantt-label-w) minmax(0, 1fr);
328
+ max-height: var(--dz-gantt-max-h);
329
+ overflow-y: auto;
330
+ overflow-x: hidden;
331
+ }
332
+ .dz-gantt__labels {
333
+ min-width: 0;
334
+ border-right: 1px solid #e2e8f0;
335
+ }
336
+ .dz-gantt__dot {
337
+ display: inline-block;
338
+ width: 9px;
339
+ height: 9px;
340
+ border-radius: 3px;
341
+ flex-shrink: 0;
342
+ }
343
+ .dz-gantt__labelrow {
344
+ height: var(--dz-gantt-row-h);
345
+ padding: 0 12px;
346
+ display: flex;
347
+ flex-direction: column;
348
+ justify-content: center;
349
+ gap: 2px;
350
+ min-width: 0;
351
+ overflow: hidden;
352
+ box-sizing: border-box;
353
+ transition: background 0.12s ease;
354
+ }
355
+ .dz-gantt__labelrow--alt {
356
+ background: #f8fafc;
357
+ }
358
+ .dz-gantt__labelrow--clickable {
359
+ cursor: pointer;
360
+ }
361
+ .dz-gantt__labelrow--clickable:hover {
362
+ background: #f1f5f9;
363
+ }
364
+ .dz-gantt__timeline-col {
365
+ min-width: 0;
366
+ overflow: hidden;
367
+ }
368
+ .dz-gantt__timeline {
369
+ position: relative;
370
+ width: 100%;
371
+ }
372
+ .dz-gantt__day {
373
+ position: absolute;
374
+ top: 0;
375
+ bottom: 0;
376
+ background: #fff;
377
+ border-right: 1px solid #f1f5f9;
378
+ box-sizing: border-box;
379
+ }
380
+ .dz-gantt__day--alt {
381
+ background: #f8fafc;
382
+ }
383
+ .dz-gantt__band {
384
+ position: absolute;
385
+ top: 0;
386
+ bottom: 0;
387
+ background: rgba(244, 70, 73, 0.1);
388
+ border-left: 1.5px solid #f44649;
389
+ border-right: 1.5px solid #f44649;
390
+ box-sizing: border-box;
391
+ pointer-events: none;
392
+ }
393
+ .dz-gantt__track {
394
+ position: absolute;
395
+ left: 0;
396
+ right: 0;
397
+ box-sizing: border-box;
398
+ }
399
+ .dz-gantt__track:not(:first-child) {
400
+ border-top: 1px solid #f1f5f9;
401
+ }
402
+ .dz-gantt__bar {
403
+ position: absolute;
404
+ top: 50%;
405
+ transform: translateY(-50%);
406
+ height: 22px;
407
+ min-width: 8px;
408
+ border-radius: 6px;
409
+ display: flex;
410
+ align-items: center;
411
+ padding: 0 8px;
412
+ box-sizing: border-box;
413
+ overflow: hidden;
414
+ background: var(--dz-gantt-bar-color, #94a3b8);
415
+ border: 1.5px solid var(--dz-gantt-bar-color, #94a3b8);
416
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
417
+ }
418
+ .dz-gantt__bar--approx {
419
+ border-style: dashed;
420
+ opacity: 0.9;
421
+ }
422
+ .dz-gantt__bar-label {
423
+ font-size: 10px;
424
+ font-weight: 600;
425
+ color: var(--dz-gantt-bar-text, #fff);
426
+ white-space: nowrap;
427
+ overflow: hidden;
428
+ text-overflow: ellipsis;
429
+ }
430
+ .dz-gantt__swatch {
431
+ display: inline-block;
432
+ width: 18px;
433
+ height: 12px;
434
+ border-radius: 3px;
435
+ flex-shrink: 0;
436
+ box-sizing: border-box;
437
+ }
package/dist/index.d.mts CHANGED
@@ -1070,6 +1070,52 @@ interface TimelineProps {
1070
1070
  */
1071
1071
  declare const Timeline: ({ items, lineColor, emptyLabel, }: TimelineProps) => react_jsx_runtime.JSX.Element;
1072
1072
 
1073
+ interface GanttDay {
1074
+ key: string | number;
1075
+ leftPct: number;
1076
+ widthPct: number;
1077
+ label: string;
1078
+ }
1079
+ interface GanttBar {
1080
+ leftPct: number;
1081
+ widthPct: number;
1082
+ color: string;
1083
+ textColor?: string;
1084
+ label?: string | null;
1085
+ title?: string;
1086
+ dashed?: boolean;
1087
+ }
1088
+ interface GanttRow<T = unknown> {
1089
+ key: string | number;
1090
+ bar?: GanttBar | null;
1091
+ data: T;
1092
+ }
1093
+ interface GanttBand {
1094
+ key: string | number;
1095
+ leftPct: number;
1096
+ widthPct: number;
1097
+ title?: string;
1098
+ }
1099
+ interface GanttProps<T = unknown> {
1100
+ days: GanttDay[];
1101
+ rows: GanttRow<T>[];
1102
+ bands?: GanttBand[];
1103
+ labelHeader?: string;
1104
+ renderLabel: (row: GanttRow<T>, index: number) => ReactNode;
1105
+ onRowClick?: (row: GanttRow<T>, index: number) => void;
1106
+ labelWidth?: number;
1107
+ rowHeight?: number;
1108
+ maxHeight?: number;
1109
+ }
1110
+ declare const Gantt: <T>({ days, rows, bands, labelHeader, renderLabel, onRowClick, labelWidth, rowHeight, maxHeight, }: GanttProps<T>) => react_jsx_runtime.JSX.Element;
1111
+ declare const GanttDot: ({ color }: {
1112
+ color: string;
1113
+ }) => react_jsx_runtime.JSX.Element;
1114
+ declare const GanttSwatch: ({ color, filled, }: {
1115
+ color: string;
1116
+ filled?: boolean;
1117
+ }) => react_jsx_runtime.JSX.Element;
1118
+
1073
1119
  /**
1074
1120
  * formatDate(date, type?, language?)
1075
1121
  * - language : fr/en/es/... (locale inferred), default "en"
@@ -1199,4 +1245,4 @@ declare const formatKM: (value: string | number | null | undefined) => string;
1199
1245
 
1200
1246
  declare const parseAmount: (value: string) => number | null;
1201
1247
 
1202
- export { Accordion, type AccordionItem, Avatar, Banner, type BannerAction, type BannerProps, Box, Bubble, Bulk, Button, Card, type CardProps, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, type DatePickerProps, type DatePreset, Divider, Drawer, EmptyState, FileUploadZone, type FloatingAction, FloatingButton, type FloatingButtonProps, Grid, Icon, IconTabs, Image, Input, Link, List, ListItem, MetricCard, Modal, ModalConfirmation, MultiSelect, NewModal, Options, PageContainer, Pagination, Popover, ProgressBar, Radio, Row, Select, type SelectOption, type SelectProps, SkeletonRow, SliderInput, type SortOrder, Spinner, Stepper, Switch, Table, TableBody, TableCell, TableFooter, TableFooterCell, TableFooterRow, TableHeader, TableHeaderCell, type TableHeaderCellProps, TableHeaderRow, TableRow, Tabs, TagBubble, Text, Timeline, type TimelineItem, type ToastOptions, type ToastType, Toaster, Tooltip, addBusinessDays, appendCacheBuster, appendQueryParam, capitalizeFirstLetter, colors, easterDate, formatAddress, formatCityFromFormattedAddress, formatCityWithPostalCode, formatDate, formatDateWithTime, formatDistance, formatDuration, formatEuro, formatKM, formatLocality, formatName, formatNameWithInitial, formatPhoneNumber, formatPlate, formatPlateWithoutDashes, formatPostalCodeFromFormattedAddress, formatRegionCode, formatTime, formatVin, generateHexColor, getAvatarColor, getCleanFileName, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getRelativeTime, isHoliday, isSameDay, isolateCity, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText };
1248
+ export { Accordion, type AccordionItem, Avatar, Banner, type BannerAction, type BannerProps, Box, Bubble, Bulk, Button, Card, type CardProps, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, type DatePickerProps, type DatePreset, Divider, Drawer, EmptyState, FileUploadZone, type FloatingAction, FloatingButton, type FloatingButtonProps, Gantt, type GanttBand, type GanttBar, type GanttDay, GanttDot, type GanttProps, type GanttRow, GanttSwatch, Grid, Icon, IconTabs, Image, Input, Link, List, ListItem, MetricCard, Modal, ModalConfirmation, MultiSelect, NewModal, Options, PageContainer, Pagination, Popover, ProgressBar, Radio, Row, Select, type SelectOption, type SelectProps, SkeletonRow, SliderInput, type SortOrder, Spinner, Stepper, Switch, Table, TableBody, TableCell, TableFooter, TableFooterCell, TableFooterRow, TableHeader, TableHeaderCell, type TableHeaderCellProps, TableHeaderRow, TableRow, Tabs, TagBubble, Text, Timeline, type TimelineItem, type ToastOptions, type ToastType, Toaster, Tooltip, addBusinessDays, appendCacheBuster, appendQueryParam, capitalizeFirstLetter, colors, easterDate, formatAddress, formatCityFromFormattedAddress, formatCityWithPostalCode, formatDate, formatDateWithTime, formatDistance, formatDuration, formatEuro, formatKM, formatLocality, formatName, formatNameWithInitial, formatPhoneNumber, formatPlate, formatPlateWithoutDashes, formatPostalCodeFromFormattedAddress, formatRegionCode, formatTime, formatVin, generateHexColor, getAvatarColor, getCleanFileName, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getRelativeTime, isHoliday, isSameDay, isolateCity, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText };
package/dist/index.d.ts CHANGED
@@ -1070,6 +1070,52 @@ interface TimelineProps {
1070
1070
  */
1071
1071
  declare const Timeline: ({ items, lineColor, emptyLabel, }: TimelineProps) => react_jsx_runtime.JSX.Element;
1072
1072
 
1073
+ interface GanttDay {
1074
+ key: string | number;
1075
+ leftPct: number;
1076
+ widthPct: number;
1077
+ label: string;
1078
+ }
1079
+ interface GanttBar {
1080
+ leftPct: number;
1081
+ widthPct: number;
1082
+ color: string;
1083
+ textColor?: string;
1084
+ label?: string | null;
1085
+ title?: string;
1086
+ dashed?: boolean;
1087
+ }
1088
+ interface GanttRow<T = unknown> {
1089
+ key: string | number;
1090
+ bar?: GanttBar | null;
1091
+ data: T;
1092
+ }
1093
+ interface GanttBand {
1094
+ key: string | number;
1095
+ leftPct: number;
1096
+ widthPct: number;
1097
+ title?: string;
1098
+ }
1099
+ interface GanttProps<T = unknown> {
1100
+ days: GanttDay[];
1101
+ rows: GanttRow<T>[];
1102
+ bands?: GanttBand[];
1103
+ labelHeader?: string;
1104
+ renderLabel: (row: GanttRow<T>, index: number) => ReactNode;
1105
+ onRowClick?: (row: GanttRow<T>, index: number) => void;
1106
+ labelWidth?: number;
1107
+ rowHeight?: number;
1108
+ maxHeight?: number;
1109
+ }
1110
+ declare const Gantt: <T>({ days, rows, bands, labelHeader, renderLabel, onRowClick, labelWidth, rowHeight, maxHeight, }: GanttProps<T>) => react_jsx_runtime.JSX.Element;
1111
+ declare const GanttDot: ({ color }: {
1112
+ color: string;
1113
+ }) => react_jsx_runtime.JSX.Element;
1114
+ declare const GanttSwatch: ({ color, filled, }: {
1115
+ color: string;
1116
+ filled?: boolean;
1117
+ }) => react_jsx_runtime.JSX.Element;
1118
+
1073
1119
  /**
1074
1120
  * formatDate(date, type?, language?)
1075
1121
  * - language : fr/en/es/... (locale inferred), default "en"
@@ -1199,4 +1245,4 @@ declare const formatKM: (value: string | number | null | undefined) => string;
1199
1245
 
1200
1246
  declare const parseAmount: (value: string) => number | null;
1201
1247
 
1202
- export { Accordion, type AccordionItem, Avatar, Banner, type BannerAction, type BannerProps, Box, Bubble, Bulk, Button, Card, type CardProps, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, type DatePickerProps, type DatePreset, Divider, Drawer, EmptyState, FileUploadZone, type FloatingAction, FloatingButton, type FloatingButtonProps, Grid, Icon, IconTabs, Image, Input, Link, List, ListItem, MetricCard, Modal, ModalConfirmation, MultiSelect, NewModal, Options, PageContainer, Pagination, Popover, ProgressBar, Radio, Row, Select, type SelectOption, type SelectProps, SkeletonRow, SliderInput, type SortOrder, Spinner, Stepper, Switch, Table, TableBody, TableCell, TableFooter, TableFooterCell, TableFooterRow, TableHeader, TableHeaderCell, type TableHeaderCellProps, TableHeaderRow, TableRow, Tabs, TagBubble, Text, Timeline, type TimelineItem, type ToastOptions, type ToastType, Toaster, Tooltip, addBusinessDays, appendCacheBuster, appendQueryParam, capitalizeFirstLetter, colors, easterDate, formatAddress, formatCityFromFormattedAddress, formatCityWithPostalCode, formatDate, formatDateWithTime, formatDistance, formatDuration, formatEuro, formatKM, formatLocality, formatName, formatNameWithInitial, formatPhoneNumber, formatPlate, formatPlateWithoutDashes, formatPostalCodeFromFormattedAddress, formatRegionCode, formatTime, formatVin, generateHexColor, getAvatarColor, getCleanFileName, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getRelativeTime, isHoliday, isSameDay, isolateCity, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText };
1248
+ export { Accordion, type AccordionItem, Avatar, Banner, type BannerAction, type BannerProps, Box, Bubble, Bulk, Button, Card, type CardProps, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, type DatePickerProps, type DatePreset, Divider, Drawer, EmptyState, FileUploadZone, type FloatingAction, FloatingButton, type FloatingButtonProps, Gantt, type GanttBand, type GanttBar, type GanttDay, GanttDot, type GanttProps, type GanttRow, GanttSwatch, Grid, Icon, IconTabs, Image, Input, Link, List, ListItem, MetricCard, Modal, ModalConfirmation, MultiSelect, NewModal, Options, PageContainer, Pagination, Popover, ProgressBar, Radio, Row, Select, type SelectOption, type SelectProps, SkeletonRow, SliderInput, type SortOrder, Spinner, Stepper, Switch, Table, TableBody, TableCell, TableFooter, TableFooterCell, TableFooterRow, TableHeader, TableHeaderCell, type TableHeaderCellProps, TableHeaderRow, TableRow, Tabs, TagBubble, Text, Timeline, type TimelineItem, type ToastOptions, type ToastType, Toaster, Tooltip, addBusinessDays, appendCacheBuster, appendQueryParam, capitalizeFirstLetter, colors, easterDate, formatAddress, formatCityFromFormattedAddress, formatCityWithPostalCode, formatDate, formatDateWithTime, formatDistance, formatDuration, formatEuro, formatKM, formatLocality, formatName, formatNameWithInitial, formatPhoneNumber, formatPlate, formatPlateWithoutDashes, formatPostalCodeFromFormattedAddress, formatRegionCode, formatTime, formatVin, generateHexColor, getAvatarColor, getCleanFileName, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getRelativeTime, isHoliday, isSameDay, isolateCity, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText };
package/dist/index.js CHANGED
@@ -78,6 +78,9 @@ __export(index_exports, {
78
78
  EmptyState: () => EmptyState,
79
79
  FileUploadZone: () => FileUploadZone,
80
80
  FloatingButton: () => FloatingButton,
81
+ Gantt: () => Gantt,
82
+ GanttDot: () => GanttDot,
83
+ GanttSwatch: () => GanttSwatch,
81
84
  Grid: () => Grid,
82
85
  Icon: () => Icon,
83
86
  IconTabs: () => IconTabs,
@@ -1640,7 +1643,12 @@ var import_react7 = require("react");
1640
1643
  var import_styled_components13 = __toESM(require("styled-components"));
1641
1644
 
1642
1645
  // src/Components/Toast/toastStore.ts
1643
- var DEFAULT_TIMEOUT = 2e3;
1646
+ var DEFAULT_TIMEOUT_BY_TYPE = {
1647
+ success: 2e3,
1648
+ info: 2e3,
1649
+ warning: 4e3,
1650
+ error: 5e3
1651
+ };
1644
1652
  var toasts = [];
1645
1653
  var nextId = 0;
1646
1654
  var listeners = /* @__PURE__ */ new Set();
@@ -1665,7 +1673,7 @@ var pushToast = (type, message, options = {}) => {
1665
1673
  type,
1666
1674
  message,
1667
1675
  title: options.title,
1668
- timeOut: (_a = options.timeOut) != null ? _a : DEFAULT_TIMEOUT
1676
+ timeOut: (_a = options.timeOut) != null ? _a : DEFAULT_TIMEOUT_BY_TYPE[type]
1669
1677
  }
1670
1678
  ];
1671
1679
  emitChange();
@@ -6103,6 +6111,121 @@ var Timeline = ({
6103
6111
  }) });
6104
6112
  };
6105
6113
 
6114
+ // src/Components/Gantt/Gantt.tsx
6115
+ var import_jsx_runtime63 = require("react/jsx-runtime");
6116
+ var Gantt = ({
6117
+ days,
6118
+ rows,
6119
+ bands = [],
6120
+ labelHeader,
6121
+ renderLabel,
6122
+ onRowClick,
6123
+ labelWidth = 220,
6124
+ rowHeight = 44,
6125
+ maxHeight = 380
6126
+ }) => {
6127
+ const bodyHeight = rows.length * rowHeight;
6128
+ const clickable = Boolean(onRowClick);
6129
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
6130
+ "div",
6131
+ {
6132
+ className: "dz-gantt",
6133
+ style: {
6134
+ ["--dz-gantt-label-w"]: `${labelWidth}px`,
6135
+ ["--dz-gantt-row-h"]: `${rowHeight}px`,
6136
+ ["--dz-gantt-max-h"]: `${maxHeight}px`
6137
+ },
6138
+ children: [
6139
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "dz-gantt__axis", children: [
6140
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "dz-gantt__axis-label", children: labelHeader }),
6141
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "dz-gantt__axis-days", children: days.map((day) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
6142
+ "div",
6143
+ {
6144
+ className: "dz-gantt__axis-day",
6145
+ style: { left: `${day.leftPct}%`, width: `${day.widthPct}%` },
6146
+ children: day.label
6147
+ },
6148
+ day.key
6149
+ )) })
6150
+ ] }),
6151
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "dz-gantt__body", children: [
6152
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "dz-gantt__labels", children: rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
6153
+ "div",
6154
+ {
6155
+ className: [
6156
+ "dz-gantt__labelrow",
6157
+ i % 2 === 1 ? "dz-gantt__labelrow--alt" : "",
6158
+ clickable ? "dz-gantt__labelrow--clickable" : ""
6159
+ ].filter(Boolean).join(" "),
6160
+ onClick: onRowClick ? () => onRowClick(row, i) : void 0,
6161
+ children: renderLabel(row, i)
6162
+ },
6163
+ row.key
6164
+ )) }),
6165
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "dz-gantt__timeline-col", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "dz-gantt__timeline", style: { height: bodyHeight }, children: [
6166
+ days.map((day, i) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
6167
+ "div",
6168
+ {
6169
+ className: `dz-gantt__day ${i % 2 === 1 ? "dz-gantt__day--alt" : ""}`,
6170
+ style: { left: `${day.leftPct}%`, width: `${day.widthPct}%` }
6171
+ },
6172
+ day.key
6173
+ )),
6174
+ bands.map((band) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
6175
+ "div",
6176
+ {
6177
+ className: "dz-gantt__band",
6178
+ title: band.title,
6179
+ style: { left: `${band.leftPct}%`, width: `${band.widthPct}%` }
6180
+ },
6181
+ band.key
6182
+ )),
6183
+ rows.map((row, i) => {
6184
+ var _a, _b, _c;
6185
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
6186
+ "div",
6187
+ {
6188
+ className: "dz-gantt__track",
6189
+ style: { top: i * rowHeight, height: rowHeight },
6190
+ children: row.bar && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
6191
+ "div",
6192
+ {
6193
+ className: `dz-gantt__bar ${row.bar.dashed ? "dz-gantt__bar--approx" : ""}`,
6194
+ title: (_b = (_a = row.bar.title) != null ? _a : row.bar.label) != null ? _b : void 0,
6195
+ style: {
6196
+ left: `${row.bar.leftPct}%`,
6197
+ width: `${row.bar.widthPct}%`,
6198
+ ["--dz-gantt-bar-color"]: row.bar.color,
6199
+ ["--dz-gantt-bar-text"]: (_c = row.bar.textColor) != null ? _c : "#fff"
6200
+ },
6201
+ children: row.bar.label && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "dz-gantt__bar-label", children: row.bar.label })
6202
+ }
6203
+ )
6204
+ },
6205
+ row.key
6206
+ );
6207
+ })
6208
+ ] }) })
6209
+ ] })
6210
+ ]
6211
+ }
6212
+ );
6213
+ };
6214
+ var GanttDot = ({ color }) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "dz-gantt__dot", style: { background: color } });
6215
+ var GanttSwatch = ({
6216
+ color,
6217
+ filled = true
6218
+ }) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
6219
+ "span",
6220
+ {
6221
+ className: "dz-gantt__swatch",
6222
+ style: {
6223
+ background: filled ? color : "transparent",
6224
+ border: `1.5px solid ${color}`
6225
+ }
6226
+ }
6227
+ );
6228
+
6106
6229
  // src/data/globalMethods.ts
6107
6230
  var formatDate = (dateString, type = "date", language = "en") => {
6108
6231
  if (!dateString) return "";
@@ -6757,6 +6880,9 @@ var parseAmount = (value) => {
6757
6880
  EmptyState,
6758
6881
  FileUploadZone,
6759
6882
  FloatingButton,
6883
+ Gantt,
6884
+ GanttDot,
6885
+ GanttSwatch,
6760
6886
  Grid,
6761
6887
  Icon,
6762
6888
  IconTabs,
package/dist/index.mjs CHANGED
@@ -1504,7 +1504,12 @@ import { useCallback as useCallback2, useEffect as useEffect5, useState as useSt
1504
1504
  import styled13, { keyframes } from "styled-components";
1505
1505
 
1506
1506
  // src/Components/Toast/toastStore.ts
1507
- var DEFAULT_TIMEOUT = 2e3;
1507
+ var DEFAULT_TIMEOUT_BY_TYPE = {
1508
+ success: 2e3,
1509
+ info: 2e3,
1510
+ warning: 4e3,
1511
+ error: 5e3
1512
+ };
1508
1513
  var toasts = [];
1509
1514
  var nextId = 0;
1510
1515
  var listeners = /* @__PURE__ */ new Set();
@@ -1529,7 +1534,7 @@ var pushToast = (type, message, options = {}) => {
1529
1534
  type,
1530
1535
  message,
1531
1536
  title: options.title,
1532
- timeOut: (_a = options.timeOut) != null ? _a : DEFAULT_TIMEOUT
1537
+ timeOut: (_a = options.timeOut) != null ? _a : DEFAULT_TIMEOUT_BY_TYPE[type]
1533
1538
  }
1534
1539
  ];
1535
1540
  emitChange();
@@ -5987,6 +5992,121 @@ var Timeline = ({
5987
5992
  }) });
5988
5993
  };
5989
5994
 
5995
+ // src/Components/Gantt/Gantt.tsx
5996
+ import { jsx as jsx63, jsxs as jsxs36 } from "react/jsx-runtime";
5997
+ var Gantt = ({
5998
+ days,
5999
+ rows,
6000
+ bands = [],
6001
+ labelHeader,
6002
+ renderLabel,
6003
+ onRowClick,
6004
+ labelWidth = 220,
6005
+ rowHeight = 44,
6006
+ maxHeight = 380
6007
+ }) => {
6008
+ const bodyHeight = rows.length * rowHeight;
6009
+ const clickable = Boolean(onRowClick);
6010
+ return /* @__PURE__ */ jsxs36(
6011
+ "div",
6012
+ {
6013
+ className: "dz-gantt",
6014
+ style: {
6015
+ ["--dz-gantt-label-w"]: `${labelWidth}px`,
6016
+ ["--dz-gantt-row-h"]: `${rowHeight}px`,
6017
+ ["--dz-gantt-max-h"]: `${maxHeight}px`
6018
+ },
6019
+ children: [
6020
+ /* @__PURE__ */ jsxs36("div", { className: "dz-gantt__axis", children: [
6021
+ /* @__PURE__ */ jsx63("div", { className: "dz-gantt__axis-label", children: labelHeader }),
6022
+ /* @__PURE__ */ jsx63("div", { className: "dz-gantt__axis-days", children: days.map((day) => /* @__PURE__ */ jsx63(
6023
+ "div",
6024
+ {
6025
+ className: "dz-gantt__axis-day",
6026
+ style: { left: `${day.leftPct}%`, width: `${day.widthPct}%` },
6027
+ children: day.label
6028
+ },
6029
+ day.key
6030
+ )) })
6031
+ ] }),
6032
+ /* @__PURE__ */ jsxs36("div", { className: "dz-gantt__body", children: [
6033
+ /* @__PURE__ */ jsx63("div", { className: "dz-gantt__labels", children: rows.map((row, i) => /* @__PURE__ */ jsx63(
6034
+ "div",
6035
+ {
6036
+ className: [
6037
+ "dz-gantt__labelrow",
6038
+ i % 2 === 1 ? "dz-gantt__labelrow--alt" : "",
6039
+ clickable ? "dz-gantt__labelrow--clickable" : ""
6040
+ ].filter(Boolean).join(" "),
6041
+ onClick: onRowClick ? () => onRowClick(row, i) : void 0,
6042
+ children: renderLabel(row, i)
6043
+ },
6044
+ row.key
6045
+ )) }),
6046
+ /* @__PURE__ */ jsx63("div", { className: "dz-gantt__timeline-col", children: /* @__PURE__ */ jsxs36("div", { className: "dz-gantt__timeline", style: { height: bodyHeight }, children: [
6047
+ days.map((day, i) => /* @__PURE__ */ jsx63(
6048
+ "div",
6049
+ {
6050
+ className: `dz-gantt__day ${i % 2 === 1 ? "dz-gantt__day--alt" : ""}`,
6051
+ style: { left: `${day.leftPct}%`, width: `${day.widthPct}%` }
6052
+ },
6053
+ day.key
6054
+ )),
6055
+ bands.map((band) => /* @__PURE__ */ jsx63(
6056
+ "div",
6057
+ {
6058
+ className: "dz-gantt__band",
6059
+ title: band.title,
6060
+ style: { left: `${band.leftPct}%`, width: `${band.widthPct}%` }
6061
+ },
6062
+ band.key
6063
+ )),
6064
+ rows.map((row, i) => {
6065
+ var _a, _b, _c;
6066
+ return /* @__PURE__ */ jsx63(
6067
+ "div",
6068
+ {
6069
+ className: "dz-gantt__track",
6070
+ style: { top: i * rowHeight, height: rowHeight },
6071
+ children: row.bar && /* @__PURE__ */ jsx63(
6072
+ "div",
6073
+ {
6074
+ className: `dz-gantt__bar ${row.bar.dashed ? "dz-gantt__bar--approx" : ""}`,
6075
+ title: (_b = (_a = row.bar.title) != null ? _a : row.bar.label) != null ? _b : void 0,
6076
+ style: {
6077
+ left: `${row.bar.leftPct}%`,
6078
+ width: `${row.bar.widthPct}%`,
6079
+ ["--dz-gantt-bar-color"]: row.bar.color,
6080
+ ["--dz-gantt-bar-text"]: (_c = row.bar.textColor) != null ? _c : "#fff"
6081
+ },
6082
+ children: row.bar.label && /* @__PURE__ */ jsx63("span", { className: "dz-gantt__bar-label", children: row.bar.label })
6083
+ }
6084
+ )
6085
+ },
6086
+ row.key
6087
+ );
6088
+ })
6089
+ ] }) })
6090
+ ] })
6091
+ ]
6092
+ }
6093
+ );
6094
+ };
6095
+ var GanttDot = ({ color }) => /* @__PURE__ */ jsx63("span", { className: "dz-gantt__dot", style: { background: color } });
6096
+ var GanttSwatch = ({
6097
+ color,
6098
+ filled = true
6099
+ }) => /* @__PURE__ */ jsx63(
6100
+ "span",
6101
+ {
6102
+ className: "dz-gantt__swatch",
6103
+ style: {
6104
+ background: filled ? color : "transparent",
6105
+ border: `1.5px solid ${color}`
6106
+ }
6107
+ }
6108
+ );
6109
+
5990
6110
  // src/data/globalMethods.ts
5991
6111
  var formatDate = (dateString, type = "date", language = "en") => {
5992
6112
  if (!dateString) return "";
@@ -6640,6 +6760,9 @@ export {
6640
6760
  EmptyState,
6641
6761
  FileUploadZone,
6642
6762
  FloatingButton,
6763
+ Gantt,
6764
+ GanttDot,
6765
+ GanttSwatch,
6643
6766
  Grid,
6644
6767
  Icon,
6645
6768
  IconTabs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "design-zystem",
3
- "version": "1.0.272",
3
+ "version": "1.0.274",
4
4
  "description": "A React design system of importable components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",