linear-react-components-ui 1.1.0-beta.3 → 1.1.0-beta.4

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.
Files changed (43) hide show
  1. package/lib/assets/styles/dialog.scss +10 -4
  2. package/lib/assets/styles/drawers.scss +9 -6
  3. package/lib/assets/styles/tabs.scss +22 -21
  4. package/lib/dialog/base/Header.js +3 -1
  5. package/lib/dialog/base/index.js +9 -5
  6. package/lib/dialog/types.d.ts +1 -1
  7. package/lib/drawer/Header.js +3 -2
  8. package/lib/index.d.ts +1 -1
  9. package/lib/panel/Content.d.ts +1 -1
  10. package/lib/panel/DangerPanel.d.ts +1 -1
  11. package/lib/panel/Default.d.ts +1 -1
  12. package/lib/panel/Header.d.ts +1 -1
  13. package/lib/panel/InfoPanel.d.ts +1 -1
  14. package/lib/panel/PrimaryPanel.d.ts +1 -1
  15. package/lib/panel/SuccessPanel.d.ts +1 -1
  16. package/lib/panel/ToolBar.d.ts +1 -1
  17. package/lib/panel/WarningPanel.d.ts +1 -1
  18. package/lib/panel/helpers.d.ts +7 -2
  19. package/lib/panel/helpers.js +0 -13
  20. package/lib/panel/index.d.ts +1 -1
  21. package/lib/panel/types.d.ts +46 -5
  22. package/lib/tabs/DropdownTabs.d.ts +11 -0
  23. package/lib/tabs/DropdownTabs.js +75 -0
  24. package/lib/tabs/Menu.d.ts +1 -1
  25. package/lib/tabs/Menu.js +27 -15
  26. package/lib/tabs/{DropdownItems.d.ts → MenuTabs.d.ts} +3 -3
  27. package/lib/tabs/MenuTabs.js +90 -0
  28. package/lib/tabs/Panel.js +62 -39
  29. package/lib/tabs/context.d.ts +12 -0
  30. package/lib/tabs/context.js +162 -0
  31. package/lib/tabs/index.d.ts +1 -1
  32. package/lib/tabs/index.js +23 -198
  33. package/lib/tabs/tabHelpers.d.ts +4 -14
  34. package/lib/tabs/tabHelpers.js +30 -48
  35. package/lib/tabs/types.d.ts +44 -13
  36. package/lib/tabs/useTabs.d.ts +11 -0
  37. package/lib/tabs/useTabs.js +11 -0
  38. package/package.json +2 -1
  39. package/tsconfig.json +1 -0
  40. package/lib/tabs/DropdownItems.js +0 -64
  41. package/lib/tabs/MenuItems.d.ts +0 -11
  42. package/lib/tabs/MenuItems.js +0 -75
  43. package/lib/types-exUmt06D.d.ts +0 -50
@@ -1,75 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports["default"] = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _buttons = _interopRequireDefault(require("../buttons"));
10
- var helpers = _interopRequireWildcard(require("./tabHelpers"));
11
- var _permissionValidations = require("../permissionValidations");
12
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
- var MenuItems = function MenuItems(_ref) {
16
- var handlerClick = _ref.handlerClick,
17
- currentPanels = _ref.currentPanels,
18
- handlerRemovePanel = _ref.handlerRemovePanel,
19
- _ref$tabWidth = _ref.tabWidth,
20
- tabWidth = _ref$tabWidth === void 0 ? 'auto' : _ref$tabWidth,
21
- _ref$tabMenuSize = _ref.tabMenuSize,
22
- tabMenuSize = _ref$tabMenuSize === void 0 ? 'medium' : _ref$tabMenuSize,
23
- _ref$tabMenuAlign = _ref.tabMenuAlign,
24
- tabMenuAlign = _ref$tabMenuAlign === void 0 ? 'left' : _ref$tabMenuAlign,
25
- _ref$selectedTabId = _ref.selectedTabId,
26
- selectedTabId = _ref$selectedTabId === void 0 ? '' : _ref$selectedTabId,
27
- _ref$firstTabIdent = _ref.firstTabIdent,
28
- firstTabIdent = _ref$firstTabIdent === void 0 ? false : _ref$firstTabIdent;
29
- return /*#__PURE__*/_react["default"].createElement("ul", {
30
- className: "menu ".concat(firstTabIdent && '-firsttabident'),
31
- style: helpers.menuStyles(tabMenuAlign)
32
- }, currentPanels === null || currentPanels === void 0 ? void 0 : currentPanels.map(function (panel, index) {
33
- var _panel$props = panel.props,
34
- id = _panel$props.id,
35
- icon = _panel$props.icon,
36
- title = _panel$props.title,
37
- tooltip = _panel$props.tooltip,
38
- disabled = _panel$props.disabled,
39
- iconName = _panel$props.iconName,
40
- closeable = _panel$props.closeable,
41
- iconAlign = _panel$props.iconAlign,
42
- tooltipWidth = _panel$props.tooltipWidth,
43
- permissionAttr = _panel$props.permissionAttr,
44
- tooltipPosition = _panel$props.tooltipPosition;
45
- var onDenied = (0, _permissionValidations.actionsOnPermissionDenied)(helpers.onDeniedOptions, permissionAttr);
46
- return onDenied.unvisible ? null : /*#__PURE__*/_react["default"].createElement("li", {
47
- key: id,
48
- style: {
49
- width: tabWidth
50
- },
51
- className: "menuitem ".concat(selectedTabId === id && 'selected')
52
- }, /*#__PURE__*/_react["default"].createElement(_buttons["default"], {
53
- className: "btn menubutton",
54
- boxShadow: false,
55
- onClick: function onClick() {
56
- return handlerClick === null || handlerClick === void 0 ? void 0 : handlerClick(id);
57
- },
58
- iconAlign: iconAlign,
59
- iconName: iconName,
60
- icon: icon,
61
- disabled: disabled || !!onDenied.disabled,
62
- label: title,
63
- size: tabMenuSize,
64
- tooltip: tooltip || title,
65
- tooltipPosition: tooltipPosition,
66
- tooltipWidth: tooltipWidth
67
- }), closeable && currentPanels.length > 1 && /*#__PURE__*/_react["default"].createElement("button", {
68
- className: "closepanel",
69
- onClick: function onClick() {
70
- handlerRemovePanel === null || handlerRemovePanel === void 0 ? void 0 : handlerRemovePanel(id, index);
71
- }
72
- }));
73
- }));
74
- };
75
- var _default = exports["default"] = MenuItems;
@@ -1,50 +0,0 @@
1
- import React__default, { ComponentPropsWithoutRef, ReactNode, ReactElement } from 'react';
2
- import { PermissionAttr } from './@types/PermissionAttr.js';
3
- import ColorStyles from './internals/colorStyles.js';
4
- import { IconNames } from './@types/Icon.js';
5
-
6
- declare function numberAroundZeroAndOne({ props, propName, componentName }: IParameterFunction): number | Error | null;
7
- declare function getCurrentThreshold(scrollableElement: HTMLDivElement, scrollThreshold: number): number;
8
- declare const PanelContext: React__default.Context<ContextProps>;
9
-
10
- type Func = () => void;
11
- type AsyncFunc = () => Promise<void>;
12
- interface IPanelProps extends Omit<ComponentPropsWithoutRef<'div'>, 'className'> {
13
- customClass?: string;
14
- startOpened?: boolean;
15
- toggleable?: boolean;
16
- children?: ReactNode;
17
- colorStyle?: typeof ColorStyles | string;
18
- gridCols?: string;
19
- title?: string;
20
- onEndReached?: Func | AsyncFunc;
21
- onEndReachedThreshold?: typeof numberAroundZeroAndOne | number;
22
- permissionAttr?: PermissionAttr | PermissionAttr[];
23
- }
24
- interface IPanelContentProps extends Omit<ComponentPropsWithoutRef<'div'>, 'className'> {
25
- customClass?: string;
26
- }
27
- interface IPanelHeaderProps extends Omit<ComponentPropsWithoutRef<'div'>, 'className'> {
28
- title?: string;
29
- icon?: ReactElement;
30
- titleIcon?: IconNames;
31
- customClass?: string;
32
- styleForTitle?: object;
33
- customClassForTitle?: string;
34
- headerColored?: boolean;
35
- }
36
- type ContextProps = {
37
- toggleable: boolean;
38
- handlerToggleable: () => void;
39
- opened: boolean;
40
- hideContent: boolean;
41
- onEndReached?: Func | AsyncFunc;
42
- onEndReachedThreshold: number;
43
- };
44
- interface IParameterFunction {
45
- props: any;
46
- propName: string | number;
47
- componentName: string;
48
- }
49
-
50
- export { type AsyncFunc as A, type ContextProps as C, type Func as F, type IPanelProps as I, PanelContext as P, type IPanelContentProps as a, type IPanelHeaderProps as b, type IParameterFunction as c, getCurrentThreshold as g, numberAroundZeroAndOne as n };