design-zystem 1.0.295 → 1.0.296

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
@@ -1317,6 +1317,19 @@ declare const getInitials: (author: AuthorLike | null | undefined) => string;
1317
1317
 
1318
1318
  declare const getAvatarColor: (key: string) => string;
1319
1319
 
1320
+ declare const PASTEL_COLORS: {
1321
+ background: string;
1322
+ text: string;
1323
+ }[];
1324
+ type PastelColorPair = (typeof PASTEL_COLORS)[number];
1325
+ /**
1326
+ * Couleur d'avatar déterministe pour un nom, en pastel avec sa couleur de texte
1327
+ * lisible. `generateHexColor` et `getAvatarColor` renvoient un hex saturé et
1328
+ * seul : ils ne conviennent ni au rendu pastel attendu, ni aux props
1329
+ * `backgroundColor` + `textColor` de l'`Avatar`.
1330
+ */
1331
+ declare const getPastelColorPair: (firstName?: string, lastName?: string) => PastelColorPair;
1332
+
1320
1333
  declare const formatNameWithInitial: (firstname: string | null, lastname: string | null) => string | null;
1321
1334
 
1322
1335
  declare const getFileNameFromUrl: (url: string | null | undefined, fallback?: string) => string;
@@ -1339,4 +1352,4 @@ declare const formatKM: (value: string | number | null | undefined) => string;
1339
1352
 
1340
1353
  declare const parseAmount: (value: string) => number | null;
1341
1354
 
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 };
1355
+ 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, type PastelColorPair, 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, getPastelColorPair, getRelativeTime, isHoliday, isSameDay, isolateCity, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText };
package/dist/index.d.ts CHANGED
@@ -1317,6 +1317,19 @@ declare const getInitials: (author: AuthorLike | null | undefined) => string;
1317
1317
 
1318
1318
  declare const getAvatarColor: (key: string) => string;
1319
1319
 
1320
+ declare const PASTEL_COLORS: {
1321
+ background: string;
1322
+ text: string;
1323
+ }[];
1324
+ type PastelColorPair = (typeof PASTEL_COLORS)[number];
1325
+ /**
1326
+ * Couleur d'avatar déterministe pour un nom, en pastel avec sa couleur de texte
1327
+ * lisible. `generateHexColor` et `getAvatarColor` renvoient un hex saturé et
1328
+ * seul : ils ne conviennent ni au rendu pastel attendu, ni aux props
1329
+ * `backgroundColor` + `textColor` de l'`Avatar`.
1330
+ */
1331
+ declare const getPastelColorPair: (firstName?: string, lastName?: string) => PastelColorPair;
1332
+
1320
1333
  declare const formatNameWithInitial: (firstname: string | null, lastname: string | null) => string | null;
1321
1334
 
1322
1335
  declare const getFileNameFromUrl: (url: string | null | undefined, fallback?: string) => string;
@@ -1339,4 +1352,4 @@ declare const formatKM: (value: string | number | null | undefined) => string;
1339
1352
 
1340
1353
  declare const parseAmount: (value: string) => number | null;
1341
1354
 
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 };
1355
+ 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, type PastelColorPair, 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, getPastelColorPair, getRelativeTime, isHoliday, isSameDay, isolateCity, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText };
package/dist/index.js CHANGED
@@ -157,6 +157,7 @@ __export(index_exports, {
157
157
  getFileNameFromUrl: () => getFileNameFromUrl,
158
158
  getInitials: () => getInitials2,
159
159
  getMimeCategory: () => getMimeCategory,
160
+ getPastelColorPair: () => getPastelColorPair,
160
161
  getRelativeTime: () => getRelativeTime,
161
162
  isHoliday: () => isHoliday,
162
163
  isSameDay: () => isSameDay,
@@ -7209,6 +7210,48 @@ var getAvatarColor = (key) => {
7209
7210
  return AVATAR_COLORS[hashString(key) % AVATAR_COLORS.length];
7210
7211
  };
7211
7212
 
7213
+ // src/utils/string/getPastelColorPair.ts
7214
+ var PASTEL_COLORS = [
7215
+ { background: "#ffe5e5", text: "#993333" },
7216
+ { background: "#ffd9cc", text: "#994d33" },
7217
+ { background: "#ffedcc", text: "#996633" },
7218
+ { background: "#fff5cc", text: "#997a33" },
7219
+ { background: "#f9ffcc", text: "#7a9933" },
7220
+ { background: "#ecffcc", text: "#669933" },
7221
+ { background: "#ddffcc", text: "#339933" },
7222
+ { background: "#ccffd9", text: "#33996b" },
7223
+ { background: "#ccffe5", text: "#339988" },
7224
+ { background: "#ccfff5", text: "#339999" },
7225
+ { background: "#ccf5ff", text: "#337a99" },
7226
+ { background: "#ccecff", text: "#336699" },
7227
+ { background: "#ccdfff", text: "#334d99" },
7228
+ { background: "#ccd1ff", text: "#333399" },
7229
+ { background: "#e5ccff", text: "#5c3399" },
7230
+ { background: "#f2ccff", text: "#7a3399" },
7231
+ { background: "#ffccf9", text: "#99337a" },
7232
+ { background: "#ffcce5", text: "#993366" },
7233
+ { background: "#ffccd9", text: "#99334d" },
7234
+ { background: "#dbffcc", text: "#4d9933" },
7235
+ { background: "#ccffe8", text: "#33997a" },
7236
+ { background: "#daccff", text: "#443399" },
7237
+ { background: "#ecccff", text: "#663399" },
7238
+ { background: "#cce0ff", text: "#334d99" },
7239
+ { background: "#f5ccff", text: "#7a3399" },
7240
+ { background: "#ffcce8", text: "#993366" },
7241
+ { background: "#f0ffcc", text: "#669933" },
7242
+ { background: "#ccffd2", text: "#33994d" },
7243
+ { background: "#ccffe0", text: "#339966" }
7244
+ ];
7245
+ var getPastelColorPair = (firstName = "", lastName = "") => {
7246
+ var _a, _b, _c, _d;
7247
+ const fullName = ((_b = (_a = firstName == null ? void 0 : firstName.trim()) == null ? void 0 : _a.toLowerCase()) != null ? _b : "") + ((_d = (_c = lastName == null ? void 0 : lastName.trim()) == null ? void 0 : _c.toLowerCase()) != null ? _d : "");
7248
+ let hash = 0;
7249
+ for (let i = 0; i < fullName.length; i++) {
7250
+ hash = fullName.charCodeAt(i) + ((hash << 5) - hash);
7251
+ }
7252
+ return PASTEL_COLORS[Math.abs(hash) % PASTEL_COLORS.length];
7253
+ };
7254
+
7212
7255
  // src/utils/string/formatNameWithInitial.ts
7213
7256
  var formatNameWithInitial = (firstname, lastname) => {
7214
7257
  if (!firstname && !lastname) return null;
@@ -7399,6 +7442,7 @@ var parseAmount = (value) => {
7399
7442
  getFileNameFromUrl,
7400
7443
  getInitials,
7401
7444
  getMimeCategory,
7445
+ getPastelColorPair,
7402
7446
  getRelativeTime,
7403
7447
  isHoliday,
7404
7448
  isSameDay,
package/dist/index.mjs CHANGED
@@ -7089,6 +7089,48 @@ var getAvatarColor = (key) => {
7089
7089
  return AVATAR_COLORS[hashString(key) % AVATAR_COLORS.length];
7090
7090
  };
7091
7091
 
7092
+ // src/utils/string/getPastelColorPair.ts
7093
+ var PASTEL_COLORS = [
7094
+ { background: "#ffe5e5", text: "#993333" },
7095
+ { background: "#ffd9cc", text: "#994d33" },
7096
+ { background: "#ffedcc", text: "#996633" },
7097
+ { background: "#fff5cc", text: "#997a33" },
7098
+ { background: "#f9ffcc", text: "#7a9933" },
7099
+ { background: "#ecffcc", text: "#669933" },
7100
+ { background: "#ddffcc", text: "#339933" },
7101
+ { background: "#ccffd9", text: "#33996b" },
7102
+ { background: "#ccffe5", text: "#339988" },
7103
+ { background: "#ccfff5", text: "#339999" },
7104
+ { background: "#ccf5ff", text: "#337a99" },
7105
+ { background: "#ccecff", text: "#336699" },
7106
+ { background: "#ccdfff", text: "#334d99" },
7107
+ { background: "#ccd1ff", text: "#333399" },
7108
+ { background: "#e5ccff", text: "#5c3399" },
7109
+ { background: "#f2ccff", text: "#7a3399" },
7110
+ { background: "#ffccf9", text: "#99337a" },
7111
+ { background: "#ffcce5", text: "#993366" },
7112
+ { background: "#ffccd9", text: "#99334d" },
7113
+ { background: "#dbffcc", text: "#4d9933" },
7114
+ { background: "#ccffe8", text: "#33997a" },
7115
+ { background: "#daccff", text: "#443399" },
7116
+ { background: "#ecccff", text: "#663399" },
7117
+ { background: "#cce0ff", text: "#334d99" },
7118
+ { background: "#f5ccff", text: "#7a3399" },
7119
+ { background: "#ffcce8", text: "#993366" },
7120
+ { background: "#f0ffcc", text: "#669933" },
7121
+ { background: "#ccffd2", text: "#33994d" },
7122
+ { background: "#ccffe0", text: "#339966" }
7123
+ ];
7124
+ var getPastelColorPair = (firstName = "", lastName = "") => {
7125
+ var _a, _b, _c, _d;
7126
+ const fullName = ((_b = (_a = firstName == null ? void 0 : firstName.trim()) == null ? void 0 : _a.toLowerCase()) != null ? _b : "") + ((_d = (_c = lastName == null ? void 0 : lastName.trim()) == null ? void 0 : _c.toLowerCase()) != null ? _d : "");
7127
+ let hash = 0;
7128
+ for (let i = 0; i < fullName.length; i++) {
7129
+ hash = fullName.charCodeAt(i) + ((hash << 5) - hash);
7130
+ }
7131
+ return PASTEL_COLORS[Math.abs(hash) % PASTEL_COLORS.length];
7132
+ };
7133
+
7092
7134
  // src/utils/string/formatNameWithInitial.ts
7093
7135
  var formatNameWithInitial = (firstname, lastname) => {
7094
7136
  if (!firstname && !lastname) return null;
@@ -7278,6 +7320,7 @@ export {
7278
7320
  getFileNameFromUrl,
7279
7321
  getInitials2 as getInitials,
7280
7322
  getMimeCategory,
7323
+ getPastelColorPair,
7281
7324
  getRelativeTime,
7282
7325
  isHoliday,
7283
7326
  isSameDay,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "design-zystem",
3
- "version": "1.0.295",
3
+ "version": "1.0.296",
4
4
  "description": "A React design system of importable components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",