@longline/aqua-ui 1.0.239 → 1.0.241

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.
@@ -1,4 +1,3 @@
1
1
  export * from './Histogram';
2
2
  export * from './IHistogramBin';
3
3
  export * from './HistogramAppearance';
4
- export * from './HistogramSingleValue';
@@ -1,4 +1,3 @@
1
1
  export * from './Histogram';
2
2
  export * from './IHistogramBin';
3
3
  export * from './HistogramAppearance';
4
- export * from './HistogramSingleValue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longline/aqua-ui",
3
- "version": "1.0.239",
3
+ "version": "1.0.241",
4
4
  "description": "AquaUI",
5
5
  "author": "Alexander van Oostenrijk / Longline Environment",
6
6
  "license": "Commercial",
@@ -19,6 +19,16 @@ interface IAlertDialogProps {
19
19
  * Function to call when Dialog closes.
20
20
  */
21
21
  onClose: () => void;
22
+ /**
23
+ * If true, inverteds Dialog colors.
24
+ * @default false
25
+ */
26
+ inverted?: boolean;
27
+ /**
28
+ * Override standard dialog width of 600 pixels.
29
+ * @default 600
30
+ */
31
+ width?: number;
22
32
  }
23
33
  /**
24
34
  * A `Dialog.Alert` is a preset dialog with only a title, and an "OK" Button.
@@ -19,7 +19,7 @@ import { PrimaryButton } from '../../controls/PrimaryButton';
19
19
  */
20
20
  var AlertDialog = function (_a) {
21
21
  var _b = _a.open, open = _b === void 0 ? false : _b, _c = _a.title, title = _c === void 0 ? 'Alert' : _c, props = __rest(_a, ["open", "title"]);
22
- return React.createElement(Dialog, { open: open, onClose: props.onClose },
22
+ return React.createElement(Dialog, { inverted: props.inverted, width: props.width, open: open, onClose: props.onClose },
23
23
  React.createElement(Dialog.Header, null, title),
24
24
  React.createElement(Dialog.Content, null, props.children),
25
25
  React.createElement(Dialog.Footer, null,
@@ -22,6 +22,16 @@ interface IProps {
22
22
  * Function to call on close (with a positive reply).
23
23
  */
24
24
  onConfirm: () => void;
25
+ /**
26
+ * If true, inverteds Dialog colors.
27
+ * @default false
28
+ */
29
+ inverted?: boolean;
30
+ /**
31
+ * Override standard dialog width of 600 pixels.
32
+ * @default 600
33
+ */
34
+ width?: number;
25
35
  }
26
36
  /**
27
37
  * A `Dialog.Confirm` is a preset dialog with a title, and a "Yes" and a "No"
@@ -19,7 +19,7 @@ import { PrimaryButton } from '../../controls/PrimaryButton';
19
19
  */
20
20
  var ConfirmDialog = function (_a) {
21
21
  var _b = _a.open, open = _b === void 0 ? false : _b, _c = _a.title, title = _c === void 0 ? 'Confirmation' : _c, props = __rest(_a, ["open", "title"]);
22
- return React.createElement(Dialog, { open: open, onClose: props.onClose },
22
+ return React.createElement(Dialog, { inverted: props.inverted, width: props.width, open: open, onClose: props.onClose },
23
23
  React.createElement(Dialog.Header, null, title),
24
24
  React.createElement(Dialog.Content, null, props.children),
25
25
  React.createElement(Dialog.Footer, null,
@@ -12,8 +12,7 @@ interface IDialogProps {
12
12
  */
13
13
  open?: boolean;
14
14
  /**
15
- * Override standard dialog width of 600 pixels (large screens) or
16
- * 400 pixels (small screens).
15
+ * Override standard dialog width of 600 pixels.
17
16
  * @default 600
18
17
  */
19
18
  width?: number;
@@ -25,6 +25,16 @@ interface IXhrDialogProps {
25
25
  * @default "Network error"
26
26
  */
27
27
  title?: string;
28
+ /**
29
+ * If true, inverteds Dialog colors.
30
+ * @default false
31
+ */
32
+ inverted?: boolean;
33
+ /**
34
+ * Override standard dialog width of 600 pixels.
35
+ * @default 600
36
+ */
37
+ width?: number;
28
38
  }
29
39
  /**
30
40
  * A `Dialog.Xhr` is a preset dialog that takes an `error` object from an
@@ -299,7 +299,7 @@ var XhrDialog = function (_a) {
299
299
  return "There was a problem setting up the request to the server.";
300
300
  }
301
301
  };
302
- return (React.createElement(Dialog, { open: open, onClose: props.onClose },
302
+ return (React.createElement(Dialog, { inverted: props.inverted, open: open, width: props.width, onClose: props.onClose },
303
303
  React.createElement(Dialog.Header, null, title),
304
304
  React.createElement(Dialog.Content, null,
305
305
  props.error && React.createElement("p", { style: { fontWeight: 700 } }, getStatusHeader()),
@@ -1,8 +0,0 @@
1
- import * as React from "react";
2
- interface IProps {
3
- /** @ignore */
4
- className?: string;
5
- value: string;
6
- }
7
- declare const HistogramSingleValue: (props: IProps) => React.JSX.Element;
8
- export { HistogramSingleValue };
@@ -1,42 +0,0 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
- import * as React from "react";
17
- import styled from "styled-components";
18
- var HistogramSingleValueBase = function (_a) {
19
- var value = _a.value, className = _a.className;
20
- var textRef = React.useRef(null);
21
- var _b = React.useState(1), scale = _b[0], setScale = _b[1];
22
- React.useEffect(function () {
23
- if (textRef.current) {
24
- // measure at default font size
25
- var bbox = textRef.current.getBBox();
26
- if (bbox.width && bbox.height) {
27
- var scaleX = 100 / bbox.width;
28
- var scaleY = 100 / bbox.height;
29
- // uniform scale (preserve proportions)
30
- setScale(Math.min(scaleX, scaleY));
31
- }
32
- }
33
- }, [value]);
34
- return (React.createElement("div", { className: className },
35
- React.createElement("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "xMidYMid meet" },
36
- React.createElement("g", { transform: "translate(50,50) scale(".concat(scale, ") translate(-50,-50)") },
37
- React.createElement("text", { ref: textRef, x: "50", y: "50", dominantBaseline: "middle", textAnchor: "middle" }, value)))));
38
- };
39
- var HistogramSingleValueStyled = styled(HistogramSingleValueBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n inset: 0;\n padding: 16px;\n & > svg {\n width: 100%;\n height: 100%;\n font: ", ";\n fill: #fff;\n user-select: none;\n }\n"], ["\n position: absolute;\n inset: 0;\n padding: 16px;\n & > svg {\n width: 100%;\n height: 100%;\n font: ", ";\n fill: #fff;\n user-select: none;\n }\n"])), function (p) { return p.theme.font.dataSmall; });
40
- var HistogramSingleValue = function (props) { return React.createElement(HistogramSingleValueStyled, __assign({}, props)); };
41
- export { HistogramSingleValue };
42
- var templateObject_1;