@longline/aqua-ui 1.0.210 → 1.0.211

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.
@@ -35,10 +35,12 @@ interface IFieldProps {
35
35
  forceupdate?: boolean;
36
36
  /**
37
37
  * If true, display an asterisk for required fields.
38
+ * @default false
38
39
  */
39
40
  asterisk?: boolean;
40
41
  /**
41
42
  * If true, apply ghost state to Field and the control in it.
43
+ * @default false
42
44
  */
43
45
  ghost?: boolean;
44
46
  /**
@@ -16,6 +16,11 @@ interface ITabProps {
16
16
  * Fired when tab is clicked.
17
17
  */
18
18
  onClick?: () => void;
19
+ /**
20
+ * If true, apply ghost state to Tab.
21
+ * @default false
22
+ */
23
+ ghost?: boolean;
19
24
  }
20
25
  declare const Tab: React.ForwardRefExoticComponent<ITabProps & React.RefAttributes<HTMLDivElement>>;
21
26
  export { Tab, ITabProps };
@@ -13,13 +13,30 @@ var __assign = (this && this.__assign) || function () {
13
13
  };
14
14
  return __assign.apply(this, arguments);
15
15
  };
16
+ var __rest = (this && this.__rest) || function (s, e) {
17
+ var t = {};
18
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
+ t[p] = s[p];
20
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
+ t[p[i]] = s[p[i]];
24
+ }
25
+ return t;
26
+ };
16
27
  import * as React from 'react';
17
28
  import styled, { css } from 'styled-components';
29
+ import { Ghost } from '../Ghost';
18
30
  var TabBase = React.forwardRef(function (props, ref) {
19
- return React.createElement("div", { role: "tab", "aria-selected": props.active, className: props.className, ref: ref, onClick: props.onClick }, props.children);
31
+ return React.createElement("div", { className: props.className, role: "tab", "aria-selected": props.active, ref: ref, onClick: props.onClick },
32
+ props.ghost && React.createElement(Ghost, { style: { position: 'absolute', left: '5px', top: '6px', right: '5px', bottom: '6px', zIndex: 100 } }),
33
+ React.createElement("div", null, props.children));
34
+ });
35
+ var TabStyled = styled(TabBase)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n display: table-cell;\n vertical-align: middle;\n text-align: center;\n white-space: nowrap;\n padding: 0 20px;\n\n font: ", ";\n box-sizing: border-box;\n ", "\n height: 40px;\n z-index: 1;\n cursor: pointer;\n color: ", ";\n transition: color ", "ms ease-in-out;\n\n /* User cannot select header text.\n * This prevents accidental selection when clicking the tab.\n */\n user-select: none; \n\n ", " \n &:hover {\n color: ", ";\n }\n\n // Ghost state:\n ", " \n"], ["\n position: relative;\n display: table-cell;\n vertical-align: middle;\n text-align: center;\n white-space: nowrap;\n padding: 0 20px;\n\n font: ", ";\n box-sizing: border-box;\n ", "\n height: 40px;\n z-index: 1;\n cursor: pointer;\n color: ", ";\n transition: color ", "ms ease-in-out;\n\n /* User cannot select header text.\n * This prevents accidental selection when clicking the tab.\n */\n user-select: none; \n\n ", " \n &:hover {\n color: ", ";\n }\n\n // Ghost state:\n ", " \n"])), function (p) { return p.theme.font.labelLarge; }, function (p) { return p.tabWidth && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["min-width: ", "px;"], ["min-width: ", "px;"])), p.tabWidth); }, function (p) { return p.theme.colors.neutral[80]; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.active && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), function (p) { return p.theme.colors.neutral[100]; }); }, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.ghost && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n pointer-events: none;\n user-select: none;\n & > *:not(:first-child) {\n border: solid 1px red;\n visibility: hidden;\n } \n "], ["\n pointer-events: none;\n user-select: none;\n & > *:not(:first-child) {\n border: solid 1px red;\n visibility: hidden;\n } \n "]))); });
36
+ var Tab = React.forwardRef(function (_a, ref) {
37
+ var _b = _a.ghost, ghost = _b === void 0 ? false : _b, props = __rest(_a, ["ghost"]);
38
+ return React.createElement(TabStyled, __assign({ ref: ref, ghost: ghost }, props));
20
39
  });
21
- var TabStyled = styled(TabBase)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: table-cell;\n vertical-align: middle;\n text-align: center;\n white-space: nowrap;\n padding: 0 20px;\n\n font: ", ";\n box-sizing: border-box;\n ", "\n height: 40px;\n z-index: 1;\n cursor: pointer;\n color: ", ";\n transition: color ", "ms ease-in-out;\n\n /* User cannot select header text.\n * This prevents accidental selection when clicking the tab.\n */\n user-select: none; \n\n ", " \n &:hover {\n color: ", ";\n }\n"], ["\n display: table-cell;\n vertical-align: middle;\n text-align: center;\n white-space: nowrap;\n padding: 0 20px;\n\n font: ", ";\n box-sizing: border-box;\n ", "\n height: 40px;\n z-index: 1;\n cursor: pointer;\n color: ", ";\n transition: color ", "ms ease-in-out;\n\n /* User cannot select header text.\n * This prevents accidental selection when clicking the tab.\n */\n user-select: none; \n\n ", " \n &:hover {\n color: ", ";\n }\n"])), function (p) { return p.theme.font.labelLarge; }, function (p) { return p.tabWidth && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["min-width: ", "px;"], ["min-width: ", "px;"])), p.tabWidth); }, function (p) { return p.theme.colors.neutral[80]; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.active && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), function (p) { return p.theme.colors.neutral[100]; }); }, function (p) { return p.theme.colors.neutral[100]; });
22
- var Tab = React.forwardRef(function (props, ref) { return React.createElement(TabStyled, __assign({ ref: ref }, props)); });
23
40
  Tab.displayName = "TabBar.Tab";
24
41
  export { Tab };
25
- var templateObject_1, templateObject_2, templateObject_3;
42
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -29,6 +29,11 @@ interface ITabBarProps {
29
29
  * @param idx - The index of the new active tab.
30
30
  */
31
31
  onChange?: (idx: number) => void;
32
+ /**
33
+ * If true, apply ghost state to TabBar and Tabs in it.
34
+ * @default false
35
+ */
36
+ ghost?: boolean;
32
37
  }
33
38
  /**
34
39
  * A `TabBar` presents an array of `TabBar.Tab` children in a horizontal bar,
@@ -38,7 +43,7 @@ interface ITabBarProps {
38
43
  * This is just a `TabBar`; if you need tabs and panes, use the `Tab` container.
39
44
  */
40
45
  declare const TabBar: {
41
- ({ active, ...props }: ITabBarProps): React.JSX.Element;
46
+ ({ active, ghost, ...props }: ITabBarProps): React.JSX.Element;
42
47
  Tab: React.ForwardRefExoticComponent<import("./Tab").ITabProps & React.RefAttributes<HTMLDivElement>>;
43
48
  displayName: string;
44
49
  };
@@ -198,6 +198,7 @@ var TabBarBase = function (props) {
198
198
  ref: function (el) { return tabRefs.current[idx] = el; },
199
199
  active: active === idx,
200
200
  tabWidth: props.tabWidth,
201
+ ghost: props.ghost,
201
202
  onClick: function () { return handleTabClick(idx); }
202
203
  });
203
204
  }),
@@ -221,8 +222,8 @@ var TabBarStyled = styled(TabBarBase)(templateObject_2 || (templateObject_2 = __
221
222
  * This is just a `TabBar`; if you need tabs and panes, use the `Tab` container.
222
223
  */
223
224
  var TabBar = function (_a) {
224
- var _b = _a.active, active = _b === void 0 ? 0 : _b, props = __rest(_a, ["active"]);
225
- return React.createElement(TabBarStyled, __assign({ active: active }, props));
225
+ var _b = _a.active, active = _b === void 0 ? 0 : _b, _c = _a.ghost, ghost = _c === void 0 ? false : _c, props = __rest(_a, ["active", "ghost"]);
226
+ return React.createElement(TabBarStyled, __assign({ active: active, ghost: ghost }, props));
226
227
  };
227
228
  TabBar.Tab = Tab;
228
229
  TabBar.displayName = "TabBar";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longline/aqua-ui",
3
- "version": "1.0.210",
3
+ "version": "1.0.211",
4
4
  "description": "AquaUI",
5
5
  "author": "Alexander van Oostenrijk / Longline Environment",
6
6
  "license": "Commercial",