design-zystem 1.0.252 → 1.0.253

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
@@ -32,6 +32,8 @@ interface BoxProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
32
32
  justifyContent?: string;
33
33
  borderRadius?: string;
34
34
  border?: string;
35
+ /** Colored left accent bar (status/score encoding), painted over the box border. */
36
+ borderColor?: string;
35
37
  style?: CSSProperties;
36
38
  }
37
39
  declare const Box: ({ children, hasShadow, ...rest }: BoxProps) => react_jsx_runtime.JSX.Element;
@@ -974,35 +976,6 @@ interface TimelineProps {
974
976
  */
975
977
  declare const Timeline: ({ items, lineColor, emptyLabel, }: TimelineProps) => react_jsx_runtime.JSX.Element;
976
978
 
977
- interface BorderedRowProps {
978
- /** Accent color (DZ color token) — used to encode a score/status/level. */
979
- borderColor?: string;
980
- /** Accent thickness in px. */
981
- borderWidth?: number;
982
- /** Background color (DZ color token). */
983
- background?: string;
984
- /** Inner padding. */
985
- padding?: string;
986
- /** Corner radius — pass "0" for flush table rows, default rounded card. */
987
- borderRadius?: string;
988
- /**
989
- * Accent style:
990
- * - 'edge' (default): full-height colored left border (flush rows / score bars).
991
- * - 'bar': short rounded inset accent bar, centered (white card look).
992
- */
993
- accent?: 'edge' | 'bar';
994
- /** Subtle 1px full border around the card (card look). */
995
- bordered?: boolean;
996
- children: ReactNode;
997
- onClick?: () => void;
998
- }
999
- /**
1000
- * Row/card with a colored accent, used to encode a status (recovery score,
1001
- * feedback level…). Flush table rows: accent="edge" + borderRadius="0".
1002
- * White cards: accent="bar" + bordered + background.
1003
- */
1004
- declare const BorderedRow: ({ borderColor, borderWidth, background, padding, borderRadius, accent, bordered, children, onClick, }: BorderedRowProps) => react_jsx_runtime.JSX.Element;
1005
-
1006
979
  /**
1007
980
  * formatDate(date, type?, language?)
1008
981
  * - language : fr/en/es/... (locale inferred), default "en"
@@ -1021,6 +994,11 @@ declare const formatDistance: (distanceKm: number | string | null | undefined, l
1021
994
  declare const formatDuration: (minutes: number | null | undefined, language?: string) => string;
1022
995
  declare const truncateText: (text: string | null | undefined, maxLength?: number) => string;
1023
996
  declare const truncateFileName: (fileName: string | null | undefined, maxLength?: number) => string;
997
+ declare const formatEuro: (amount?: number | null) => string;
998
+ declare const formatName: (person?: {
999
+ firstname?: string | null;
1000
+ lastname?: string | null;
1001
+ } | null, fallback?: string) => string;
1024
1002
 
1025
1003
  /**
1026
1004
  * Optimiser image:
@@ -1049,4 +1027,4 @@ interface OptimizeImageOptions {
1049
1027
  }
1050
1028
  declare const optimizeImage: (file: File | null | undefined, desiredBaseName: string, opts?: OptimizeImageOptions) => Promise<OptimizeImageResult>;
1051
1029
 
1052
- export { Accordion, type AccordionItem, Avatar, BorderedRow, Box, Bubble, Bulk, Button, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, 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, Tooltip, colors, formatDate, formatDistance, formatDuration, optimizeImage, truncateFileName, truncateText };
1030
+ export { Accordion, type AccordionItem, Avatar, Box, Bubble, Bulk, Button, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, 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, Tooltip, colors, formatDate, formatDistance, formatDuration, formatEuro, formatName, optimizeImage, truncateFileName, truncateText };
package/dist/index.d.ts CHANGED
@@ -32,6 +32,8 @@ interface BoxProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
32
32
  justifyContent?: string;
33
33
  borderRadius?: string;
34
34
  border?: string;
35
+ /** Colored left accent bar (status/score encoding), painted over the box border. */
36
+ borderColor?: string;
35
37
  style?: CSSProperties;
36
38
  }
37
39
  declare const Box: ({ children, hasShadow, ...rest }: BoxProps) => react_jsx_runtime.JSX.Element;
@@ -974,35 +976,6 @@ interface TimelineProps {
974
976
  */
975
977
  declare const Timeline: ({ items, lineColor, emptyLabel, }: TimelineProps) => react_jsx_runtime.JSX.Element;
976
978
 
977
- interface BorderedRowProps {
978
- /** Accent color (DZ color token) — used to encode a score/status/level. */
979
- borderColor?: string;
980
- /** Accent thickness in px. */
981
- borderWidth?: number;
982
- /** Background color (DZ color token). */
983
- background?: string;
984
- /** Inner padding. */
985
- padding?: string;
986
- /** Corner radius — pass "0" for flush table rows, default rounded card. */
987
- borderRadius?: string;
988
- /**
989
- * Accent style:
990
- * - 'edge' (default): full-height colored left border (flush rows / score bars).
991
- * - 'bar': short rounded inset accent bar, centered (white card look).
992
- */
993
- accent?: 'edge' | 'bar';
994
- /** Subtle 1px full border around the card (card look). */
995
- bordered?: boolean;
996
- children: ReactNode;
997
- onClick?: () => void;
998
- }
999
- /**
1000
- * Row/card with a colored accent, used to encode a status (recovery score,
1001
- * feedback level…). Flush table rows: accent="edge" + borderRadius="0".
1002
- * White cards: accent="bar" + bordered + background.
1003
- */
1004
- declare const BorderedRow: ({ borderColor, borderWidth, background, padding, borderRadius, accent, bordered, children, onClick, }: BorderedRowProps) => react_jsx_runtime.JSX.Element;
1005
-
1006
979
  /**
1007
980
  * formatDate(date, type?, language?)
1008
981
  * - language : fr/en/es/... (locale inferred), default "en"
@@ -1021,6 +994,11 @@ declare const formatDistance: (distanceKm: number | string | null | undefined, l
1021
994
  declare const formatDuration: (minutes: number | null | undefined, language?: string) => string;
1022
995
  declare const truncateText: (text: string | null | undefined, maxLength?: number) => string;
1023
996
  declare const truncateFileName: (fileName: string | null | undefined, maxLength?: number) => string;
997
+ declare const formatEuro: (amount?: number | null) => string;
998
+ declare const formatName: (person?: {
999
+ firstname?: string | null;
1000
+ lastname?: string | null;
1001
+ } | null, fallback?: string) => string;
1024
1002
 
1025
1003
  /**
1026
1004
  * Optimiser image:
@@ -1049,4 +1027,4 @@ interface OptimizeImageOptions {
1049
1027
  }
1050
1028
  declare const optimizeImage: (file: File | null | undefined, desiredBaseName: string, opts?: OptimizeImageOptions) => Promise<OptimizeImageResult>;
1051
1029
 
1052
- export { Accordion, type AccordionItem, Avatar, BorderedRow, Box, Bubble, Bulk, Button, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, 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, Tooltip, colors, formatDate, formatDistance, formatDuration, optimizeImage, truncateFileName, truncateText };
1030
+ export { Accordion, type AccordionItem, Avatar, Box, Bubble, Bulk, Button, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, 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, Tooltip, colors, formatDate, formatDistance, formatDuration, formatEuro, formatName, optimizeImage, truncateFileName, truncateText };
package/dist/index.js CHANGED
@@ -61,7 +61,6 @@ var index_exports = {};
61
61
  __export(index_exports, {
62
62
  Accordion: () => Accordion,
63
63
  Avatar: () => Avatar,
64
- BorderedRow: () => BorderedRow,
65
64
  Box: () => Box,
66
65
  Bubble: () => Bubble,
67
66
  Bulk: () => Bulk,
@@ -122,6 +121,8 @@ __export(index_exports, {
122
121
  formatDate: () => formatDate,
123
122
  formatDistance: () => formatDistance,
124
123
  formatDuration: () => formatDuration,
124
+ formatEuro: () => formatEuro,
125
+ formatName: () => formatName,
125
126
  optimizeImage: () => optimizeImage_default,
126
127
  truncateFileName: () => truncateFileName,
127
128
  truncateText: () => truncateText
@@ -330,6 +331,7 @@ var shouldForwardProp2 = (prop) => ![
330
331
  "hasShadow",
331
332
  "borderRadius",
332
333
  "border",
334
+ "borderColor",
333
335
  "height"
334
336
  ].includes(prop);
335
337
  var StyledBox = import_styled_components2.default.div.withConfig({ shouldForwardProp: shouldForwardProp2 })`
@@ -339,6 +341,7 @@ var StyledBox = import_styled_components2.default.div.withConfig({ shouldForward
339
341
  var _a;
340
342
  return (_a = props.border) != null ? _a : `1px solid ${colors.grey_300}`;
341
343
  }};
344
+ ${(props) => props.borderColor ? `border-left: 4px solid ${colors[props.borderColor] || props.borderColor};` : ""}
342
345
 
343
346
  border-radius: ${(props) => props.borderRadius || "8px"};
344
347
 
@@ -5489,61 +5492,6 @@ var Timeline = ({
5489
5492
  }) });
5490
5493
  };
5491
5494
 
5492
- // src/Components/BorderedRow/BorderedRow.tsx
5493
- var import_styled_components48 = __toESM(require("styled-components"));
5494
- var import_jsx_runtime59 = require("react/jsx-runtime");
5495
- var Wrapper6 = import_styled_components48.default.div`
5496
- box-sizing: border-box;
5497
- position: relative;
5498
- width: 100%;
5499
- padding: ${({ $padding }) => $padding};
5500
- ${({ $accent, $borderWidth }) => $accent === "bar" ? `padding-left: ${$borderWidth + 16}px;` : ""}
5501
- border-radius: ${({ $borderRadius }) => $borderRadius};
5502
- background: ${({ $background }) => $background || "transparent"};
5503
- cursor: ${({ $clickable }) => $clickable ? "pointer" : "default"};
5504
- ${({ $bordered }) => $bordered ? `border: 1px solid ${colors.grey_300};` : ""}
5505
- ${({ $accent, $borderWidth, $borderColor }) => $accent === "edge" ? `border-left: ${$borderWidth}px solid ${$borderColor};` : ""}
5506
-
5507
- ${({ $accent, $borderWidth, $borderColor }) => $accent === "bar" ? `
5508
- &::before {
5509
- content: '';
5510
- position: absolute;
5511
- left: 10px;
5512
- top: 50%;
5513
- transform: translateY(-50%);
5514
- height: 62%;
5515
- width: ${$borderWidth}px;
5516
- border-radius: ${$borderWidth}px;
5517
- background: ${$borderColor};
5518
- }
5519
- ` : ""}
5520
- `;
5521
- var BorderedRow = ({
5522
- borderColor = colors.blue_700,
5523
- borderWidth = 4,
5524
- background,
5525
- padding = "12px",
5526
- borderRadius = "8px",
5527
- accent = "edge",
5528
- bordered = false,
5529
- children,
5530
- onClick
5531
- }) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5532
- Wrapper6,
5533
- {
5534
- $borderColor: borderColor,
5535
- $borderWidth: borderWidth,
5536
- $background: background,
5537
- $padding: padding,
5538
- $borderRadius: borderRadius,
5539
- $accent: accent,
5540
- $bordered: bordered,
5541
- $clickable: !!onClick,
5542
- onClick,
5543
- children
5544
- }
5545
- );
5546
-
5547
5495
  // src/data/globalMethods.ts
5548
5496
  var formatDate = (dateString, type = "date", language = "en") => {
5549
5497
  if (!dateString) return "";
@@ -5653,6 +5601,14 @@ var truncateFileName = (fileName, maxLength = 20) => {
5653
5601
  }
5654
5602
  return fileName;
5655
5603
  };
5604
+ var formatEuro = (amount) => `${(amount != null ? amount : 0).toLocaleString("fr-FR", {
5605
+ minimumFractionDigits: 2,
5606
+ maximumFractionDigits: 2
5607
+ })} \u20AC`;
5608
+ var formatName = (person, fallback = "") => {
5609
+ var _a, _b;
5610
+ return person ? `${(_a = person.firstname) != null ? _a : ""} ${(_b = person.lastname) != null ? _b : ""}`.trim() || fallback : fallback;
5611
+ };
5656
5612
 
5657
5613
  // src/services/optimizeImage/optimizeImage.ts
5658
5614
  var hasDocument = () => typeof document !== "undefined";
@@ -5791,7 +5747,6 @@ var optimizeImage_default = optimizeImage;
5791
5747
  0 && (module.exports = {
5792
5748
  Accordion,
5793
5749
  Avatar,
5794
- BorderedRow,
5795
5750
  Box,
5796
5751
  Bubble,
5797
5752
  Bulk,
@@ -5852,6 +5807,8 @@ var optimizeImage_default = optimizeImage;
5852
5807
  formatDate,
5853
5808
  formatDistance,
5854
5809
  formatDuration,
5810
+ formatEuro,
5811
+ formatName,
5855
5812
  optimizeImage,
5856
5813
  truncateFileName,
5857
5814
  truncateText
package/dist/index.mjs CHANGED
@@ -232,6 +232,7 @@ var shouldForwardProp2 = (prop) => ![
232
232
  "hasShadow",
233
233
  "borderRadius",
234
234
  "border",
235
+ "borderColor",
235
236
  "height"
236
237
  ].includes(prop);
237
238
  var StyledBox = styled2.div.withConfig({ shouldForwardProp: shouldForwardProp2 })`
@@ -241,6 +242,7 @@ var StyledBox = styled2.div.withConfig({ shouldForwardProp: shouldForwardProp2 }
241
242
  var _a;
242
243
  return (_a = props.border) != null ? _a : `1px solid ${colors.grey_300}`;
243
244
  }};
245
+ ${(props) => props.borderColor ? `border-left: 4px solid ${colors[props.borderColor] || props.borderColor};` : ""}
244
246
 
245
247
  border-radius: ${(props) => props.borderRadius || "8px"};
246
248
 
@@ -5411,61 +5413,6 @@ var Timeline = ({
5411
5413
  }) });
5412
5414
  };
5413
5415
 
5414
- // src/Components/BorderedRow/BorderedRow.tsx
5415
- import styled48 from "styled-components";
5416
- import { jsx as jsx59 } from "react/jsx-runtime";
5417
- var Wrapper6 = styled48.div`
5418
- box-sizing: border-box;
5419
- position: relative;
5420
- width: 100%;
5421
- padding: ${({ $padding }) => $padding};
5422
- ${({ $accent, $borderWidth }) => $accent === "bar" ? `padding-left: ${$borderWidth + 16}px;` : ""}
5423
- border-radius: ${({ $borderRadius }) => $borderRadius};
5424
- background: ${({ $background }) => $background || "transparent"};
5425
- cursor: ${({ $clickable }) => $clickable ? "pointer" : "default"};
5426
- ${({ $bordered }) => $bordered ? `border: 1px solid ${colors.grey_300};` : ""}
5427
- ${({ $accent, $borderWidth, $borderColor }) => $accent === "edge" ? `border-left: ${$borderWidth}px solid ${$borderColor};` : ""}
5428
-
5429
- ${({ $accent, $borderWidth, $borderColor }) => $accent === "bar" ? `
5430
- &::before {
5431
- content: '';
5432
- position: absolute;
5433
- left: 10px;
5434
- top: 50%;
5435
- transform: translateY(-50%);
5436
- height: 62%;
5437
- width: ${$borderWidth}px;
5438
- border-radius: ${$borderWidth}px;
5439
- background: ${$borderColor};
5440
- }
5441
- ` : ""}
5442
- `;
5443
- var BorderedRow = ({
5444
- borderColor = colors.blue_700,
5445
- borderWidth = 4,
5446
- background,
5447
- padding = "12px",
5448
- borderRadius = "8px",
5449
- accent = "edge",
5450
- bordered = false,
5451
- children,
5452
- onClick
5453
- }) => /* @__PURE__ */ jsx59(
5454
- Wrapper6,
5455
- {
5456
- $borderColor: borderColor,
5457
- $borderWidth: borderWidth,
5458
- $background: background,
5459
- $padding: padding,
5460
- $borderRadius: borderRadius,
5461
- $accent: accent,
5462
- $bordered: bordered,
5463
- $clickable: !!onClick,
5464
- onClick,
5465
- children
5466
- }
5467
- );
5468
-
5469
5416
  // src/data/globalMethods.ts
5470
5417
  var formatDate = (dateString, type = "date", language = "en") => {
5471
5418
  if (!dateString) return "";
@@ -5575,6 +5522,14 @@ var truncateFileName = (fileName, maxLength = 20) => {
5575
5522
  }
5576
5523
  return fileName;
5577
5524
  };
5525
+ var formatEuro = (amount) => `${(amount != null ? amount : 0).toLocaleString("fr-FR", {
5526
+ minimumFractionDigits: 2,
5527
+ maximumFractionDigits: 2
5528
+ })} \u20AC`;
5529
+ var formatName = (person, fallback = "") => {
5530
+ var _a, _b;
5531
+ return person ? `${(_a = person.firstname) != null ? _a : ""} ${(_b = person.lastname) != null ? _b : ""}`.trim() || fallback : fallback;
5532
+ };
5578
5533
 
5579
5534
  // src/services/optimizeImage/optimizeImage.ts
5580
5535
  var hasDocument = () => typeof document !== "undefined";
@@ -5712,7 +5667,6 @@ var optimizeImage_default = optimizeImage;
5712
5667
  export {
5713
5668
  Accordion,
5714
5669
  Avatar,
5715
- BorderedRow,
5716
5670
  Box,
5717
5671
  Bubble,
5718
5672
  Bulk,
@@ -5773,6 +5727,8 @@ export {
5773
5727
  formatDate,
5774
5728
  formatDistance,
5775
5729
  formatDuration,
5730
+ formatEuro,
5731
+ formatName,
5776
5732
  optimizeImage_default as optimizeImage,
5777
5733
  truncateFileName,
5778
5734
  truncateText
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "design-zystem",
3
- "version": "1.0.252",
3
+ "version": "1.0.253",
4
4
  "description": "A React design system of importable components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",