design-zystem 1.0.305 → 1.0.306

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
@@ -1139,9 +1139,19 @@ interface FloatingButtonProps {
1139
1139
  }
1140
1140
  declare const FloatingButton: ({ isOpen, onToggle, actions, mainBadge, label, icon, openIcon, variant, }: FloatingButtonProps) => react_jsx_runtime.JSX.Element;
1141
1141
 
1142
- interface ProgressBarProps {
1143
- /** Filled portion, 0–100. Values outside the range are clamped. */
1142
+ interface ProgressBarSegment {
1143
+ /** Share of the track, 0–100. */
1144
1144
  value: number;
1145
+ /** Segment color (DZ color token). */
1146
+ color: string;
1147
+ /** Native tooltip on hover. */
1148
+ label?: string;
1149
+ }
1150
+ interface ProgressBarProps {
1151
+ /** Filled portion, 0–100. Values outside the range are clamped. Ignored when `segments` is set. */
1152
+ value?: number;
1153
+ /** Stacked shares drawn side by side, truncated once they fill the track. */
1154
+ segments?: ProgressBarSegment[];
1145
1155
  /** Fill color (DZ color token). */
1146
1156
  color?: string;
1147
1157
  /** Track (unfilled) color (DZ color token). */
@@ -1153,8 +1163,9 @@ interface ProgressBarProps {
1153
1163
  }
1154
1164
  /**
1155
1165
  * Horizontal coverage/progress bar. Track + fill, optional right-aligned label.
1166
+ * Pass `segments` instead of `value` to stack the parts of a single total.
1156
1167
  */
1157
- declare const ProgressBar: ({ value, color, trackColor, height, showLabel, }: ProgressBarProps) => react_jsx_runtime.JSX.Element;
1168
+ declare const ProgressBar: ({ value, segments, color, trackColor, height, showLabel, }: ProgressBarProps) => react_jsx_runtime.JSX.Element;
1158
1169
 
1159
1170
  interface TimelineItem {
1160
1171
  /** Stable key for the row. */
@@ -1374,4 +1385,4 @@ declare const formatKM: (value: string | number | null | undefined) => string;
1374
1385
 
1375
1386
  declare const parseAmount: (value: string) => number | null;
1376
1387
 
1377
- 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 };
1388
+ 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, type ProgressBarProps, type ProgressBarSegment, 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
@@ -1139,9 +1139,19 @@ interface FloatingButtonProps {
1139
1139
  }
1140
1140
  declare const FloatingButton: ({ isOpen, onToggle, actions, mainBadge, label, icon, openIcon, variant, }: FloatingButtonProps) => react_jsx_runtime.JSX.Element;
1141
1141
 
1142
- interface ProgressBarProps {
1143
- /** Filled portion, 0–100. Values outside the range are clamped. */
1142
+ interface ProgressBarSegment {
1143
+ /** Share of the track, 0–100. */
1144
1144
  value: number;
1145
+ /** Segment color (DZ color token). */
1146
+ color: string;
1147
+ /** Native tooltip on hover. */
1148
+ label?: string;
1149
+ }
1150
+ interface ProgressBarProps {
1151
+ /** Filled portion, 0–100. Values outside the range are clamped. Ignored when `segments` is set. */
1152
+ value?: number;
1153
+ /** Stacked shares drawn side by side, truncated once they fill the track. */
1154
+ segments?: ProgressBarSegment[];
1145
1155
  /** Fill color (DZ color token). */
1146
1156
  color?: string;
1147
1157
  /** Track (unfilled) color (DZ color token). */
@@ -1153,8 +1163,9 @@ interface ProgressBarProps {
1153
1163
  }
1154
1164
  /**
1155
1165
  * Horizontal coverage/progress bar. Track + fill, optional right-aligned label.
1166
+ * Pass `segments` instead of `value` to stack the parts of a single total.
1156
1167
  */
1157
- declare const ProgressBar: ({ value, color, trackColor, height, showLabel, }: ProgressBarProps) => react_jsx_runtime.JSX.Element;
1168
+ declare const ProgressBar: ({ value, segments, color, trackColor, height, showLabel, }: ProgressBarProps) => react_jsx_runtime.JSX.Element;
1158
1169
 
1159
1170
  interface TimelineItem {
1160
1171
  /** Stable key for the row. */
@@ -1374,4 +1385,4 @@ declare const formatKM: (value: string | number | null | undefined) => string;
1374
1385
 
1375
1386
  declare const parseAmount: (value: string) => number | null;
1376
1387
 
1377
- 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 };
1388
+ 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, type ProgressBarProps, type ProgressBarSegment, 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
@@ -6332,6 +6332,14 @@ var CountBadge = import_styled_components49.default.span`
6332
6332
  var import_styled_components50 = __toESM(require("styled-components"));
6333
6333
  var import_jsx_runtime61 = require("react/jsx-runtime");
6334
6334
  var clampPercent = (value) => Math.max(0, Math.min(100, value));
6335
+ var stackSegments = (segments) => {
6336
+ let remaining = 100;
6337
+ return segments.map((segment) => {
6338
+ const width = clampPercent(Math.min(segment.value, remaining));
6339
+ remaining -= width;
6340
+ return __spreadProps(__spreadValues({}, segment), { width });
6341
+ });
6342
+ };
6335
6343
  var Wrapper6 = import_styled_components50.default.div`
6336
6344
  display: flex;
6337
6345
  align-items: center;
@@ -6340,6 +6348,7 @@ var Wrapper6 = import_styled_components50.default.div`
6340
6348
  `;
6341
6349
  var Track2 = import_styled_components50.default.div`
6342
6350
  position: relative;
6351
+ display: flex;
6343
6352
  flex: 1;
6344
6353
  height: ${({ $height }) => $height}px;
6345
6354
  background: ${({ $trackColor }) => $trackColor};
@@ -6353,16 +6362,32 @@ var Fill = import_styled_components50.default.div`
6353
6362
  border-radius: ${({ $height }) => $height}px;
6354
6363
  transition: width 0.2s ease;
6355
6364
  `;
6365
+ var Segment = import_styled_components50.default.div`
6366
+ height: 100%;
6367
+ flex: 0 0 ${({ $percent }) => $percent}%;
6368
+ background: ${({ $color }) => $color};
6369
+ transition: flex-basis 0.2s ease;
6370
+ `;
6356
6371
  var ProgressBar2 = ({
6357
- value,
6372
+ value = 0,
6373
+ segments,
6358
6374
  color = colors.blue_700,
6359
6375
  trackColor = colors.grey_200,
6360
6376
  height = 8,
6361
6377
  showLabel = false
6362
6378
  }) => {
6363
- const percent = clampPercent(value);
6379
+ const stacked = segments ? stackSegments(segments) : null;
6380
+ const percent = stacked ? stacked.reduce((total, segment) => total + segment.width, 0) : clampPercent(value);
6364
6381
  return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(Wrapper6, { children: [
6365
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Track2, { $height: height, $trackColor: trackColor, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Fill, { $height: height, $color: color, $percent: percent }) }),
6382
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Track2, { $height: height, $trackColor: trackColor, children: stacked ? stacked.map((segment, index) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
6383
+ Segment,
6384
+ {
6385
+ $color: segment.color,
6386
+ $percent: segment.width,
6387
+ title: segment.label
6388
+ },
6389
+ `${segment.color}-${index}`
6390
+ )) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Fill, { $height: height, $color: color, $percent: percent }) }),
6366
6391
  showLabel && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(Text, { size: "s", weight: "600", children: [
6367
6392
  Math.round(percent),
6368
6393
  " %"
package/dist/index.mjs CHANGED
@@ -6211,6 +6211,14 @@ var CountBadge = styled49.span`
6211
6211
  import styled50 from "styled-components";
6212
6212
  import { jsx as jsx61, jsxs as jsxs34 } from "react/jsx-runtime";
6213
6213
  var clampPercent = (value) => Math.max(0, Math.min(100, value));
6214
+ var stackSegments = (segments) => {
6215
+ let remaining = 100;
6216
+ return segments.map((segment) => {
6217
+ const width = clampPercent(Math.min(segment.value, remaining));
6218
+ remaining -= width;
6219
+ return __spreadProps(__spreadValues({}, segment), { width });
6220
+ });
6221
+ };
6214
6222
  var Wrapper6 = styled50.div`
6215
6223
  display: flex;
6216
6224
  align-items: center;
@@ -6219,6 +6227,7 @@ var Wrapper6 = styled50.div`
6219
6227
  `;
6220
6228
  var Track2 = styled50.div`
6221
6229
  position: relative;
6230
+ display: flex;
6222
6231
  flex: 1;
6223
6232
  height: ${({ $height }) => $height}px;
6224
6233
  background: ${({ $trackColor }) => $trackColor};
@@ -6232,16 +6241,32 @@ var Fill = styled50.div`
6232
6241
  border-radius: ${({ $height }) => $height}px;
6233
6242
  transition: width 0.2s ease;
6234
6243
  `;
6244
+ var Segment = styled50.div`
6245
+ height: 100%;
6246
+ flex: 0 0 ${({ $percent }) => $percent}%;
6247
+ background: ${({ $color }) => $color};
6248
+ transition: flex-basis 0.2s ease;
6249
+ `;
6235
6250
  var ProgressBar2 = ({
6236
- value,
6251
+ value = 0,
6252
+ segments,
6237
6253
  color = colors.blue_700,
6238
6254
  trackColor = colors.grey_200,
6239
6255
  height = 8,
6240
6256
  showLabel = false
6241
6257
  }) => {
6242
- const percent = clampPercent(value);
6258
+ const stacked = segments ? stackSegments(segments) : null;
6259
+ const percent = stacked ? stacked.reduce((total, segment) => total + segment.width, 0) : clampPercent(value);
6243
6260
  return /* @__PURE__ */ jsxs34(Wrapper6, { children: [
6244
- /* @__PURE__ */ jsx61(Track2, { $height: height, $trackColor: trackColor, children: /* @__PURE__ */ jsx61(Fill, { $height: height, $color: color, $percent: percent }) }),
6261
+ /* @__PURE__ */ jsx61(Track2, { $height: height, $trackColor: trackColor, children: stacked ? stacked.map((segment, index) => /* @__PURE__ */ jsx61(
6262
+ Segment,
6263
+ {
6264
+ $color: segment.color,
6265
+ $percent: segment.width,
6266
+ title: segment.label
6267
+ },
6268
+ `${segment.color}-${index}`
6269
+ )) : /* @__PURE__ */ jsx61(Fill, { $height: height, $color: color, $percent: percent }) }),
6245
6270
  showLabel && /* @__PURE__ */ jsxs34(Text, { size: "s", weight: "600", children: [
6246
6271
  Math.round(percent),
6247
6272
  " %"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "design-zystem",
3
- "version": "1.0.305",
3
+ "version": "1.0.306",
4
4
  "description": "A React design system of importable components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",