@speakapbv/dough-component-library 9.7.1 → 9.11.0

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.
@@ -8,6 +8,7 @@ export declare enum ButtonInputType {
8
8
  LINK = "link"
9
9
  }
10
10
  export interface ButtonProps {
11
+ alignIconRight?: boolean;
11
12
  className?: string;
12
13
  children?: ReactNode;
13
14
  dataAttributes?: DoughDataAttributes;
@@ -6,6 +6,7 @@ export declare type DoughDropMenuRef = {
6
6
  hide(): void;
7
7
  };
8
8
  export interface DropMenuProps {
9
+ alignIconRight?: boolean;
9
10
  className?: string;
10
11
  children?: ReactNode;
11
12
  dataAttributes?: DoughDataAttributes;
@@ -14,6 +14,10 @@ export interface ImageProps {
14
14
  borderColor?: Colors;
15
15
  width?: string;
16
16
  height?: string;
17
+ ratio?: {
18
+ width: number;
19
+ height: number;
20
+ };
17
21
  opacity?: number;
18
22
  rounded?: boolean;
19
23
  borderRadius?: boolean;
@@ -6,6 +6,7 @@ export interface TagProps {
6
6
  children?: ReactNode;
7
7
  dataAttributes?: DoughDataAttributes;
8
8
  color?: Colors;
9
+ big?: boolean;
9
10
  onRemove?(): void;
10
11
  }
11
12
  export declare const Tag: {
package/dist/index.d.ts CHANGED
@@ -58,7 +58,7 @@ export { Box, BoxAlign, BoxAlignment, BoxAlignContent, BoxDirection, BoxDisplay,
58
58
  export { Grid, GridContentAlignment, GridItemsAlignment, GridFlow, } from "./components/containers/grid/grid";
59
59
  export { GridItem } from "./components/containers/grid/grid-item";
60
60
  export { cancelEvent } from "./utils/event";
61
- export { findParentBySelector } from "./utils/dom-management";
61
+ export { findParentBySelector, setBreakpointSizeManually, } from "./utils/dom-management";
62
62
  export { default as cn } from "./utils/class-names";
63
63
  export { generateUID } from "./utils/guid";
64
64
  export { hideLastDoughTooltip } from "./utils/dom-management";
package/dist/index.es.js CHANGED
@@ -535,9 +535,16 @@ var insertBreakpointControllerDoms = function () {
535
535
  observer.observe(breakpointDom);
536
536
  });
537
537
  };
538
+ var manualBreakpointSize = null;
539
+ var setBreakpointSizeManually = function (size) {
540
+ manualBreakpointSize = size;
541
+ };
538
542
  var registerBreakpointView = function (callbacks, breakpointSize, id) {
539
543
  var _a;
540
- if (typeof IntersectionObserver !== "undefined") {
544
+ if (manualBreakpointSize && manualBreakpointSize === breakpointSize) {
545
+ callbacks.show(breakpointSize);
546
+ }
547
+ else if (typeof IntersectionObserver !== "undefined") {
541
548
  if (document.querySelectorAll(".dough-breakpoint-control").length === 0) {
542
549
  insertBreakpointControllerDoms();
543
550
  }
@@ -600,8 +607,8 @@ var Button = function (props) {
600
607
  var doubleClickPrevent = false;
601
608
  var clickTime = 0;
602
609
  var doubleClickDuration = 250;
603
- var _a = props.shadow, shadow = _a === void 0 ? true : _a, _b = props.padding, padding = _b === void 0 ? true : _b, _c = props.size, size = _c === void 0 ? Sizes.SMALL : _c, _d = props.type, type = _d === void 0 ? ButtonInputType.BUTTON : _d, _e = props.linkProps, linkProps = _e === void 0 ? {} : _e;
604
- var _f = useState(props.color ? props.color : Colors.BUTTON), colorVal = _f[0], setColorVal = _f[1];
610
+ var _a = props.alignIconRight, alignIconRight = _a === void 0 ? false : _a, _b = props.shadow, shadow = _b === void 0 ? true : _b, _c = props.padding, padding = _c === void 0 ? true : _c, _d = props.size, size = _d === void 0 ? Sizes.SMALL : _d, _e = props.type, type = _e === void 0 ? ButtonInputType.BUTTON : _e, _f = props.linkProps, linkProps = _f === void 0 ? {} : _f;
611
+ var _g = useState(props.color ? props.color : Colors.BUTTON), colorVal = _g[0], setColorVal = _g[1];
605
612
  var initColorVal = useState(props.color ? props.color : Colors.BUTTON)[0];
606
613
  var buttonRef = useRef(null);
607
614
  var clickAndDoubleClickHandler = function (eNative, e, handler) {
@@ -688,7 +695,7 @@ var Button = function (props) {
688
695
  return "24px";
689
696
  }
690
697
  }
691
- return "3px";
698
+ return "6px";
692
699
  };
693
700
  useEffect(function () {
694
701
  if (props.color && props.color !== colorVal && buttonRef.current) {
@@ -713,6 +720,7 @@ var Button = function (props) {
713
720
  "dough-button-wait": props.busy,
714
721
  "dough-button-disabled": props.disabled,
715
722
  }) },
723
+ props.icon && !alignIconRight && (React.createElement("div", { className: "dough-button-icon" }, props.icon)),
716
724
  React.createElement("div", { className: cn("dough-button-background-wrapper", initColorVal) },
717
725
  props.color && props.color.match("dough-color-text") && (React.createElement(React.Fragment, null,
718
726
  props.border && (React.createElement("svg", { className: "dough-button-background-wrapper-border-svg" },
@@ -723,7 +731,7 @@ var Button = function (props) {
723
731
  props.busy && (React.createElement("div", { className: "dough-button-waiter" },
724
732
  React.createElement("svg", { width: "100%", height: "100%" },
725
733
  React.createElement("rect", { width: "100%", height: "100%", fill: "currentColor" }))))),
726
- props.icon && (React.createElement("div", { className: "dough-button-icon" }, props.icon)),
734
+ props.icon && alignIconRight && (React.createElement("div", { className: "dough-button-icon" }, props.icon)),
727
735
  React.createElement("div", { className: "dough-button-label" },
728
736
  props.label && React.createElement(React.Fragment, null, props.label),
729
737
  !props.label && props.children && props.children))); };
@@ -1500,9 +1508,9 @@ var css_248z$c = "/* COLORS */\n/* Typography*/\n/*Dennis should provide medium
1500
1508
  styleInject(css_248z$c);
1501
1509
 
1502
1510
  var DropMenu = forwardRef(function (props, ref) {
1503
- var _a = props.color, color = _a === void 0 ? Colors.TRANSPARENT : _a, _b = props.closeOnClickOutside, closeOnClickOutside = _b === void 0 ? true : _b, _c = props.closeOnEscape, closeOnEscape = _c === void 0 ? true : _c, _d = props.disabled, disabled = _d === void 0 ? false : _d, _e = props.showCaret, showCaret = _e === void 0 ? true : _e, _f = props.rightShift, rightShift = _f === void 0 ? 0 : _f, _g = props.shadow, shadow = _g === void 0 ? false : _g, _h = props.show, show = _h === void 0 ? false : _h, _j = props.rounded, rounded = _j === void 0 ? true : _j, _k = props.icon, icon = _k === void 0 ? React.createElement(EllipsisVIcon, null) : _k, _l = props.size, size = _l === void 0 ? Sizes.SMALL : _l, _m = props.innerButtonSize, innerButtonSize = _m === void 0 ? Sizes.NORMAL : _m;
1511
+ var _a = props.alignIconRight, alignIconRight = _a === void 0 ? false : _a, _b = props.color, color = _b === void 0 ? Colors.TRANSPARENT : _b, _c = props.closeOnClickOutside, closeOnClickOutside = _c === void 0 ? true : _c, _d = props.closeOnEscape, closeOnEscape = _d === void 0 ? true : _d, _e = props.disabled, disabled = _e === void 0 ? false : _e, _f = props.showCaret, showCaret = _f === void 0 ? true : _f, _g = props.rightShift, rightShift = _g === void 0 ? 0 : _g, _h = props.shadow, shadow = _h === void 0 ? false : _h, _j = props.show, show = _j === void 0 ? false : _j, _k = props.rounded, rounded = _k === void 0 ? true : _k, _l = props.icon, icon = _l === void 0 ? React.createElement(EllipsisVIcon, null) : _l, _m = props.size, size = _m === void 0 ? Sizes.SMALL : _m, _o = props.innerButtonSize, innerButtonSize = _o === void 0 ? Sizes.NORMAL : _o;
1504
1512
  var componentRef = useRef(null);
1505
- var _o = useState(false), showDropArea = _o[0], setShowDropArea = _o[1];
1513
+ var _p = useState(false), showDropArea = _p[0], setShowDropArea = _p[1];
1506
1514
  var openDropArea = function (e) {
1507
1515
  var _a, _b;
1508
1516
  cancelEvent(e);
@@ -1574,7 +1582,7 @@ var DropMenu = forwardRef(function (props, ref) {
1574
1582
  "dough-dropmenu-as-line": props.asInvisibleLine,
1575
1583
  "dough-dropmenu-full-width": props.fullWidth,
1576
1584
  }), ref: componentRef }, props.dataAttributes),
1577
- props.asInvisibleLine !== true && (React.createElement(Button, { className: cn("dough-drop-menu-button", props.buttonClassName), color: color, disabled: disabled, icon: icon, padding: props.padding, fullWidth: props.fullWidth, label: props.label, onClick: function (e) {
1585
+ props.asInvisibleLine !== true && (React.createElement(Button, { className: cn("dough-drop-menu-button", props.buttonClassName), color: color, disabled: disabled, icon: icon, alignIconRight: alignIconRight, padding: props.padding, fullWidth: props.fullWidth, label: props.label, onClick: function (e) {
1578
1586
  if (showDropArea === true) {
1579
1587
  closeDropArea();
1580
1588
  }
@@ -2888,7 +2896,7 @@ var css_248z$k = "/* COLORS */\n/* Typography*/\n/*Dennis should provide medium
2888
2896
  styleInject(css_248z$k);
2889
2897
 
2890
2898
  var Tag = function (props) { return (React.createElement("div", __assign({ className: cn("dough-tag-item", props.color ? props.color : Colors.HEADER, props.className) }, props.dataAttributes),
2891
- React.createElement(Text, { tiny: true, bold: true }, props.children),
2899
+ React.createElement(Text, { tiny: !props.big, bold: true }, props.children),
2892
2900
  props.onRemove && (React.createElement(Button, { padding: false, color: Colors.TRANSPARENT, icon: React.createElement(CloseIcon, null), onClick: function (e) {
2893
2901
  cancelEvent(e);
2894
2902
  if (typeof props.onRemove === "function") {
@@ -5075,7 +5083,7 @@ var ContentSlider = function (props) {
5075
5083
  };
5076
5084
  ContentSlider.displayName = "ContentSlider";
5077
5085
 
5078
- var css_248z$I = "/* COLORS */\n/* Typography*/\n/*Dennis should provide medium font size*/\n.dough-image-viewer {\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n box-sizing: border-box;\n position: relative;\n z-index: 1;\n background-size: 0px 0px;\n}\n.dough-image-viewer.dough-image-border-radius {\n border-radius: 12px;\n}\n.dough-box.dough-box-border-radius .dough-image-viewer.dough-image-border-radius {\n border-radius: 6px;\n}\n.dough-image-viewer.has-border {\n padding: 3px;\n}\n.dough-image-viewer.has-border > .after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n width: auto;\n height: auto;\n}\n.dough-image-viewer > .dough-image-viewer-as-background {\n display: none;\n}\n.dough-image-viewer > img {\n position: relative;\n z-index: 5;\n object-fit: cover;\n width: 100%;\n height: 100%;\n object-position: center center;\n text-indent: -101%;\n overflow: hidden;\n}\nhtml.dough-IE11 .dough-image-viewer > img {\n opacity: 0;\n}\nhtml.dough-IE11 .dough-image-viewer > img {\n opacity: 0;\n}\nhtml.dough-IE11 .dough-image-viewer > .dough-image-viewer-as-background {\n display: block;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n width: auto;\n height: auto;\n background-position: center center;\n background-size: cover;\n background-repeat: no-repeat;\n}\nhtml.dough-IE11 .dough-image-viewer.has-border > .dough-image-viewer-as-background {\n position: absolute;\n top: 3px;\n right: 3px;\n bottom: 3px;\n left: 3px;\n z-index: 1;\n width: auto;\n height: auto;\n}\n.dough-image-viewer.dough-image-viewer-fit-to-view > img {\n object-fit: contain;\n}\nhtml.dough-IE11 .dough-image-viewer.dough-image-viewer-fit-to-view > img {\n opacity: 0;\n}\nhtml.dough-IE11 .dough-image-viewer.dough-image-viewer-fit-to-view > .dough-image-viewer-as-background {\n background-size: contain;\n}\n.dough-image-viewer.size-extra-small {\n width: 32px !important;\n height: 32px !important;\n}\n.dough-image-viewer.size-extra-small > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-small {\n width: 64px !important;\n height: 64px !important;\n}\n.dough-image-viewer.size-small > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-normal {\n width: 96px !important;\n height: 96px !important;\n}\n.dough-image-viewer.size-normal > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-large {\n width: 128px !important;\n height: 128px !important;\n}\n.dough-image-viewer.size-large > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-extra-large {\n width: 160px !important;\n height: 160px !important;\n}\n.dough-image-viewer.size-extra-large > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.rounded {\n border-radius: 100%;\n}\n.dough-image-viewer.rounded > .dough-image-viewer-as-background,\n.dough-image-viewer.rounded > .after,\n.dough-image-viewer.rounded > img {\n border-radius: 100%;\n}\n.dough-image-viewer > .dough-image-viewer-content-container {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 10;\n width: auto;\n height: auto;\n}\nbody:not(.no-transition) .dough-image-viewer > .dough-image-viewer-content-container {\n transition: all 650ms cubic-bezier(0.25, 1, 0, 1);\n}\nbody.no-transition .dough-image-viewer > .dough-image-viewer-content-container {\n transition: none 0ms linear !important;\n transition-delay: 0ms !important;\n}\n.dough-image-viewer.dough-image-have-children-text-color * {\n color: inherit !important;\n}\n.dough-image-viewer.dough-image-viewer-show-children-on-hover > .dough-image-viewer-content-container {\n opacity: 0;\n pointer-events: none;\n}\n.dough-image-viewer.dough-image-viewer-show-children-on-hover:hover > .dough-image-viewer-content-container {\n opacity: 1;\n}\n.dough-image-viewer:not(:hover) .dough-image-show-only-on-image-hover {\n opacity: 0 !important;\n pointer-events: none !important;\n}";
5086
+ var css_248z$I = "/* COLORS */\n/* Typography*/\n/*Dennis should provide medium font size*/\n.dough-image-viewer {\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n box-sizing: border-box;\n position: relative;\n z-index: 1;\n background-size: 0px 0px;\n}\n.dough-image-viewer.dough-image-border-radius {\n border-radius: 12px;\n}\n.dough-box.dough-box-border-radius .dough-image-viewer.dough-image-border-radius {\n border-radius: 6px;\n}\n.dough-image-viewer.has-border {\n padding: 3px;\n}\n.dough-image-viewer.has-border > .after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n width: auto;\n height: auto;\n}\n.dough-image-viewer > .dough-image-viewer-as-background {\n display: none;\n}\n.dough-image-viewer > img {\n position: relative;\n z-index: 5;\n object-fit: cover;\n width: 100%;\n height: 100%;\n object-position: center center;\n text-indent: -101%;\n overflow: hidden;\n}\nhtml.dough-IE11 .dough-image-viewer > img {\n opacity: 0;\n}\n.dough-image-viewer.dough-image-with-ratio > img {\n position: absolute;\n top: 0;\n left: 0;\n}\nhtml.dough-IE11 .dough-image-viewer > img {\n opacity: 0;\n}\nhtml.dough-IE11 .dough-image-viewer > .dough-image-viewer-as-background {\n display: block;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n width: auto;\n height: auto;\n background-position: center center;\n background-size: cover;\n background-repeat: no-repeat;\n}\nhtml.dough-IE11 .dough-image-viewer.has-border > .dough-image-viewer-as-background {\n position: absolute;\n top: 3px;\n right: 3px;\n bottom: 3px;\n left: 3px;\n z-index: 1;\n width: auto;\n height: auto;\n}\n.dough-image-viewer.dough-image-viewer-fit-to-view > img {\n object-fit: contain;\n}\nhtml.dough-IE11 .dough-image-viewer.dough-image-viewer-fit-to-view > img {\n opacity: 0;\n}\nhtml.dough-IE11 .dough-image-viewer.dough-image-viewer-fit-to-view > .dough-image-viewer-as-background {\n background-size: contain;\n}\n.dough-image-viewer.size-extra-small {\n width: 32px !important;\n height: 32px !important;\n}\n.dough-image-viewer.size-extra-small > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-small {\n width: 64px !important;\n height: 64px !important;\n}\n.dough-image-viewer.size-small > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-normal {\n width: 96px !important;\n height: 96px !important;\n}\n.dough-image-viewer.size-normal > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-large {\n width: 128px !important;\n height: 128px !important;\n}\n.dough-image-viewer.size-large > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-extra-large {\n width: 160px !important;\n height: 160px !important;\n}\n.dough-image-viewer.size-extra-large > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.rounded {\n border-radius: 100%;\n}\n.dough-image-viewer.rounded > .dough-image-viewer-as-background,\n.dough-image-viewer.rounded > .after,\n.dough-image-viewer.rounded > img {\n border-radius: 100%;\n}\n.dough-image-viewer > .dough-image-viewer-content-container {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 10;\n width: auto;\n height: auto;\n}\nbody:not(.no-transition) .dough-image-viewer > .dough-image-viewer-content-container {\n transition: all 650ms cubic-bezier(0.25, 1, 0, 1);\n}\nbody.no-transition .dough-image-viewer > .dough-image-viewer-content-container {\n transition: none 0ms linear !important;\n transition-delay: 0ms !important;\n}\n.dough-image-viewer.dough-image-have-children-text-color * {\n color: inherit !important;\n}\n.dough-image-viewer.dough-image-viewer-show-children-on-hover > .dough-image-viewer-content-container {\n opacity: 0;\n pointer-events: none;\n}\n.dough-image-viewer.dough-image-viewer-show-children-on-hover:hover > .dough-image-viewer-content-container {\n opacity: 1;\n}\n.dough-image-viewer:not(:hover) .dough-image-show-only-on-image-hover {\n opacity: 0 !important;\n pointer-events: none !important;\n}";
5079
5087
  styleInject(css_248z$I);
5080
5088
 
5081
5089
  var ImageContentShowOnHoverClassName = "dough-image-show-only-on-image-hover";
@@ -5087,12 +5095,15 @@ var Image = function (props) {
5087
5095
  "dough-image-border-radius": props.borderRadius,
5088
5096
  "has-border": props.border,
5089
5097
  rounded: props.rounded,
5098
+ "dough-image-with-ratio": props.ratio,
5090
5099
  "dough-image-viewer-fit-to-view": props.fitToView,
5091
5100
  "dough-image-viewer-show-children-on-hover": props.showChildrenOnHover,
5092
- }), style: {
5093
- height: (_a = props.height) !== null && _a !== void 0 ? _a : "initial",
5094
- width: (_b = props.width) !== null && _b !== void 0 ? _b : "initial",
5095
- } }, props.dataAttributes),
5101
+ }), style: __assign({ height: (_a = props.height) !== null && _a !== void 0 ? _a : "initial", width: (_b = props.width) !== null && _b !== void 0 ? _b : "initial" }, (props.ratio
5102
+ ? {
5103
+ paddingTop: (props.ratio.height * 100) /
5104
+ props.ratio.width + "%",
5105
+ }
5106
+ : {})) }, props.dataAttributes),
5096
5107
  React.createElement("img", { alt: "", src: props.src, style: {
5097
5108
  opacity: props.opacity,
5098
5109
  } }),
@@ -5454,4 +5465,4 @@ GridItem.displayName = "GridItem";
5454
5465
 
5455
5466
  injectRobotoFont();
5456
5467
 
5457
- export { AlertStatus, AlertText, AppBackground, AppWrapper, Avatar, BR, Badge, BorderStyles, Box, BoxAlign, BoxAlignContent, BoxAlignment, BoxDirection, BoxDisplay, BoxJustifyContent, BoxOverflow, BoxWrap, BreadCrumb, BreakpointViewer, BreakpointViewportSizes, Button, ButtonInputType, Card, Carousel, CheckBox, Collapser, Colors, ColorsIcon, ColorsText, Container, ContentSlider, DatePicker, DateTime, DesignTokens, Dialog, Direction, Divider, DoughDateInput, DropMenu, Fader, 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, PanelOverlay, Paragraph, 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, VerticalAlignment, cancelEvent, checkComponentType, cn, findParentBySelector, generateUID, hideLastDoughTooltip };
5468
+ export { AlertStatus, AlertText, AppBackground, AppWrapper, Avatar, BR, Badge, BorderStyles, Box, BoxAlign, BoxAlignContent, BoxAlignment, BoxDirection, BoxDisplay, BoxJustifyContent, BoxOverflow, BoxWrap, BreadCrumb, BreakpointViewer, BreakpointViewportSizes, Button, ButtonInputType, Card, Carousel, CheckBox, Collapser, Colors, ColorsIcon, ColorsText, Container, ContentSlider, DatePicker, DateTime, DesignTokens, Dialog, Direction, Divider, DoughDateInput, DropMenu, Fader, 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, PanelOverlay, Paragraph, 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, VerticalAlignment, cancelEvent, checkComponentType, cn, findParentBySelector, generateUID, hideLastDoughTooltip, setBreakpointSizeManually };
package/dist/index.js CHANGED
@@ -531,9 +531,16 @@ var insertBreakpointControllerDoms = function () {
531
531
  observer.observe(breakpointDom);
532
532
  });
533
533
  };
534
+ var manualBreakpointSize = null;
535
+ var setBreakpointSizeManually = function (size) {
536
+ manualBreakpointSize = size;
537
+ };
534
538
  var registerBreakpointView = function (callbacks, breakpointSize, id) {
535
539
  var _a;
536
- if (typeof IntersectionObserver !== "undefined") {
540
+ if (manualBreakpointSize && manualBreakpointSize === breakpointSize) {
541
+ callbacks.show(breakpointSize);
542
+ }
543
+ else if (typeof IntersectionObserver !== "undefined") {
537
544
  if (document.querySelectorAll(".dough-breakpoint-control").length === 0) {
538
545
  insertBreakpointControllerDoms();
539
546
  }
@@ -595,8 +602,8 @@ var Button = function (props) {
595
602
  var doubleClickPrevent = false;
596
603
  var clickTime = 0;
597
604
  var doubleClickDuration = 250;
598
- var _a = props.shadow, shadow = _a === void 0 ? true : _a, _b = props.padding, padding = _b === void 0 ? true : _b, _c = props.size, size = _c === void 0 ? exports.Sizes.SMALL : _c, _d = props.type, type = _d === void 0 ? exports.ButtonInputType.BUTTON : _d, _e = props.linkProps, linkProps = _e === void 0 ? {} : _e;
599
- var _f = React.useState(props.color ? props.color : exports.Colors.BUTTON), colorVal = _f[0], setColorVal = _f[1];
605
+ var _a = props.alignIconRight, alignIconRight = _a === void 0 ? false : _a, _b = props.shadow, shadow = _b === void 0 ? true : _b, _c = props.padding, padding = _c === void 0 ? true : _c, _d = props.size, size = _d === void 0 ? exports.Sizes.SMALL : _d, _e = props.type, type = _e === void 0 ? exports.ButtonInputType.BUTTON : _e, _f = props.linkProps, linkProps = _f === void 0 ? {} : _f;
606
+ var _g = React.useState(props.color ? props.color : exports.Colors.BUTTON), colorVal = _g[0], setColorVal = _g[1];
600
607
  var initColorVal = React.useState(props.color ? props.color : exports.Colors.BUTTON)[0];
601
608
  var buttonRef = React.useRef(null);
602
609
  var clickAndDoubleClickHandler = function (eNative, e, handler) {
@@ -683,7 +690,7 @@ var Button = function (props) {
683
690
  return "24px";
684
691
  }
685
692
  }
686
- return "3px";
693
+ return "6px";
687
694
  };
688
695
  React.useEffect(function () {
689
696
  if (props.color && props.color !== colorVal && buttonRef.current) {
@@ -708,6 +715,7 @@ var Button = function (props) {
708
715
  "dough-button-wait": props.busy,
709
716
  "dough-button-disabled": props.disabled,
710
717
  }) },
718
+ props.icon && !alignIconRight && (React__default.createElement("div", { className: "dough-button-icon" }, props.icon)),
711
719
  React__default.createElement("div", { className: cn("dough-button-background-wrapper", initColorVal) },
712
720
  props.color && props.color.match("dough-color-text") && (React__default.createElement(React__default.Fragment, null,
713
721
  props.border && (React__default.createElement("svg", { className: "dough-button-background-wrapper-border-svg" },
@@ -718,7 +726,7 @@ var Button = function (props) {
718
726
  props.busy && (React__default.createElement("div", { className: "dough-button-waiter" },
719
727
  React__default.createElement("svg", { width: "100%", height: "100%" },
720
728
  React__default.createElement("rect", { width: "100%", height: "100%", fill: "currentColor" }))))),
721
- props.icon && (React__default.createElement("div", { className: "dough-button-icon" }, props.icon)),
729
+ props.icon && alignIconRight && (React__default.createElement("div", { className: "dough-button-icon" }, props.icon)),
722
730
  React__default.createElement("div", { className: "dough-button-label" },
723
731
  props.label && React__default.createElement(React__default.Fragment, null, props.label),
724
732
  !props.label && props.children && props.children))); };
@@ -1486,9 +1494,9 @@ var css_248z$c = "/* COLORS */\n/* Typography*/\n/*Dennis should provide medium
1486
1494
  styleInject(css_248z$c);
1487
1495
 
1488
1496
  var DropMenu = React.forwardRef(function (props, ref) {
1489
- var _a = props.color, color = _a === void 0 ? exports.Colors.TRANSPARENT : _a, _b = props.closeOnClickOutside, closeOnClickOutside = _b === void 0 ? true : _b, _c = props.closeOnEscape, closeOnEscape = _c === void 0 ? true : _c, _d = props.disabled, disabled = _d === void 0 ? false : _d, _e = props.showCaret, showCaret = _e === void 0 ? true : _e, _f = props.rightShift, rightShift = _f === void 0 ? 0 : _f, _g = props.shadow, shadow = _g === void 0 ? false : _g, _h = props.show, show = _h === void 0 ? false : _h, _j = props.rounded, rounded = _j === void 0 ? true : _j, _k = props.icon, icon = _k === void 0 ? React__default.createElement(EllipsisVIcon, null) : _k, _l = props.size, size = _l === void 0 ? exports.Sizes.SMALL : _l, _m = props.innerButtonSize, innerButtonSize = _m === void 0 ? exports.Sizes.NORMAL : _m;
1497
+ var _a = props.alignIconRight, alignIconRight = _a === void 0 ? false : _a, _b = props.color, color = _b === void 0 ? exports.Colors.TRANSPARENT : _b, _c = props.closeOnClickOutside, closeOnClickOutside = _c === void 0 ? true : _c, _d = props.closeOnEscape, closeOnEscape = _d === void 0 ? true : _d, _e = props.disabled, disabled = _e === void 0 ? false : _e, _f = props.showCaret, showCaret = _f === void 0 ? true : _f, _g = props.rightShift, rightShift = _g === void 0 ? 0 : _g, _h = props.shadow, shadow = _h === void 0 ? false : _h, _j = props.show, show = _j === void 0 ? false : _j, _k = props.rounded, rounded = _k === void 0 ? true : _k, _l = props.icon, icon = _l === void 0 ? React__default.createElement(EllipsisVIcon, null) : _l, _m = props.size, size = _m === void 0 ? exports.Sizes.SMALL : _m, _o = props.innerButtonSize, innerButtonSize = _o === void 0 ? exports.Sizes.NORMAL : _o;
1490
1498
  var componentRef = React.useRef(null);
1491
- var _o = React.useState(false), showDropArea = _o[0], setShowDropArea = _o[1];
1499
+ var _p = React.useState(false), showDropArea = _p[0], setShowDropArea = _p[1];
1492
1500
  var openDropArea = function (e) {
1493
1501
  var _a, _b;
1494
1502
  cancelEvent(e);
@@ -1560,7 +1568,7 @@ var DropMenu = React.forwardRef(function (props, ref) {
1560
1568
  "dough-dropmenu-as-line": props.asInvisibleLine,
1561
1569
  "dough-dropmenu-full-width": props.fullWidth,
1562
1570
  }), ref: componentRef }, props.dataAttributes),
1563
- props.asInvisibleLine !== true && (React__default.createElement(Button, { className: cn("dough-drop-menu-button", props.buttonClassName), color: color, disabled: disabled, icon: icon, padding: props.padding, fullWidth: props.fullWidth, label: props.label, onClick: function (e) {
1571
+ props.asInvisibleLine !== true && (React__default.createElement(Button, { className: cn("dough-drop-menu-button", props.buttonClassName), color: color, disabled: disabled, icon: icon, alignIconRight: alignIconRight, padding: props.padding, fullWidth: props.fullWidth, label: props.label, onClick: function (e) {
1564
1572
  if (showDropArea === true) {
1565
1573
  closeDropArea();
1566
1574
  }
@@ -2873,7 +2881,7 @@ var css_248z$k = "/* COLORS */\n/* Typography*/\n/*Dennis should provide medium
2873
2881
  styleInject(css_248z$k);
2874
2882
 
2875
2883
  var Tag = function (props) { return (React__default.createElement("div", __assign({ className: cn("dough-tag-item", props.color ? props.color : exports.Colors.HEADER, props.className) }, props.dataAttributes),
2876
- React__default.createElement(Text, { tiny: true, bold: true }, props.children),
2884
+ React__default.createElement(Text, { tiny: !props.big, bold: true }, props.children),
2877
2885
  props.onRemove && (React__default.createElement(Button, { padding: false, color: exports.Colors.TRANSPARENT, icon: React__default.createElement(CloseIcon, null), onClick: function (e) {
2878
2886
  cancelEvent(e);
2879
2887
  if (typeof props.onRemove === "function") {
@@ -5059,7 +5067,7 @@ var ContentSlider = function (props) {
5059
5067
  };
5060
5068
  ContentSlider.displayName = "ContentSlider";
5061
5069
 
5062
- var css_248z$I = "/* COLORS */\n/* Typography*/\n/*Dennis should provide medium font size*/\n.dough-image-viewer {\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n box-sizing: border-box;\n position: relative;\n z-index: 1;\n background-size: 0px 0px;\n}\n.dough-image-viewer.dough-image-border-radius {\n border-radius: 12px;\n}\n.dough-box.dough-box-border-radius .dough-image-viewer.dough-image-border-radius {\n border-radius: 6px;\n}\n.dough-image-viewer.has-border {\n padding: 3px;\n}\n.dough-image-viewer.has-border > .after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n width: auto;\n height: auto;\n}\n.dough-image-viewer > .dough-image-viewer-as-background {\n display: none;\n}\n.dough-image-viewer > img {\n position: relative;\n z-index: 5;\n object-fit: cover;\n width: 100%;\n height: 100%;\n object-position: center center;\n text-indent: -101%;\n overflow: hidden;\n}\nhtml.dough-IE11 .dough-image-viewer > img {\n opacity: 0;\n}\nhtml.dough-IE11 .dough-image-viewer > img {\n opacity: 0;\n}\nhtml.dough-IE11 .dough-image-viewer > .dough-image-viewer-as-background {\n display: block;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n width: auto;\n height: auto;\n background-position: center center;\n background-size: cover;\n background-repeat: no-repeat;\n}\nhtml.dough-IE11 .dough-image-viewer.has-border > .dough-image-viewer-as-background {\n position: absolute;\n top: 3px;\n right: 3px;\n bottom: 3px;\n left: 3px;\n z-index: 1;\n width: auto;\n height: auto;\n}\n.dough-image-viewer.dough-image-viewer-fit-to-view > img {\n object-fit: contain;\n}\nhtml.dough-IE11 .dough-image-viewer.dough-image-viewer-fit-to-view > img {\n opacity: 0;\n}\nhtml.dough-IE11 .dough-image-viewer.dough-image-viewer-fit-to-view > .dough-image-viewer-as-background {\n background-size: contain;\n}\n.dough-image-viewer.size-extra-small {\n width: 32px !important;\n height: 32px !important;\n}\n.dough-image-viewer.size-extra-small > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-small {\n width: 64px !important;\n height: 64px !important;\n}\n.dough-image-viewer.size-small > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-normal {\n width: 96px !important;\n height: 96px !important;\n}\n.dough-image-viewer.size-normal > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-large {\n width: 128px !important;\n height: 128px !important;\n}\n.dough-image-viewer.size-large > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-extra-large {\n width: 160px !important;\n height: 160px !important;\n}\n.dough-image-viewer.size-extra-large > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.rounded {\n border-radius: 100%;\n}\n.dough-image-viewer.rounded > .dough-image-viewer-as-background,\n.dough-image-viewer.rounded > .after,\n.dough-image-viewer.rounded > img {\n border-radius: 100%;\n}\n.dough-image-viewer > .dough-image-viewer-content-container {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 10;\n width: auto;\n height: auto;\n}\nbody:not(.no-transition) .dough-image-viewer > .dough-image-viewer-content-container {\n transition: all 650ms cubic-bezier(0.25, 1, 0, 1);\n}\nbody.no-transition .dough-image-viewer > .dough-image-viewer-content-container {\n transition: none 0ms linear !important;\n transition-delay: 0ms !important;\n}\n.dough-image-viewer.dough-image-have-children-text-color * {\n color: inherit !important;\n}\n.dough-image-viewer.dough-image-viewer-show-children-on-hover > .dough-image-viewer-content-container {\n opacity: 0;\n pointer-events: none;\n}\n.dough-image-viewer.dough-image-viewer-show-children-on-hover:hover > .dough-image-viewer-content-container {\n opacity: 1;\n}\n.dough-image-viewer:not(:hover) .dough-image-show-only-on-image-hover {\n opacity: 0 !important;\n pointer-events: none !important;\n}";
5070
+ var css_248z$I = "/* COLORS */\n/* Typography*/\n/*Dennis should provide medium font size*/\n.dough-image-viewer {\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n box-sizing: border-box;\n position: relative;\n z-index: 1;\n background-size: 0px 0px;\n}\n.dough-image-viewer.dough-image-border-radius {\n border-radius: 12px;\n}\n.dough-box.dough-box-border-radius .dough-image-viewer.dough-image-border-radius {\n border-radius: 6px;\n}\n.dough-image-viewer.has-border {\n padding: 3px;\n}\n.dough-image-viewer.has-border > .after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n width: auto;\n height: auto;\n}\n.dough-image-viewer > .dough-image-viewer-as-background {\n display: none;\n}\n.dough-image-viewer > img {\n position: relative;\n z-index: 5;\n object-fit: cover;\n width: 100%;\n height: 100%;\n object-position: center center;\n text-indent: -101%;\n overflow: hidden;\n}\nhtml.dough-IE11 .dough-image-viewer > img {\n opacity: 0;\n}\n.dough-image-viewer.dough-image-with-ratio > img {\n position: absolute;\n top: 0;\n left: 0;\n}\nhtml.dough-IE11 .dough-image-viewer > img {\n opacity: 0;\n}\nhtml.dough-IE11 .dough-image-viewer > .dough-image-viewer-as-background {\n display: block;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n width: auto;\n height: auto;\n background-position: center center;\n background-size: cover;\n background-repeat: no-repeat;\n}\nhtml.dough-IE11 .dough-image-viewer.has-border > .dough-image-viewer-as-background {\n position: absolute;\n top: 3px;\n right: 3px;\n bottom: 3px;\n left: 3px;\n z-index: 1;\n width: auto;\n height: auto;\n}\n.dough-image-viewer.dough-image-viewer-fit-to-view > img {\n object-fit: contain;\n}\nhtml.dough-IE11 .dough-image-viewer.dough-image-viewer-fit-to-view > img {\n opacity: 0;\n}\nhtml.dough-IE11 .dough-image-viewer.dough-image-viewer-fit-to-view > .dough-image-viewer-as-background {\n background-size: contain;\n}\n.dough-image-viewer.size-extra-small {\n width: 32px !important;\n height: 32px !important;\n}\n.dough-image-viewer.size-extra-small > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-small {\n width: 64px !important;\n height: 64px !important;\n}\n.dough-image-viewer.size-small > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-normal {\n width: 96px !important;\n height: 96px !important;\n}\n.dough-image-viewer.size-normal > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-large {\n width: 128px !important;\n height: 128px !important;\n}\n.dough-image-viewer.size-large > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.size-extra-large {\n width: 160px !important;\n height: 160px !important;\n}\n.dough-image-viewer.size-extra-large > img {\n width: 100%;\n height: 100%;\n}\n.dough-image-viewer.rounded {\n border-radius: 100%;\n}\n.dough-image-viewer.rounded > .dough-image-viewer-as-background,\n.dough-image-viewer.rounded > .after,\n.dough-image-viewer.rounded > img {\n border-radius: 100%;\n}\n.dough-image-viewer > .dough-image-viewer-content-container {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 10;\n width: auto;\n height: auto;\n}\nbody:not(.no-transition) .dough-image-viewer > .dough-image-viewer-content-container {\n transition: all 650ms cubic-bezier(0.25, 1, 0, 1);\n}\nbody.no-transition .dough-image-viewer > .dough-image-viewer-content-container {\n transition: none 0ms linear !important;\n transition-delay: 0ms !important;\n}\n.dough-image-viewer.dough-image-have-children-text-color * {\n color: inherit !important;\n}\n.dough-image-viewer.dough-image-viewer-show-children-on-hover > .dough-image-viewer-content-container {\n opacity: 0;\n pointer-events: none;\n}\n.dough-image-viewer.dough-image-viewer-show-children-on-hover:hover > .dough-image-viewer-content-container {\n opacity: 1;\n}\n.dough-image-viewer:not(:hover) .dough-image-show-only-on-image-hover {\n opacity: 0 !important;\n pointer-events: none !important;\n}";
5063
5071
  styleInject(css_248z$I);
5064
5072
 
5065
5073
  var ImageContentShowOnHoverClassName = "dough-image-show-only-on-image-hover";
@@ -5071,12 +5079,15 @@ var Image = function (props) {
5071
5079
  "dough-image-border-radius": props.borderRadius,
5072
5080
  "has-border": props.border,
5073
5081
  rounded: props.rounded,
5082
+ "dough-image-with-ratio": props.ratio,
5074
5083
  "dough-image-viewer-fit-to-view": props.fitToView,
5075
5084
  "dough-image-viewer-show-children-on-hover": props.showChildrenOnHover,
5076
- }), style: {
5077
- height: (_a = props.height) !== null && _a !== void 0 ? _a : "initial",
5078
- width: (_b = props.width) !== null && _b !== void 0 ? _b : "initial",
5079
- } }, props.dataAttributes),
5085
+ }), style: __assign({ height: (_a = props.height) !== null && _a !== void 0 ? _a : "initial", width: (_b = props.width) !== null && _b !== void 0 ? _b : "initial" }, (props.ratio
5086
+ ? {
5087
+ paddingTop: (props.ratio.height * 100) /
5088
+ props.ratio.width + "%",
5089
+ }
5090
+ : {})) }, props.dataAttributes),
5080
5091
  React__default.createElement("img", { alt: "", src: props.src, style: {
5081
5092
  opacity: props.opacity,
5082
5093
  } }),
@@ -5508,3 +5519,4 @@ exports.cn = cn;
5508
5519
  exports.findParentBySelector = findParentBySelector;
5509
5520
  exports.generateUID = generateUID;
5510
5521
  exports.hideLastDoughTooltip = hideLastDoughTooltip;
5522
+ exports.setBreakpointSizeManually = setBreakpointSizeManually;
@@ -22,5 +22,6 @@ export declare const getAppWrapperOverlay: () => any;
22
22
  export declare const getNotificationOverlay: (verticalLayer: any, horizontalLayer: any, selector?: string | undefined) => any;
23
23
  export declare const getInjectedStylesWrapper: () => any;
24
24
  export declare const findParentBySelector: (element: HTMLElement, selector: string) => HTMLElement;
25
+ export declare const setBreakpointSizeManually: (size: BreakpointViewportSizes | null) => void;
25
26
  export declare const registerBreakpointView: (callbacks: any, breakpointSize: BreakpointViewportSizes, id: string) => void;
26
27
  export declare const deRegisterBreakpointView: (id: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@speakapbv/dough-component-library",
3
- "version": "9.7.1",
3
+ "version": "9.11.0",
4
4
  "description": "DOUGH: Speakap React Component Library",
5
5
  "author": "Speakap",
6
6
  "license": "MIT",