@speakapbv/dough-component-library 10.1.0 → 10.1.2

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.ts CHANGED
@@ -37,6 +37,7 @@ export { Tooltip, TooltipDirection } from "./components/tooltip/tooltip";
37
37
  export { AppBackground } from "./components/app-background/app-background";
38
38
  export { AppWrapper } from "./components/app-wrapper/app-wrapper";
39
39
  export { PanelOverlay } from "./components/panel-overlay/panel-overlay";
40
+ export { MultiProgressBar, MultiProgressBarProps, } from "./components/progress-bar/multi-progress-bar";
40
41
  export { ProgressBar, ProgressBarProps, } from "./components/progress-bar/progress-bar";
41
42
  export { AlertText } from "./components/alert-textbox/alert-textbox";
42
43
  export { Notification } from "./components/notification/notification";
package/dist/index.es.js CHANGED
@@ -4518,7 +4518,7 @@ var PanelOverlay = function (props) {
4518
4518
  };
4519
4519
  PanelOverlay.displayName = "PanelOverlay";
4520
4520
 
4521
- var css_248z$x = "/* COLORS */\n/* Typography*/\n/*Dennis should provide medium font size*/\n.dough-progress-bar {\n height: 4px;\n width: 100%;\n border-radius: 4px;\n position: relative;\n}\n\n.dough-progress-bar__progress {\n position: absolute;\n height: 100%;\n border-radius: 4px;\n z-index: 1;\n}\n\n.dough-multi-progress-bar {\n height: 8px;\n width: 100%;\n border-radius: 8px;\n display: flex;\n}\n\n.dough-multi-progress-bar__progress {\n height: 100%;\n z-index: 1;\n border-left: 1px solid rgb(110, 111, 117);\n}\n.dough-multi-progress-bar__progress:first-of-type {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n border-left: unset;\n}\n.dough-multi-progress-bar__progress:not(:last-of-type) {\n border-right: 1px solid rgb(110, 111, 117);\n}\n.dough-multi-progress-bar__progress:last-of-type {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n}";
4521
+ var css_248z$x = "/* COLORS */\n/* Typography*/\n/*Dennis should provide medium font size*/\n.dough-progress-bar {\n height: 4px;\n width: 100%;\n border-radius: 4px;\n position: relative;\n}\n\n.dough-progress-bar__progress {\n position: absolute;\n height: 100%;\n border-radius: 4px;\n z-index: 1;\n}\n\n.dough-multi-progress-bar {\n height: 8px;\n width: 100%;\n border-radius: 8px;\n display: flex;\n}\n\n.dough-multi-progress-bar__progress {\n height: 100%;\n z-index: 1;\n}\n.dough-multi-progress-bar__progress:first-of-type {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n}\n.dough-multi-progress-bar__progress:not(:last-of-type) {\n border-right: 1px solid rgb(110, 111, 117);\n}\n.dough-multi-progress-bar__progress:last-of-type {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n}";
4522
4522
  styleInject(css_248z$x);
4523
4523
 
4524
4524
  var DesignTokens = {
@@ -4715,6 +4715,24 @@ var getColorWithFallback = function (color) {
4715
4715
  return isStandardColor(color) || isFixedColor(color) ? "var(--" + color + ")" : color;
4716
4716
  };
4717
4717
 
4718
+ var MultiProgressBar = function (_a) {
4719
+ var dataAttributes = _a.dataAttributes, className = _a.className, _b = _a.railColor, railColor = _b === void 0 ? "#EDEDED" : _b, data = _a.data, total = _a.total;
4720
+ var aggregatedTotal = data.reduce(function (agg, el) { return agg + el.value; }, 0);
4721
+ var normalizedTotal = aggregatedTotal > total ? aggregatedTotal : total;
4722
+ return (React.createElement("div", __assign({ className: cn("dough-multi-progress-bar", className) }, dataAttributes, { style: {
4723
+ backgroundColor: getColorWithFallback(railColor),
4724
+ } }),
4725
+ data.filter(Boolean).map(function (_a, index) {
4726
+ var value = _a.value, color = _a.color;
4727
+ return (React.createElement("div", { key: index, className: "dough-multi-progress-bar__progress", style: {
4728
+ backgroundColor: getColorWithFallback(color),
4729
+ width: "calc(" + value + " / " + normalizedTotal + " * 100%)",
4730
+ } }));
4731
+ }),
4732
+ aggregatedTotal < total && (React.createElement("div", { className: "dough-multi-progress-bar__progress" }))));
4733
+ };
4734
+ MultiProgressBar.displayName = "MultiProgressBar";
4735
+
4718
4736
  var ProgressBar = function (_a) {
4719
4737
  var total = _a.total, completed = _a.completed, _b = _a.railColor, railColor = _b === void 0 ? "#EDEDED" : _b, _c = _a.barColor, barColor = _c === void 0 ? Colors.SUCCESS : _c, dataAttributes = _a.dataAttributes, className = _a.className;
4720
4738
  return (React.createElement("div", __assign({ className: cn("dough-progress-bar", className) }, dataAttributes, { style: {
@@ -5654,4 +5672,4 @@ GridItem.displayName = "GridItem";
5654
5672
 
5655
5673
  injectRobotoFont();
5656
5674
 
5657
- export { AlertStatus, AlertText, AppBackground, AppWrapper, Avatar, BR, Badge, BorderStyles, Box, BoxAlign, BoxAlignContent, BoxAlignment, BoxDirection, BoxDisplay, BoxJustifyContent, BoxOverflow, BoxWrap, BreadCrumb, BreadCrumbText, BreakpointViewer, BreakpointViewportSizes, Button, ButtonInputType, Card, Carousel, CheckBox, Collapser, ColorTile, Colors, ColorsIcon, ColorsText, Container, ContentSlider, DatePicker, DateTime, DesignTokens, Dialog, Direction, Divider, DoughDateInput, DoughListItem, DropMenu, Fader, FixedColors, Footer, Grid, GridContentAlignment, GridFlow, GridItem, GridItemsAlignment, H1, H2, H3, H4, H5, H6, H7, Header, HorizontalAlignment, HorizontalListSlider, Image, ImageCarousel, ImageContentShowOnHoverClassName, InputWrapper, LayoutContainer, LayoutFlexBox, Link, Notification, NumericInput, Overlay, OverlayVariant, PanelOverlay, Paragraph, ProgressBar, RadioGroup, RadioOption, SelectBox, Sizes, Skeleton, SkeletonShape, Spacer, Spacings, Spinner, StepsIndicator, StrengthIndicator, Subtitle, Switch, Table, TableCell, TableRow, TableRowStyle, TabsContainer, Tag, Text, TextAlignment, TextArea, TextInput, TimePicker, Toggle, ToggleWithText, Tooltip, TooltipDirection, UnorderedList, VerticalAlignment, cancelEvent, checkComponentType, cn, findParentBySelector, generateUID, hideLastDoughTooltip, isStandardColor, setBreakpointSizeManually };
5675
+ export { AlertStatus, AlertText, AppBackground, AppWrapper, Avatar, BR, Badge, BorderStyles, Box, BoxAlign, BoxAlignContent, BoxAlignment, BoxDirection, BoxDisplay, BoxJustifyContent, BoxOverflow, BoxWrap, BreadCrumb, BreadCrumbText, BreakpointViewer, BreakpointViewportSizes, Button, ButtonInputType, Card, Carousel, CheckBox, Collapser, ColorTile, Colors, ColorsIcon, ColorsText, Container, ContentSlider, DatePicker, DateTime, DesignTokens, Dialog, Direction, Divider, DoughDateInput, DoughListItem, DropMenu, Fader, FixedColors, Footer, Grid, GridContentAlignment, GridFlow, GridItem, GridItemsAlignment, H1, H2, H3, H4, H5, H6, H7, Header, HorizontalAlignment, HorizontalListSlider, Image, ImageCarousel, ImageContentShowOnHoverClassName, InputWrapper, LayoutContainer, LayoutFlexBox, Link, MultiProgressBar, Notification, NumericInput, Overlay, OverlayVariant, PanelOverlay, Paragraph, ProgressBar, RadioGroup, RadioOption, SelectBox, Sizes, Skeleton, SkeletonShape, Spacer, Spacings, Spinner, StepsIndicator, StrengthIndicator, Subtitle, Switch, Table, TableCell, TableRow, TableRowStyle, TabsContainer, Tag, Text, TextAlignment, TextArea, TextInput, TimePicker, Toggle, ToggleWithText, Tooltip, TooltipDirection, UnorderedList, VerticalAlignment, cancelEvent, checkComponentType, cn, findParentBySelector, generateUID, hideLastDoughTooltip, isStandardColor, setBreakpointSizeManually };
package/dist/index.js CHANGED
@@ -4501,7 +4501,7 @@ var PanelOverlay = function (props) {
4501
4501
  };
4502
4502
  PanelOverlay.displayName = "PanelOverlay";
4503
4503
 
4504
- var css_248z$x = "/* COLORS */\n/* Typography*/\n/*Dennis should provide medium font size*/\n.dough-progress-bar {\n height: 4px;\n width: 100%;\n border-radius: 4px;\n position: relative;\n}\n\n.dough-progress-bar__progress {\n position: absolute;\n height: 100%;\n border-radius: 4px;\n z-index: 1;\n}\n\n.dough-multi-progress-bar {\n height: 8px;\n width: 100%;\n border-radius: 8px;\n display: flex;\n}\n\n.dough-multi-progress-bar__progress {\n height: 100%;\n z-index: 1;\n border-left: 1px solid rgb(110, 111, 117);\n}\n.dough-multi-progress-bar__progress:first-of-type {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n border-left: unset;\n}\n.dough-multi-progress-bar__progress:not(:last-of-type) {\n border-right: 1px solid rgb(110, 111, 117);\n}\n.dough-multi-progress-bar__progress:last-of-type {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n}";
4504
+ var css_248z$x = "/* COLORS */\n/* Typography*/\n/*Dennis should provide medium font size*/\n.dough-progress-bar {\n height: 4px;\n width: 100%;\n border-radius: 4px;\n position: relative;\n}\n\n.dough-progress-bar__progress {\n position: absolute;\n height: 100%;\n border-radius: 4px;\n z-index: 1;\n}\n\n.dough-multi-progress-bar {\n height: 8px;\n width: 100%;\n border-radius: 8px;\n display: flex;\n}\n\n.dough-multi-progress-bar__progress {\n height: 100%;\n z-index: 1;\n}\n.dough-multi-progress-bar__progress:first-of-type {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n}\n.dough-multi-progress-bar__progress:not(:last-of-type) {\n border-right: 1px solid rgb(110, 111, 117);\n}\n.dough-multi-progress-bar__progress:last-of-type {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n}";
4505
4505
  styleInject(css_248z$x);
4506
4506
 
4507
4507
  var DesignTokens = {
@@ -4698,6 +4698,24 @@ var getColorWithFallback = function (color) {
4698
4698
  return isStandardColor(color) || isFixedColor(color) ? "var(--" + color + ")" : color;
4699
4699
  };
4700
4700
 
4701
+ var MultiProgressBar = function (_a) {
4702
+ var dataAttributes = _a.dataAttributes, className = _a.className, _b = _a.railColor, railColor = _b === void 0 ? "#EDEDED" : _b, data = _a.data, total = _a.total;
4703
+ var aggregatedTotal = data.reduce(function (agg, el) { return agg + el.value; }, 0);
4704
+ var normalizedTotal = aggregatedTotal > total ? aggregatedTotal : total;
4705
+ return (React__default.createElement("div", __assign({ className: cn("dough-multi-progress-bar", className) }, dataAttributes, { style: {
4706
+ backgroundColor: getColorWithFallback(railColor),
4707
+ } }),
4708
+ data.filter(Boolean).map(function (_a, index) {
4709
+ var value = _a.value, color = _a.color;
4710
+ return (React__default.createElement("div", { key: index, className: "dough-multi-progress-bar__progress", style: {
4711
+ backgroundColor: getColorWithFallback(color),
4712
+ width: "calc(" + value + " / " + normalizedTotal + " * 100%)",
4713
+ } }));
4714
+ }),
4715
+ aggregatedTotal < total && (React__default.createElement("div", { className: "dough-multi-progress-bar__progress" }))));
4716
+ };
4717
+ MultiProgressBar.displayName = "MultiProgressBar";
4718
+
4701
4719
  var ProgressBar = function (_a) {
4702
4720
  var total = _a.total, completed = _a.completed, _b = _a.railColor, railColor = _b === void 0 ? "#EDEDED" : _b, _c = _a.barColor, barColor = _c === void 0 ? exports.Colors.SUCCESS : _c, dataAttributes = _a.dataAttributes, className = _a.className;
4703
4721
  return (React__default.createElement("div", __assign({ className: cn("dough-progress-bar", className) }, dataAttributes, { style: {
@@ -5676,6 +5694,7 @@ exports.InputWrapper = InputWrapper;
5676
5694
  exports.LayoutContainer = LayoutContainer;
5677
5695
  exports.LayoutFlexBox = LayoutFlexBox;
5678
5696
  exports.Link = Link;
5697
+ exports.MultiProgressBar = MultiProgressBar;
5679
5698
  exports.Notification = Notification;
5680
5699
  exports.NumericInput = NumericInput;
5681
5700
  exports.Overlay = Overlay;
@@ -3,4 +3,5 @@ export default _default;
3
3
  export declare const Empty: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, import("./multi-progress-bar").MultiProgressBarProps>;
4
4
  export declare const SingleData: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, import("./multi-progress-bar").MultiProgressBarProps>;
5
5
  export declare const MultipleData: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, import("./multi-progress-bar").MultiProgressBarProps>;
6
+ export declare const BigData: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, import("./multi-progress-bar").MultiProgressBarProps>;
6
7
  export declare const FullyFilled: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, import("./multi-progress-bar").MultiProgressBarProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@speakapbv/dough-component-library",
3
- "version": "10.1.0",
3
+ "version": "10.1.2",
4
4
  "description": "DOUGH: Speakap React Component Library",
5
5
  "author": "Speakap",
6
6
  "license": "MIT",