@mmb-digital/ds-lilly 0.0.1-alpha.346 → 0.0.1-alpha.347

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
@@ -105140,8 +105140,9 @@ var Input2 = function (_a) {
105140
105140
  };
105141
105141
  var handleOnChange = function (_a) {
105142
105142
  var value = _a.target.value;
105143
- handleValueSet(value);
105144
- callEventHandler(value, onChange);
105143
+ var returnValue = type === 'number' && !allowNegative && value === minusCharacter ? '' : value;
105144
+ handleValueSet(returnValue);
105145
+ callEventHandler(returnValue, onChange);
105145
105146
  };
105146
105147
  var handleOnBlur = function (_a) {
105147
105148
  var value = _a.target.value;
@@ -110616,7 +110617,7 @@ var TabsBar_assign = (undefined && undefined.__assign) || function () {
110616
110617
 
110617
110618
 
110618
110619
  var TabsBar = function (_a) {
110619
- var moreLabel = _a.moreLabel;
110620
+ var closeTabsBarOnOutsideClick = _a.closeTabsBarOnOutsideClick, moreLabel = _a.moreLabel;
110620
110621
  var _b = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useContext"])(contexts_TabsContext), activeItem = _b.activeItem, identification = _b.identification, setActiveItem = _b.setActiveItem, tabs = _b.tabs, tabsLimit = _b.tabsLimit;
110621
110622
  var enabledIndexes = [];
110622
110623
  var _c = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(false), isDropdownVisible = _c[0], setIsDropdownVisible = _c[1];
@@ -110684,7 +110685,7 @@ var TabsBar = function (_a) {
110684
110685
  var _a, _b, _c;
110685
110686
  var moreHasNotification = false;
110686
110687
  return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("li", { className: classBinder_cx('c-tabs__listItem', { 'is-active': activeItem + 1 >= tabsLimit }) },
110687
- external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Dropdown, { forceVisibility: isDropdownVisible, trigger: null, triggerComponent: external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("button", { "aria-controls": identification + "-tabcontentMore", "aria-selected": activeItem + 1 >= tabsLimit, className: classBinder_cx('c-tabs__listButton', { 'is-disabled': tabs[activeItem].isDisabled }), disabled: tabs[activeItem].isDisabled, id: identification + "-tabMore", role: "tab", tabIndex: activeItem + 1 >= tabsLimit ? 0 : -1, type: "button", onClick: handleToggleDropdownVisibility },
110688
+ external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Dropdown, { closeOnOutsideClick: closeTabsBarOnOutsideClick, forceVisibility: isDropdownVisible, trigger: null, triggerComponent: external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("button", { "aria-controls": identification + "-tabcontentMore", "aria-selected": activeItem + 1 >= tabsLimit, className: classBinder_cx('c-tabs__listButton', { 'is-disabled': tabs[activeItem].isDisabled }), disabled: tabs[activeItem].isDisabled, id: identification + "-tabMore", role: "tab", tabIndex: activeItem + 1 >= tabsLimit ? 0 : -1, type: "button", onClick: handleToggleDropdownVisibility },
110688
110689
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Flex, { alignItems: "center" },
110689
110690
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(TabListItem, { countLimit: (_a = tabs[activeItem]) === null || _a === void 0 ? void 0 : _a.countLimit, hasNotification: activeItem + 1 < tabsLimit ? moreHasNotification : (_b = tabs[activeItem]) === null || _b === void 0 ? void 0 : _b.hasNotification, notificationCount: (_c = tabs[activeItem]) === null || _c === void 0 ? void 0 : _c.notificationCount, value: 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,
110690
110691
  activeItem + 1 >= tabsLimit ? tabs[activeItem].value : moreLabel,
@@ -110710,7 +110711,7 @@ var TabsBar = function (_a) {
110710
110711
 
110711
110712
 
110712
110713
  var Tabs = function (_a) {
110713
- var _b = _a.active, active = _b === void 0 ? -1 : _b, ariaLabel = _a.ariaLabel, contents = _a.contents, contentTheme = _a.contentTheme, _c = _a.moreLabel, moreLabel = _c === void 0 ? 'More' : _c, onChange = _a.onChange, tabs = _a.tabs, tabsLimit = _a.tabsLimit, _d = _a.testId, testId = _d === void 0 ? 'Tabs' : _d, theme = _a.theme;
110714
+ var _b = _a.active, active = _b === void 0 ? -1 : _b, ariaLabel = _a.ariaLabel, closeTabsBarOnOutsideClick = _a.closeTabsBarOnOutsideClick, contents = _a.contents, contentTheme = _a.contentTheme, _c = _a.moreLabel, moreLabel = _c === void 0 ? 'More' : _c, onChange = _a.onChange, tabs = _a.tabs, tabsLimit = _a.tabsLimit, _d = _a.testId, testId = _d === void 0 ? 'Tabs' : _d, theme = _a.theme;
110714
110715
  var _e = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(-1), activeItem = _e[0], setActiveItem = _e[1];
110715
110716
  var width = useWindowWidth();
110716
110717
  var uniqueId = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useMemo"])(function () { return cuid_default()(); }, []);
@@ -110742,7 +110743,7 @@ var Tabs = function (_a) {
110742
110743
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("section", { className: classBinder_cx('c-tabs', theme), "data-testid": testId },
110743
110744
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-tabs__tabsBar') },
110744
110745
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("ul", { "aria-label": ariaLabel, className: classBinder_cx('c-tabs__list'), role: "tablist" },
110745
- external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(TabsBar, { moreLabel: moreLabel }))),
110746
+ external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(TabsBar, { closeTabsBarOnOutsideClick: closeTabsBarOnOutsideClick, moreLabel: moreLabel }))),
110746
110747
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-tabs__content', contentTheme) }, contents.map(function (content, index) {
110747
110748
  var _a;
110748
110749
  var isActive = activeItem === index;
@@ -7,6 +7,8 @@ export interface TabsPropsType extends ComponentPropsType, TabsBarType {
7
7
  active?: number;
8
8
  /** ARIA label for tabs */
9
9
  ariaLabel?: string;
10
+ /** A flag whether close TabsBar on outside click */
11
+ closeTabsBarOnOutsideClick?: boolean;
10
12
  /** Array of items for content */
11
13
  contents: ReactNode[];
12
14
  /** Theme for contents. */
@@ -22,5 +24,5 @@ export interface TabsPropsType extends ComponentPropsType, TabsBarType {
22
24
  xxl?: number;
23
25
  };
24
26
  }
25
- export declare const Tabs: ({ active, ariaLabel, contents, contentTheme, moreLabel, onChange, tabs, tabsLimit, testId, theme }: TabsPropsType) => JSX.Element;
27
+ export declare const Tabs: ({ active, ariaLabel, closeTabsBarOnOutsideClick, contents, contentTheme, moreLabel, onChange, tabs, tabsLimit, testId, theme }: TabsPropsType) => JSX.Element;
26
28
  //# sourceMappingURL=Tabs.d.ts.map
@@ -1,7 +1,9 @@
1
1
  import { ReactElement } from 'react';
2
2
  export interface TabsBarType {
3
+ /** A flag whether close TabsBar on outside click */
4
+ closeTabsBarOnOutsideClick?: boolean;
3
5
  /** Label for "more" tab shown after tabs count overcome breakpoint limit. */
4
6
  moreLabel?: ReactElement | string;
5
7
  }
6
- export declare const TabsBar: ({ moreLabel }: TabsBarType) => JSX.Element;
8
+ export declare const TabsBar: ({ closeTabsBarOnOutsideClick, moreLabel }: TabsBarType) => JSX.Element;
7
9
  //# sourceMappingURL=TabsBar.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmb-digital/ds-lilly",
3
- "version": "0.0.1-alpha.346",
3
+ "version": "0.0.1-alpha.347",
4
4
  "description": "MMB LILLY design system",
5
5
  "license": "UNLICENSED",
6
6
  "sideEffects": false,