@longline/aqua-ui 1.0.37 → 1.0.38

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,5 @@
1
1
  import * as React from 'react';
2
+ import { IIconProps } from '../Icon';
2
3
  interface IProps {
3
4
  /** @ignore */
4
5
  className?: string;
@@ -8,9 +9,9 @@ interface IProps {
8
9
  children?: React.ReactNode;
9
10
  /**
10
11
  * Path to an SVG symbol, e.g. `/aquaui-sprites.svg#close`. The `SVG` enumeration
11
- * exists that offers preset paths.
12
+ * exists that offers preset paths. This may also be a full `IIconProps`.
12
13
  */
13
- icon: string;
14
+ icon: string | IIconProps;
14
15
  /**
15
16
  * A disabled button cannot be interacted with. This is implemented using
16
17
  * `pointer-events: none`.
@@ -26,6 +26,7 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  };
27
27
  import * as React from 'react';
28
28
  import styled, { css } from 'styled-components';
29
+ import { Icon } from '../Icon';
29
30
  var FabBase = function (props) {
30
31
  var handleClick = function () {
31
32
  if (props.disabled)
@@ -34,8 +35,8 @@ var FabBase = function (props) {
34
35
  props.onClick();
35
36
  };
36
37
  return (React.createElement("button", { tabIndex: props.disabled ? -1 : 0, className: props.className, onClick: handleClick, title: props.title },
37
- React.createElement("svg", null,
38
- React.createElement("use", { xlinkHref: props.icon })),
38
+ typeof props.icon == "string" && React.createElement(Icon, { url: props.icon }),
39
+ typeof props.icon != "string" && React.createElement(Icon, __assign({}, props.icon)),
39
40
  props.children));
40
41
  };
41
42
  var FabStyled = styled(FabBase).attrs(function (p) {
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { IIconProps } from '../Icon';
2
3
  interface IProps {
3
4
  /** @ignore */
4
5
  className?: string;
@@ -34,14 +35,9 @@ interface IProps {
34
35
  title?: string;
35
36
  /**
36
37
  * Path to an SVG symbol, e.g. `/aquaui-sprites.svg#close`. The `SVG` enumeration
37
- * exists that offers preset paths.
38
+ * exists that offers preset paths. This may also be a full `IIconProps`.
38
39
  */
39
- icon?: string;
40
- /**
41
- * The icon color defaults to the lightest neutral color, but can be
42
- * overridden. This must be a valid CSS color value.
43
- */
44
- iconColor?: string;
40
+ icon?: string | IIconProps;
45
41
  /**
46
42
  * Fired when the button is clicked.
47
43
  */
@@ -27,6 +27,7 @@ var __rest = (this && this.__rest) || function (s, e) {
27
27
  import * as React from 'react';
28
28
  import styled, { css } from 'styled-components';
29
29
  import { darken } from '../../helper/darken';
30
+ import { Icon } from '../Icon';
30
31
  var PrimaryButtonBase = function (props) {
31
32
  var handleClick = function () {
32
33
  if (props.disabled)
@@ -35,8 +36,8 @@ var PrimaryButtonBase = function (props) {
35
36
  props.onClick();
36
37
  };
37
38
  return (React.createElement("button", { tabIndex: props.disabled ? -1 : 0, className: props.className, onClick: handleClick, title: props.title },
38
- props.icon && React.createElement("svg", null,
39
- React.createElement("use", { xlinkHref: props.icon })),
39
+ props.icon && typeof props.icon == "string" && React.createElement(Icon, { url: props.icon }),
40
+ props.icon && typeof props.icon != "string" && React.createElement(Icon, __assign({}, props.icon)),
40
41
  props.children));
41
42
  };
42
43
  var PrimaryButtonStyled = styled(PrimaryButtonBase).attrs(function (p) {
@@ -49,7 +50,7 @@ var PrimaryButtonStyled = styled(PrimaryButtonBase).attrs(function (p) {
49
50
  outlineColor: (p.positive || p.negative) ? p.theme.colors.primary[1]
50
51
  : p.theme.colors.accent
51
52
  };
52
- })(templateObject_2 || (templateObject_2 = __makeTemplateObject([" \n // Size:\n height: 56px;\n padding-left: 16px;\n padding-right: 16px;\n min-width: 90px;\n \n // Font:\n font: ", ";\n color: ", ";\n\n // Presentation:\n background-color: ", ";\n transition: \n background-color ease-in-out ", "ms, \n box-shadow ease-in-out ", "ms;\n border-radius: ", "px;\n border: none;\n cursor: pointer;\n user-select: none;\n outline: none;\n\n // Content:\n display: flex;\n align-items: center;\n white-space: nowrap;\n flex-wrap: nowrap; \n justify-content: center; \n gap: 12px;\n\n box-shadow: ", ";\n &:hover {\n background-color: ", ";\n box-shadow: ", ";\n }\n &:active {\n background-color: ", ";\n box-shadow: none;\n }\n &:focus {\n outline: solid 2px ", ";\n }\n \n svg {\n fill: ", ";\n width: 24px;\n height: 24px; \n }\n\n ", "\n"], [" \n // Size:\n height: 56px;\n padding-left: 16px;\n padding-right: 16px;\n min-width: 90px;\n \n // Font:\n font: ", ";\n color: ", ";\n\n // Presentation:\n background-color: ", ";\n transition: \n background-color ease-in-out ", "ms, \n box-shadow ease-in-out ", "ms;\n border-radius: ", "px;\n border: none;\n cursor: pointer;\n user-select: none;\n outline: none;\n\n // Content:\n display: flex;\n align-items: center;\n white-space: nowrap;\n flex-wrap: nowrap; \n justify-content: center; \n gap: 12px;\n\n box-shadow: ", ";\n &:hover {\n background-color: ", ";\n box-shadow: ", ";\n }\n &:active {\n background-color: ", ";\n box-shadow: none;\n }\n &:focus {\n outline: solid 2px ", ";\n }\n \n svg {\n fill: ", ";\n width: 24px;\n height: 24px; \n }\n\n ", "\n"
53
+ })(templateObject_2 || (templateObject_2 = __makeTemplateObject([" \n // Size:\n height: 56px;\n padding-left: 16px;\n padding-right: 16px;\n min-width: 90px;\n \n // Font:\n font: ", ";\n color: ", ";\n\n // Presentation:\n background-color: ", ";\n transition: \n background-color ease-in-out ", "ms, \n box-shadow ease-in-out ", "ms;\n border-radius: ", "px;\n border: none;\n cursor: pointer;\n user-select: none;\n outline: none;\n\n // Content:\n display: flex;\n align-items: center;\n white-space: nowrap;\n flex-wrap: nowrap; \n justify-content: center; \n gap: 12px;\n\n box-shadow: ", ";\n &:hover {\n background-color: ", ";\n box-shadow: ", ";\n }\n &:active {\n background-color: ", ";\n box-shadow: none;\n }\n &:focus {\n outline: solid 2px ", ";\n }\n \n svg {\n width: 24px;\n height: 24px; \n }\n\n ", "\n"], [" \n // Size:\n height: 56px;\n padding-left: 16px;\n padding-right: 16px;\n min-width: 90px;\n \n // Font:\n font: ", ";\n color: ", ";\n\n // Presentation:\n background-color: ", ";\n transition: \n background-color ease-in-out ", "ms, \n box-shadow ease-in-out ", "ms;\n border-radius: ", "px;\n border: none;\n cursor: pointer;\n user-select: none;\n outline: none;\n\n // Content:\n display: flex;\n align-items: center;\n white-space: nowrap;\n flex-wrap: nowrap; \n justify-content: center; \n gap: 12px;\n\n box-shadow: ", ";\n &:hover {\n background-color: ", ";\n box-shadow: ", ";\n }\n &:active {\n background-color: ", ";\n box-shadow: none;\n }\n &:focus {\n outline: solid 2px ", ";\n }\n \n svg {\n width: 24px;\n height: 24px; \n }\n\n ", "\n"
53
54
  /**
54
55
  * Primary buttons denote the primary action. They may have icons or not and
55
56
  * have three colors: `positive`, `negative`, and themed (the default).
@@ -62,7 +63,7 @@ var PrimaryButtonStyled = styled(PrimaryButtonBase).attrs(function (p) {
62
63
  * with `positive`, `negative` or `color`. The button can be in a `disabled`
63
64
  * state where it cannot be clicked.
64
65
  */
65
- ])), function (p) { return p.theme.font.labelLarge; }, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.backgroundColor; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.radius.strong; }, function (p) { return p.theme.shadows.medium; }, function (p) { return darken(0.025, p.backgroundColor); }, function (p) { return p.theme.shadows.large; }, function (p) { return p.backgroundColor; }, function (p) { return p.outlineColor; }, function (p) { var _a; return (_a = p.iconColor) !== null && _a !== void 0 ? _a : p.theme.colors.neutral[100]; }, function (p) { return p.disabled && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n cursor: auto;\n pointer-events: none;\n color: ", ";\n box-shadow: none;\n svg {\n fill: ", ";\n }\n "], ["\n cursor: auto;\n pointer-events: none;\n color: ", ";\n box-shadow: none;\n svg {\n fill: ", ";\n }\n "])), p.theme.colors.primary[3], p.theme.colors.primary[3]); });
66
+ ])), function (p) { return p.theme.font.labelLarge; }, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.backgroundColor; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.radius.strong; }, function (p) { return p.theme.shadows.medium; }, function (p) { return darken(0.025, p.backgroundColor); }, function (p) { return p.theme.shadows.large; }, function (p) { return p.backgroundColor; }, function (p) { return p.outlineColor; }, function (p) { return p.disabled && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n cursor: auto;\n pointer-events: none;\n color: ", ";\n box-shadow: none;\n svg {\n fill: ", ";\n }\n "], ["\n cursor: auto;\n pointer-events: none;\n color: ", ";\n box-shadow: none;\n svg {\n fill: ", ";\n }\n "])), p.theme.colors.primary[3], p.theme.colors.primary[3]); });
66
67
  /**
67
68
  * Primary buttons denote the primary action. They may have icons or not and
68
69
  * have three colors: `positive`, `negative`, and themed (the default).
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { IIconProps } from '../Icon';
2
3
  interface IProps {
3
4
  /** @ignore */
4
5
  className?: string;
@@ -9,9 +10,9 @@ interface IProps {
9
10
  disabled?: boolean;
10
11
  /**
11
12
  * Path to an SVG symbol, e.g. `/aquaui-sprites.svg#close`. The `SVG` enumeration
12
- * exists that offers preset paths.
13
+ * exists that offers preset paths. This may also be a full `IIconProps`.
13
14
  */
14
- icon: string;
15
+ icon: string | IIconProps;
15
16
  /**
16
17
  * A `positive` button will have a color that indicates a _positive
17
18
  * consequence_, taken from the theme (usually a shade of green).
@@ -35,11 +36,6 @@ interface IProps {
35
36
  * be relevant since this type of button has no text.
36
37
  */
37
38
  title?: string;
38
- /**
39
- * The icon color defaults to the lightest neutral color, but can be
40
- * overridden. This must be a valid CSS color value.
41
- */
42
- iconColor?: string;
43
39
  /**
44
40
  * Fired when the button is clicked.
45
41
  */
@@ -26,6 +26,7 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  };
27
27
  import * as React from 'react';
28
28
  import styled, { css } from 'styled-components';
29
+ import { Icon } from '../Icon';
29
30
  var SecondaryButtonBase = function (props) {
30
31
  var handleClick = function () {
31
32
  if (props.disabled)
@@ -34,8 +35,8 @@ var SecondaryButtonBase = function (props) {
34
35
  props.onClick();
35
36
  };
36
37
  return (React.createElement("button", { tabIndex: props.disabled ? -1 : 0, className: props.className, onClick: handleClick, title: props.title },
37
- React.createElement("svg", null,
38
- React.createElement("use", { xlinkHref: props.icon }))));
38
+ typeof props.icon == "string" && React.createElement(Icon, { url: props.icon }),
39
+ typeof props.icon != "string" && React.createElement(Icon, __assign({}, props.icon))));
39
40
  };
40
41
  var SecondaryButtonStyled = styled(SecondaryButtonBase).attrs(function (p) {
41
42
  return {
@@ -45,7 +46,7 @@ var SecondaryButtonStyled = styled(SecondaryButtonBase).attrs(function (p) {
45
46
  : p.color ? p.color
46
47
  : p.theme.colors.neutral[10]
47
48
  };
48
- })(templateObject_3 || (templateObject_3 = __makeTemplateObject([" \n // Size:\n height: 32px;\n width: 32px;\n\n // Presentation:\n background-color: ", ";\n // (Note that there is no hover state.)\n transition: \n background-color ease-in-out ", "ms, \n box-shadow ease-in-out ", "ms;\n border-radius: ", "px;\n border: none;\n cursor: pointer;\n user-select: none;\n outline: none;\n box-shadow: ", ";\n\n // Content alignment:\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n white-space: nowrap;\n\n &:hover {\n box-shadow: ", ";\n }\n\n &:focus {\n outline: solid 2px ", ";\n }\n\n // Button changes background & inset dropshadow when pressed:\n &:active {\n // Button background stays the same in case of color buttons:\n ", "\n box-shadow: none;\n }\n\n svg {\n fill: ", ";\n width: 13px;\n height: 13px;\n } \n\n ", "\n"], [" \n // Size:\n height: 32px;\n width: 32px;\n\n // Presentation:\n background-color: ", ";\n // (Note that there is no hover state.)\n transition: \n background-color ease-in-out ", "ms, \n box-shadow ease-in-out ", "ms;\n border-radius: ", "px;\n border: none;\n cursor: pointer;\n user-select: none;\n outline: none;\n box-shadow: ", ";\n\n // Content alignment:\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n white-space: nowrap;\n\n &:hover {\n box-shadow: ", ";\n }\n\n &:focus {\n outline: solid 2px ", ";\n }\n\n // Button changes background & inset dropshadow when pressed:\n &:active {\n // Button background stays the same in case of color buttons:\n ", "\n box-shadow: none;\n }\n\n svg {\n fill: ", ";\n width: 13px;\n height: 13px;\n } \n\n ", "\n"
49
+ })(templateObject_3 || (templateObject_3 = __makeTemplateObject([" \n // Size:\n height: 32px;\n width: 32px;\n\n // Presentation:\n background-color: ", ";\n // (Note that there is no hover state.)\n transition: \n background-color ease-in-out ", "ms, \n box-shadow ease-in-out ", "ms;\n border-radius: ", "px;\n border: none;\n cursor: pointer;\n user-select: none;\n outline: none;\n box-shadow: ", ";\n\n // Content alignment:\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n white-space: nowrap;\n\n &:hover {\n box-shadow: ", ";\n }\n\n &:focus {\n outline: solid 2px ", ";\n }\n\n // Button changes background & inset dropshadow when pressed:\n &:active {\n // Button background stays the same in case of color buttons:\n ", "\n box-shadow: none;\n }\n\n svg {\n width: 13px;\n height: 13px;\n } \n\n ", "\n"], [" \n // Size:\n height: 32px;\n width: 32px;\n\n // Presentation:\n background-color: ", ";\n // (Note that there is no hover state.)\n transition: \n background-color ease-in-out ", "ms, \n box-shadow ease-in-out ", "ms;\n border-radius: ", "px;\n border: none;\n cursor: pointer;\n user-select: none;\n outline: none;\n box-shadow: ", ";\n\n // Content alignment:\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n white-space: nowrap;\n\n &:hover {\n box-shadow: ", ";\n }\n\n &:focus {\n outline: solid 2px ", ";\n }\n\n // Button changes background & inset dropshadow when pressed:\n &:active {\n // Button background stays the same in case of color buttons:\n ", "\n box-shadow: none;\n }\n\n svg {\n width: 13px;\n height: 13px;\n } \n\n ", "\n"
49
50
  /**
50
51
  * The `SecondaryButton` is a small button that holds only an icon. It has no
51
52
  * other content. It renders as a `<button>` element.
@@ -55,7 +56,7 @@ var SecondaryButtonStyled = styled(SecondaryButtonBase).attrs(function (p) {
55
56
  *
56
57
  * A `disabled` button cannot be clicked at all.
57
58
  */
58
- ])), function (p) { return p.backgroundColor; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.radius.normal; }, function (p) { return p.theme.shadows.small; }, function (p) { return p.theme.shadows.medium; }, function (p) { return p.theme.colors.primary[1]; }, function (p) { return !p.positive && !p.negative && !p.color && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["background-color: ", ";"], ["background-color: ", ";"])), p.theme.colors.neutral[10]); }, function (p) { var _a; return (_a = p.iconColor) !== null && _a !== void 0 ? _a : p.theme.colors.neutral[100]; }, function (p) { return p.disabled && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n cursor: auto;\n pointer-events: none;\n box-shadow: none;\n svg {\n fill: ", ";\n }\n "], ["\n cursor: auto;\n pointer-events: none;\n box-shadow: none;\n svg {\n fill: ", ";\n }\n "])), p.theme.colors.primary[3]); });
59
+ ])), function (p) { return p.backgroundColor; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.radius.normal; }, function (p) { return p.theme.shadows.small; }, function (p) { return p.theme.shadows.medium; }, function (p) { return p.theme.colors.primary[1]; }, function (p) { return !p.positive && !p.negative && !p.color && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["background-color: ", ";"], ["background-color: ", ";"])), p.theme.colors.neutral[10]); }, function (p) { return p.disabled && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n cursor: auto;\n pointer-events: none;\n box-shadow: none;\n svg {\n fill: ", ";\n }\n "], ["\n cursor: auto;\n pointer-events: none;\n box-shadow: none;\n svg {\n fill: ", ";\n }\n "])), p.theme.colors.primary[3]); });
59
60
  /**
60
61
  * The `SecondaryButton` is a small button that holds only an icon. It has no
61
62
  * other content. It renders as a `<button>` element.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longline/aqua-ui",
3
- "version": "1.0.37",
3
+ "version": "1.0.38",
4
4
  "description": "AquaUI",
5
5
  "author": "Alexander van Oostenrijk / Longline Environment",
6
6
  "license": "Commercial",