@mmb-digital/ds-lilly 0.8.0 → 0.8.3

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/ds-lilly.js CHANGED
@@ -86950,7 +86950,7 @@ var Tooltip = function (_a) {
86950
86950
  offset: [0, verticalOffset]
86951
86951
  }), getArrowProps = _l.getArrowProps, getTooltipProps = _l.getTooltipProps, setTooltipRef = _l.setTooltipRef, setTriggerRef = _l.setTriggerRef, visible = _l.visible;
86952
86952
  return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["Fragment"], null,
86953
- Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["cloneElement"])(children, { ref: setTriggerRef, tabIndex: 0, 'aria-describedBy': identifier }),
86953
+ Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["cloneElement"])(children, { ref: setTriggerRef, tabIndex: 0, 'aria-describedby': identifier }),
86954
86954
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("span", { "aria-hidden": visible, "aria-live": "polite", className: "c-tooltip-wrapper", id: identifier, role: "tooltip", tabIndex: -1 }, visible && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", Tooltip_assign({ ref: setTooltipRef, "data-testid": testId }, getTooltipProps({
86955
86955
  className: classBinder_cx('c-tooltip', "c-tooltip--" + type, "c-tooltip--" + placement, { 'upper-case': isUpperCased, 'c-tooltip--bold': isBold }, theme)
86956
86956
  })),
@@ -96629,7 +96629,7 @@ var getTextAlignClass = function (align) {
96629
96629
  }
96630
96630
  };
96631
96631
  var ContentTable = function (_a) {
96632
- var caption = _a.caption, _b = _a.columns, columns = _b === void 0 ? [] : _b, hasIcons = _a.hasIcons, _c = _a.hideSubtitleOnExpand, hideSubtitleOnExpand = _c === void 0 ? true : _c, children = _a.children, isCaptionHidden = _a.isCaptionHidden, isCollapsible = _a.isCollapsible, titleHeader = _a.titleHeader, _d = _a.titleAlignContent, titleAlignContent = _d === void 0 ? 'left' : _d, withoutOpeners = _a.withoutOpeners;
96632
+ var caption = _a.caption, _b = _a.columns, columns = _b === void 0 ? [] : _b, hasIcons = _a.hasIcons, _c = _a.hideSubtitleOnExpand, hideSubtitleOnExpand = _c === void 0 ? true : _c, children = _a.children, isCaptionHidden = _a.isCaptionHidden, isCollapsible = _a.isCollapsible, testId = _a.testId, titleHeader = _a.titleHeader, _d = _a.titleAlignContent, titleAlignContent = _d === void 0 ? 'left' : _d, withoutOpeners = _a.withoutOpeners;
96633
96633
  var ref = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useRef"])(null);
96634
96634
  var width = useContainerDimensions(ref).width;
96635
96635
  var isMobileDeviceView = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useMemo"])(function () { return width <= CARD_WIDTH_BREAKPOINT.TABLET; }, [width]);
@@ -96643,7 +96643,7 @@ var ContentTable = function (_a) {
96643
96643
  titleAlignContent: titleAlignContent,
96644
96644
  withoutOpeners: withoutOpeners
96645
96645
  };
96646
- return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("table", { ref: ref, className: "c-contentTable" },
96646
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("table", { ref: ref, className: "c-contentTable", "data-testid": testId },
96647
96647
  caption && external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("caption", { className: isCaptionHidden ? 'u-vHide' : '' }, caption),
96648
96648
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("thead", null,
96649
96649
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("tr", { className: "c-contentTable__header" },
@@ -96749,7 +96749,7 @@ var Tag = function (_a) {
96749
96749
 
96750
96750
  var ContentTableRow = function (_a) {
96751
96751
  var _b;
96752
- var amount = _a.amount, amountSubtitle = _a.amountSubtitle, amountSubtitleType = _a.amountSubtitleType, ariaLabel = _a.ariaLabel, _c = _a.buttons, buttons = _c === void 0 ? [] : _c, _d = _a.columns, columns = _d === void 0 ? [] : _d, currencyCode = _a.currencyCode, customIcon = _a.customIcon, children = _a.children, iconName = _a.iconName, iconBackgroundColor = _a.iconBackgroundColor, _e = _a.iconBadgePosition, iconBadgePosition = _e === void 0 ? 'bottomRight' : _e, id = _a.id, _f = _a.isOpen, isOpen = _f === void 0 ? false : _f, _g = _a.subtitles, subtitles = _g === void 0 ? [] : _g, subtitleTagIconBackgroundColor = _a.subtitleTagIconBackgroundColor, subtitleTagIconName = _a.subtitleTagIconName, subtitleTagIconImageUrl = _a.subtitleTagIconImageUrl, subtitleTagText = _a.subtitleTagText, title = _a.title, _h = _a.titleSize, titleSize = _h === void 0 ? 'h2' : _h, _j = _a.titleVisual, titleVisual = _j === void 0 ? 'h6' : _j;
96752
+ var amount = _a.amount, amountCurrencyCode = _a.amountCurrencyCode, amountLocale = _a.amountLocale, amountMaximumFractionDigits = _a.amountMaximumFractionDigits, amountMinimumFractionDigits = _a.amountMinimumFractionDigits, amountSubtitle = _a.amountSubtitle, amountSubtitleType = _a.amountSubtitleType, ariaLabel = _a.ariaLabel, _c = _a.buttons, buttons = _c === void 0 ? [] : _c, _d = _a.columns, columns = _d === void 0 ? [] : _d, customIcon = _a.customIcon, children = _a.children, iconName = _a.iconName, iconBackgroundColor = _a.iconBackgroundColor, _e = _a.iconBadgePosition, iconBadgePosition = _e === void 0 ? 'bottomRight' : _e, id = _a.id, _f = _a.isOpen, isOpen = _f === void 0 ? false : _f, onToggle = _a.onToggle, _g = _a.subtitles, subtitles = _g === void 0 ? [] : _g, subtitleTagIconBackgroundColor = _a.subtitleTagIconBackgroundColor, subtitleTagIconName = _a.subtitleTagIconName, subtitleTagIconImageUrl = _a.subtitleTagIconImageUrl, subtitleTagText = _a.subtitleTagText, testId = _a.testId, title = _a.title, _h = _a.titleSize, titleSize = _h === void 0 ? 'h2' : _h, _j = _a.titleVisual, titleVisual = _j === void 0 ? 'h6' : _j;
96753
96753
  var _k = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useContext"])(contexts_ContentTableContext), columnsDefinition = _k.columns, hasIcons = _k.hasIcons, hideSubtitleOnExpand = _k.hideSubtitleOnExpand, isCollapsible = _k.isCollapsible, isMobileDeviceView = _k.isMobileDeviceView, titleAlignContent = _k.titleAlignContent, withoutOpeners = _k.withoutOpeners;
96754
96754
  var _l = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useMemo"])(function () {
96755
96755
  var buttonsColumn = buttons ? columnsDefinition[columnsDefinition.length - 1] : undefined;
@@ -96767,8 +96767,10 @@ var ContentTableRow = function (_a) {
96767
96767
  var _m = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(isOpen), isOpened = _m[0], setIsOpened = _m[1];
96768
96768
  Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useEffect"])(function () { return setIsOpened(isOpen); }, [isOpen]);
96769
96769
  var handleToggle = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useCallback"])(function () {
96770
- setIsOpened(!isOpened);
96771
- }, [setIsOpened, isOpened]);
96770
+ var next = !isOpened;
96771
+ setIsOpened(next);
96772
+ onToggle && onToggle(next);
96773
+ }, [setIsOpened, isOpened, onToggle]);
96772
96774
  var hasSubtitleTag = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useMemo"])(function () { return (subtitleTagIconName || subtitleTagIconImageUrl) && subtitleTagText; }, [
96773
96775
  subtitleTagIconName,
96774
96776
  subtitleTagIconImageUrl,
@@ -96792,7 +96794,7 @@ var ContentTableRow = function (_a) {
96792
96794
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("tr", { "aria-controls": id ? id + "-content" : undefined, "aria-expanded": isCollapsible && isOpened, "aria-label": ariaLabel, className: classBinder_cx('c-contentTableRow', {
96793
96795
  'c-contentTableRow--collapsible': isCollapsible,
96794
96796
  'c-contentTableRow--collapsible--open': isCollapsible && isOpened
96795
- }), id: id, role: isCollapsible ? 'button' : undefined, tabIndex: isCollapsible ? 0 : undefined, onClick: isCollapsible ? handleToggle : undefined, onKeyDown: handleKeyDown },
96797
+ }), "data-testid": testId, id: id, role: isCollapsible ? 'button' : undefined, tabIndex: isCollapsible ? 0 : undefined, onClick: isCollapsible ? handleToggle : undefined, onKeyDown: handleKeyDown },
96796
96798
  hasIcons && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("td", { className: "c-contentTableRow__column c-contentTableRow__iconColumn" },
96797
96799
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-contentTableRow__iconColumn__icon', "c-contentTableRow__iconColumn__icon" + ucfirst(iconBadgePosition)) },
96798
96800
  iconName && external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Icon, { backgroundColor: iconBackgroundColor, name: iconName, size: "xLarge" }),
@@ -96817,7 +96819,7 @@ var ContentTableRow = function (_a) {
96817
96819
  }),
96818
96820
  amountColumn && !(isMobileDeviceView && amountColumn.hideOnMobile) && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("td", { className: classBinder_cx('c-contentTableRow__column c-contentTableRow__amountColumn', getTextAlignClass(amountColumn.alignContent)) },
96819
96821
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx({ 'c-contentTableRow__column--hidden': amountColumn.hideOnExpand && isOpened }) },
96820
- amount !== undefined && external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(AmountWithUnit, { isBold: true, amount: amount, unitAfter: currencyCode }),
96822
+ amount !== undefined && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(AmountWithUnit, { isBold: true, amount: amount, locale: amountLocale, maximumFractionDigits: amountMaximumFractionDigits, minimumFractionDigits: amountMinimumFractionDigits, unitAfter: amountCurrencyCode })),
96821
96823
  amountSubtitle && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Text, { component: "div", size: "xSmall", type: amountSubtitleType }, amountSubtitle))))),
96822
96824
  buttonsColumn && !(isMobileDeviceView && buttonsColumn.hideOnMobile) && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("td", { className: classBinder_cx('c-contentTableRow__column c-contentTableRow__buttonsColumn', getTextAlignClass(buttonsColumn.alignContent)) },
96823
96825
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx({ 'c-contentTableRow__column--hidden': buttonsColumn.hideOnExpand && isOpened }) }, buttons.map(function (button) {
@@ -24,5 +24,5 @@ export interface ContentTablePropsType extends ComponentPropsType {
24
24
  isCollapsible?: boolean;
25
25
  }
26
26
  export declare const getTextAlignClass: (align?: string | undefined) => string | undefined;
27
- export declare const ContentTable: ({ caption, columns, hasIcons, hideSubtitleOnExpand, children, isCaptionHidden, isCollapsible, titleHeader, titleAlignContent, withoutOpeners }: ContentTablePropsType) => JSX.Element;
27
+ export declare const ContentTable: ({ caption, columns, hasIcons, hideSubtitleOnExpand, children, isCaptionHidden, isCollapsible, testId, titleHeader, titleAlignContent, withoutOpeners }: ContentTablePropsType) => JSX.Element;
28
28
  //# sourceMappingURL=ContentTable.d.ts.map
@@ -10,14 +10,20 @@ export interface ContentTableRowPropsType extends ComponentPropsType {
10
10
  columns?: ReactNode[][];
11
11
  /** Amount column content */
12
12
  amount?: number;
13
+ /** Amount currency code */
14
+ amountCurrencyCode?: string;
15
+ /** Amount locale */
16
+ amountLocale?: string;
17
+ /** The maximum number of amount fraction digits */
18
+ amountMaximumFractionDigits?: number;
19
+ /** The minimum number of amount fraction digits */
20
+ amountMinimumFractionDigits?: number;
13
21
  /** Amount subtitle */
14
22
  amountSubtitle?: ReactNode;
15
23
  /** Amount subtitle type */
16
24
  amountSubtitleType?: TextType;
17
25
  /** Buttons column content */
18
26
  buttons?: ReactElement[];
19
- /** Amount currency code */
20
- currencyCode?: string;
21
27
  /** Custom row icon */
22
28
  customIcon?: ReactNode;
23
29
  /** Content to render on expand */
@@ -32,6 +38,8 @@ export interface ContentTableRowPropsType extends ComponentPropsType {
32
38
  id?: string;
33
39
  /** Flag whether row is expanded */
34
40
  isOpen?: boolean;
41
+ /** Callback called on expand/collapse */
42
+ onToggle?: (isOpened: boolean) => void;
35
43
  /** Title column content */
36
44
  title: ReactNode;
37
45
  /** Title size */
@@ -49,5 +57,5 @@ export interface ContentTableRowPropsType extends ComponentPropsType {
49
57
  /** Subtitle tag content */
50
58
  subtitleTagText?: ReactNode;
51
59
  }
52
- export declare const ContentTableRow: ({ amount, amountSubtitle, amountSubtitleType, ariaLabel, buttons, columns, currencyCode, customIcon, children, iconName, iconBackgroundColor, iconBadgePosition, id, isOpen, subtitles, subtitleTagIconBackgroundColor, subtitleTagIconName, subtitleTagIconImageUrl, subtitleTagText, title, titleSize, titleVisual }: ContentTableRowPropsType) => JSX.Element;
60
+ export declare const ContentTableRow: ({ amount, amountCurrencyCode, amountLocale, amountMaximumFractionDigits, amountMinimumFractionDigits, amountSubtitle, amountSubtitleType, ariaLabel, buttons, columns, customIcon, children, iconName, iconBackgroundColor, iconBadgePosition, id, isOpen, onToggle, subtitles, subtitleTagIconBackgroundColor, subtitleTagIconName, subtitleTagIconImageUrl, subtitleTagText, testId, title, titleSize, titleVisual }: ContentTableRowPropsType) => JSX.Element;
53
61
  //# sourceMappingURL=ContentTableRow.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmb-digital/ds-lilly",
3
- "version": "0.8.0",
3
+ "version": "0.8.3",
4
4
  "description": "MMB LILLY design system",
5
5
  "license": "UNLICENSED",
6
6
  "sideEffects": false,