design-zystem 1.0.294 → 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 +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +31 -0
- package/dist/index.mjs +30 -0
- package/package.json +1 -1
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,
|
|
@@ -6711,6 +6712,14 @@ var formatDate = (dateString, type = "date", language = "en") => {
|
|
|
6711
6712
|
}
|
|
6712
6713
|
case "longDate":
|
|
6713
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
|
+
}
|
|
6714
6723
|
case "monthYear":
|
|
6715
6724
|
return format({ month: "long", year: "numeric" });
|
|
6716
6725
|
default:
|
|
@@ -6925,6 +6934,27 @@ var getRelativeTime = (date) => {
|
|
|
6925
6934
|
return "\xE0 l'instant";
|
|
6926
6935
|
};
|
|
6927
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
|
+
|
|
6928
6958
|
// src/utils/date/formatTime.ts
|
|
6929
6959
|
var formatTime = (time) => {
|
|
6930
6960
|
if (!time) return "";
|
|
@@ -7363,6 +7393,7 @@ var parseAmount = (value) => {
|
|
|
7363
7393
|
generateHexColor,
|
|
7364
7394
|
getAvatarColor,
|
|
7365
7395
|
getCleanFileName,
|
|
7396
|
+
getElapsedTime,
|
|
7366
7397
|
getFileIconByMimeType,
|
|
7367
7398
|
getFileKind,
|
|
7368
7399
|
getFileNameFromUrl,
|
package/dist/index.mjs
CHANGED
|
@@ -6592,6 +6592,14 @@ var formatDate = (dateString, type = "date", language = "en") => {
|
|
|
6592
6592
|
}
|
|
6593
6593
|
case "longDate":
|
|
6594
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
|
+
}
|
|
6595
6603
|
case "monthYear":
|
|
6596
6604
|
return format({ month: "long", year: "numeric" });
|
|
6597
6605
|
default:
|
|
@@ -6806,6 +6814,27 @@ var getRelativeTime = (date) => {
|
|
|
6806
6814
|
return "\xE0 l'instant";
|
|
6807
6815
|
};
|
|
6808
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
|
+
|
|
6809
6838
|
// src/utils/date/formatTime.ts
|
|
6810
6839
|
var formatTime = (time) => {
|
|
6811
6840
|
if (!time) return "";
|
|
@@ -7243,6 +7272,7 @@ export {
|
|
|
7243
7272
|
generateHexColor,
|
|
7244
7273
|
getAvatarColor,
|
|
7245
7274
|
getCleanFileName,
|
|
7275
|
+
getElapsedTime,
|
|
7246
7276
|
getFileIconByMimeType,
|
|
7247
7277
|
getFileKind,
|
|
7248
7278
|
getFileNameFromUrl,
|