design-zystem 1.0.293 → 1.0.295

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.d.mts CHANGED
@@ -1219,6 +1219,7 @@ declare const GanttSwatch: ({ color, filled, }: {
1219
1219
  * - "weekdayYear": short weekday + day + month + year
1220
1220
  * - "weekdayTime": weekday/date + time (24h)
1221
1221
  * - "longDate": day + full month + year, no weekday (ex: 16 mai 2024)
1222
+ * - "dayMonth": day + full month, no weekday (year only if different)
1222
1223
  * - "dateISO": ISO format YYYY-MM-DD (timezone-safe for backend)
1223
1224
  */
1224
1225
  declare const formatDate: (dateString: Date | string | number | null | undefined, type?: string, language?: string) => string;
@@ -1261,6 +1262,8 @@ declare const optimizeImage: (file: File | null | undefined, desiredBaseName: st
1261
1262
 
1262
1263
  declare const getRelativeTime: (date: Date | string) => string;
1263
1264
 
1265
+ declare const getElapsedTime: (date: Date | string) => string;
1266
+
1264
1267
  declare const formatTime: (time: string | null | undefined) => string;
1265
1268
 
1266
1269
  declare const easterDate: (year: number) => Date;
@@ -1336,4 +1339,4 @@ declare const formatKM: (value: string | number | null | undefined) => string;
1336
1339
 
1337
1340
  declare const parseAmount: (value: string) => number | null;
1338
1341
 
1339
- 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 };
1342
+ 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, getElapsedTime, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getRelativeTime, isHoliday, isSameDay, isolateCity, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText };
package/dist/index.d.ts CHANGED
@@ -1219,6 +1219,7 @@ declare const GanttSwatch: ({ color, filled, }: {
1219
1219
  * - "weekdayYear": short weekday + day + month + year
1220
1220
  * - "weekdayTime": weekday/date + time (24h)
1221
1221
  * - "longDate": day + full month + year, no weekday (ex: 16 mai 2024)
1222
+ * - "dayMonth": day + full month, no weekday (year only if different)
1222
1223
  * - "dateISO": ISO format YYYY-MM-DD (timezone-safe for backend)
1223
1224
  */
1224
1225
  declare const formatDate: (dateString: Date | string | number | null | undefined, type?: string, language?: string) => string;
@@ -1261,6 +1262,8 @@ declare const optimizeImage: (file: File | null | undefined, desiredBaseName: st
1261
1262
 
1262
1263
  declare const getRelativeTime: (date: Date | string) => string;
1263
1264
 
1265
+ declare const getElapsedTime: (date: Date | string) => string;
1266
+
1264
1267
  declare const formatTime: (time: string | null | undefined) => string;
1265
1268
 
1266
1269
  declare const easterDate: (year: number) => Date;
@@ -1336,4 +1339,4 @@ declare const formatKM: (value: string | number | null | undefined) => string;
1336
1339
 
1337
1340
  declare const parseAmount: (value: string) => number | null;
1338
1341
 
1339
- 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 };
1342
+ 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, getElapsedTime, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getRelativeTime, isHoliday, isSameDay, isolateCity, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText };
package/dist/index.js CHANGED
@@ -151,6 +151,7 @@ __export(index_exports, {
151
151
  generateHexColor: () => generateHexColor,
152
152
  getAvatarColor: () => getAvatarColor,
153
153
  getCleanFileName: () => getCleanFileName,
154
+ getElapsedTime: () => getElapsedTime,
154
155
  getFileIconByMimeType: () => getFileIconByMimeType,
155
156
  getFileKind: () => getFileKind,
156
157
  getFileNameFromUrl: () => getFileNameFromUrl,
@@ -5422,6 +5423,13 @@ var PRESET_STYLES = {
5422
5423
  badgeBackground: "#FCDDDE",
5423
5424
  badgeColor: colors.red_950,
5424
5425
  accent: colors.red_950
5426
+ },
5427
+ purple: {
5428
+ background: "rgba(237, 233, 254, 0.4)",
5429
+ borderColor: "#DDD6FE",
5430
+ badgeBackground: colors.purple_50,
5431
+ badgeColor: colors.purple_700,
5432
+ accent: colors.purple_700
5425
5433
  }
5426
5434
  };
5427
5435
  var resolveStyle = (variant, filled) => {
@@ -6704,6 +6712,14 @@ var formatDate = (dateString, type = "date", language = "en") => {
6704
6712
  }
6705
6713
  case "longDate":
6706
6714
  return format({ day: "numeric", month: "long", year: "numeric" });
6715
+ case "dayMonth": {
6716
+ const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
6717
+ const dateYear = date.getFullYear();
6718
+ return format(__spreadValues({
6719
+ day: "numeric",
6720
+ month: "long"
6721
+ }, dateYear !== currentYear && { year: "numeric" }));
6722
+ }
6707
6723
  case "monthYear":
6708
6724
  return format({ month: "long", year: "numeric" });
6709
6725
  default:
@@ -6918,6 +6934,27 @@ var getRelativeTime = (date) => {
6918
6934
  return "\xE0 l'instant";
6919
6935
  };
6920
6936
 
6937
+ // src/utils/date/getElapsedTime.ts
6938
+ var UNITS2 = [
6939
+ { name: "an", seconds: 31536e3, pluralize: true },
6940
+ { name: "mois", seconds: 2592e3, pluralize: false },
6941
+ { name: "semaine", seconds: 604800, pluralize: true },
6942
+ { name: "jour", seconds: 86400, pluralize: true }
6943
+ ];
6944
+ var getElapsedTime = (date) => {
6945
+ const elapsedSeconds = Math.floor(
6946
+ (Date.now() - new Date(date).getTime()) / 1e3
6947
+ );
6948
+ for (const unit of UNITS2) {
6949
+ const interval = Math.floor(elapsedSeconds / unit.seconds);
6950
+ if (interval >= 1) {
6951
+ const suffix = unit.pluralize && interval > 1 ? "s" : "";
6952
+ return `${interval} ${unit.name}${suffix}`;
6953
+ }
6954
+ }
6955
+ return "aujourd'hui";
6956
+ };
6957
+
6921
6958
  // src/utils/date/formatTime.ts
6922
6959
  var formatTime = (time) => {
6923
6960
  if (!time) return "";
@@ -7356,6 +7393,7 @@ var parseAmount = (value) => {
7356
7393
  generateHexColor,
7357
7394
  getAvatarColor,
7358
7395
  getCleanFileName,
7396
+ getElapsedTime,
7359
7397
  getFileIconByMimeType,
7360
7398
  getFileKind,
7361
7399
  getFileNameFromUrl,
package/dist/index.mjs CHANGED
@@ -5303,6 +5303,13 @@ var PRESET_STYLES = {
5303
5303
  badgeBackground: "#FCDDDE",
5304
5304
  badgeColor: colors.red_950,
5305
5305
  accent: colors.red_950
5306
+ },
5307
+ purple: {
5308
+ background: "rgba(237, 233, 254, 0.4)",
5309
+ borderColor: "#DDD6FE",
5310
+ badgeBackground: colors.purple_50,
5311
+ badgeColor: colors.purple_700,
5312
+ accent: colors.purple_700
5306
5313
  }
5307
5314
  };
5308
5315
  var resolveStyle = (variant, filled) => {
@@ -6585,6 +6592,14 @@ var formatDate = (dateString, type = "date", language = "en") => {
6585
6592
  }
6586
6593
  case "longDate":
6587
6594
  return format({ day: "numeric", month: "long", year: "numeric" });
6595
+ case "dayMonth": {
6596
+ const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
6597
+ const dateYear = date.getFullYear();
6598
+ return format(__spreadValues({
6599
+ day: "numeric",
6600
+ month: "long"
6601
+ }, dateYear !== currentYear && { year: "numeric" }));
6602
+ }
6588
6603
  case "monthYear":
6589
6604
  return format({ month: "long", year: "numeric" });
6590
6605
  default:
@@ -6799,6 +6814,27 @@ var getRelativeTime = (date) => {
6799
6814
  return "\xE0 l'instant";
6800
6815
  };
6801
6816
 
6817
+ // src/utils/date/getElapsedTime.ts
6818
+ var UNITS2 = [
6819
+ { name: "an", seconds: 31536e3, pluralize: true },
6820
+ { name: "mois", seconds: 2592e3, pluralize: false },
6821
+ { name: "semaine", seconds: 604800, pluralize: true },
6822
+ { name: "jour", seconds: 86400, pluralize: true }
6823
+ ];
6824
+ var getElapsedTime = (date) => {
6825
+ const elapsedSeconds = Math.floor(
6826
+ (Date.now() - new Date(date).getTime()) / 1e3
6827
+ );
6828
+ for (const unit of UNITS2) {
6829
+ const interval = Math.floor(elapsedSeconds / unit.seconds);
6830
+ if (interval >= 1) {
6831
+ const suffix = unit.pluralize && interval > 1 ? "s" : "";
6832
+ return `${interval} ${unit.name}${suffix}`;
6833
+ }
6834
+ }
6835
+ return "aujourd'hui";
6836
+ };
6837
+
6802
6838
  // src/utils/date/formatTime.ts
6803
6839
  var formatTime = (time) => {
6804
6840
  if (!time) return "";
@@ -7236,6 +7272,7 @@ export {
7236
7272
  generateHexColor,
7237
7273
  getAvatarColor,
7238
7274
  getCleanFileName,
7275
+ getElapsedTime,
7239
7276
  getFileIconByMimeType,
7240
7277
  getFileKind,
7241
7278
  getFileNameFromUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "design-zystem",
3
- "version": "1.0.293",
3
+ "version": "1.0.295",
4
4
  "description": "A React design system of importable components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",