@speakapbv/dough-component-library 9.8.0 → 9.12.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;
@@ -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) {
@@ -723,10 +730,11 @@ var Button = function (props) {
723
730
  props.busy && (React.createElement("div", { className: "dough-button-waiter" },
724
731
  React.createElement("svg", { width: "100%", height: "100%" },
725
732
  React.createElement("rect", { width: "100%", height: "100%", fill: "currentColor" }))))),
726
- props.icon && (React.createElement("div", { className: "dough-button-icon" }, props.icon)),
733
+ props.icon && !alignIconRight && (React.createElement("div", { className: "dough-button-icon" }, props.icon)),
727
734
  React.createElement("div", { className: "dough-button-label" },
728
735
  props.label && React.createElement(React.Fragment, null, props.label),
729
- !props.label && props.children && props.children))); };
736
+ !props.label && props.children && props.children),
737
+ props.icon && alignIconRight && (React.createElement("div", { className: "dough-button-icon" }, props.icon)))); };
730
738
  return (React.createElement(React.Fragment, null,
731
739
  type === ButtonInputType.LINK && (React.createElement(Link, __assign({ ref: buttonRef, className: cn("dough-button-wrapper", props.className, {
732
740
  "dough-button-full-width": props.fullWidth,
@@ -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") {
@@ -5457,4 +5465,4 @@ GridItem.displayName = "GridItem";
5457
5465
 
5458
5466
  injectRobotoFont();
5459
5467
 
5460
- 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) {
@@ -718,10 +725,11 @@ var Button = function (props) {
718
725
  props.busy && (React__default.createElement("div", { className: "dough-button-waiter" },
719
726
  React__default.createElement("svg", { width: "100%", height: "100%" },
720
727
  React__default.createElement("rect", { width: "100%", height: "100%", fill: "currentColor" }))))),
721
- props.icon && (React__default.createElement("div", { className: "dough-button-icon" }, props.icon)),
728
+ props.icon && !alignIconRight && (React__default.createElement("div", { className: "dough-button-icon" }, props.icon)),
722
729
  React__default.createElement("div", { className: "dough-button-label" },
723
730
  props.label && React__default.createElement(React__default.Fragment, null, props.label),
724
- !props.label && props.children && props.children))); };
731
+ !props.label && props.children && props.children),
732
+ props.icon && alignIconRight && (React__default.createElement("div", { className: "dough-button-icon" }, props.icon)))); };
725
733
  return (React__default.createElement(React__default.Fragment, null,
726
734
  type === exports.ButtonInputType.LINK && (React__default.createElement(Link, __assign({ ref: buttonRef, className: cn("dough-button-wrapper", props.className, {
727
735
  "dough-button-full-width": props.fullWidth,
@@ -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") {
@@ -5511,3 +5519,4 @@ exports.cn = cn;
5511
5519
  exports.findParentBySelector = findParentBySelector;
5512
5520
  exports.generateUID = generateUID;
5513
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.8.0",
3
+ "version": "9.12.0",
4
4
  "description": "DOUGH: Speakap React Component Library",
5
5
  "author": "Speakap",
6
6
  "license": "MIT",