@longline/aqua-ui 1.0.32 → 1.0.33

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/Types.d.ts CHANGED
@@ -3,4 +3,8 @@
3
3
  * typed in this file.
4
4
  */
5
5
  type Size = 'mini' | 'tiny' | 'small' | 'medium' | 'large' | 'big' | 'huge' | 'massive';
6
- export { Size };
6
+ interface IGradientStop {
7
+ pos: number;
8
+ color: string;
9
+ }
10
+ export { Size, IGradientStop };
@@ -0,0 +1,26 @@
1
+ import * as React from 'react';
2
+ import { IGradientStop } from '../../Types';
3
+ interface IProps {
4
+ /** @ignore */
5
+ className?: string;
6
+ /**
7
+ * Array of `IGradientStop`.
8
+ * The `PresetGradients` class offers preset gradients.
9
+ */
10
+ gradientStops: IGradientStop[];
11
+ /**
12
+ * Gradient thickness in pixels.
13
+ * @default 5
14
+ */
15
+ thickness?: number;
16
+ /**
17
+ * If set, gradient is rounded.
18
+ * @default false
19
+ */
20
+ rounded?: boolean;
21
+ }
22
+ /**
23
+ * A `Gradient` draws a bar filled with a horizontal gradient, defined as an array of `IGradientStop`.
24
+ */
25
+ declare const Gradient: ({ thickness, ...props }: IProps) => React.JSX.Element;
26
+ export { Gradient };
@@ -0,0 +1,45 @@
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
+ 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
+ };
27
+ import * as React from 'react';
28
+ import styled, { css } from 'styled-components';
29
+ var GradientBase = function (props) {
30
+ return React.createElement("div", { className: props.className });
31
+ };
32
+ var GradientStyled = styled(GradientBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n height: ", "px;\n background: linear-gradient(to right, ", ");\n ", "\n"], ["\n position: relative;\n height: ", "px;\n background: linear-gradient(to right, ", ");\n ", "\n"
33
+ /**
34
+ * A `Gradient` draws a bar filled with a horizontal gradient, defined as an array of `IGradientStop`.
35
+ */
36
+ ])), function (p) { return p.thickness; }, function (p) { return p.gradientStops.map(function (gs) { return "".concat(gs.color, " ").concat(gs.pos * 100, "%"); }).join(', '); }, function (p) { return p.rounded && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-radius: ", "px;\n "], ["\n border-radius: ", "px;\n "])), p.thickness / 2); });
37
+ /**
38
+ * A `Gradient` draws a bar filled with a horizontal gradient, defined as an array of `IGradientStop`.
39
+ */
40
+ var Gradient = function (_a) {
41
+ var _b = _a.thickness, thickness = _b === void 0 ? 5 : _b, props = __rest(_a, ["thickness"]);
42
+ return React.createElement(GradientStyled, __assign({ thickness: thickness }, props));
43
+ };
44
+ export { Gradient };
45
+ var templateObject_1, templateObject_2;
@@ -0,0 +1,6 @@
1
+ import { IGradientStop } from "../../Types";
2
+ declare class PresetGradients {
3
+ static Bathymetry: IGradientStop[];
4
+ static Oxygen: IGradientStop[];
5
+ }
6
+ export { PresetGradients };
@@ -0,0 +1,14 @@
1
+ var PresetGradients = /** @class */ (function () {
2
+ function PresetGradients() {
3
+ }
4
+ PresetGradients.Bathymetry = [
5
+ { pos: 0.0, color: '#0000ffff' },
6
+ { pos: 1.0, color: '#000000ff' }
7
+ ];
8
+ PresetGradients.Oxygen = [
9
+ { pos: 0.0, color: 'red' },
10
+ { pos: 1.0, color: 'crimson' }
11
+ ];
12
+ return PresetGradients;
13
+ }());
14
+ export { PresetGradients };
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { IGradientStop } from './IGradientStop';
2
+ import { IGradientStop } from '../../../Types';
3
3
  interface IPoint {
4
4
  latitude: number;
5
5
  longitude: number;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { IGradientStop } from '../InterpolationLayer/IGradientStop';
2
+ import { IGradientStop } from '../../../Types';
3
3
  interface IPoint {
4
4
  latitude: number;
5
5
  longitude: number;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { IGradientStop } from '../../map/layers/InterpolationLayer/IGradientStop';
2
+ import { IGradientStop } from '../../Types';
3
3
  interface IProps {
4
4
  /** @ignore */
5
5
  className?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longline/aqua-ui",
3
- "version": "1.0.32",
3
+ "version": "1.0.33",
4
4
  "description": "AquaUI",
5
5
  "author": "Alexander van Oostenrijk / Longline Environment",
6
6
  "license": "Commercial",
@@ -1,5 +0,0 @@
1
- interface IGradientStop {
2
- pos: number;
3
- color: string;
4
- }
5
- export { IGradientStop };
@@ -1 +0,0 @@
1
- export {};