@citygross/components 0.16.12 → 0.16.14
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/build/cjs/components/src/components/Links/Link.js +22 -3
- package/build/cjs/components/src/components/Links/Link.js.map +1 -1
- package/build/cjs/components/src/components/Modal/Modal.js +4 -3
- package/build/cjs/components/src/components/Modal/Modal.js.map +1 -1
- package/build/es/components/src/components/Links/Link.js +22 -3
- package/build/es/components/src/components/Links/Link.js.map +1 -1
- package/build/es/components/src/components/Modal/Modal.js +4 -3
- package/build/es/components/src/components/Modal/Modal.js.map +1 -1
- package/package.json +2 -2
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var typography = require('@citygross/typography');
|
|
8
|
+
var designTokens = require('@citygross/design-tokens');
|
|
8
9
|
var Link_styles = require('./Link.styles.js');
|
|
9
10
|
|
|
10
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -28,11 +29,29 @@ exports.ELinkVariant = void 0;
|
|
|
28
29
|
ELinkVariant["TERTIARY"] = "tertiary";
|
|
29
30
|
})(exports.ELinkVariant || (exports.ELinkVariant = {}));
|
|
30
31
|
function Link(_a) {
|
|
31
|
-
var
|
|
32
|
+
var _b;
|
|
33
|
+
var asButton = _a.asButton, borderRadius = _a.borderRadius, children = _a.children, hrefPath = _a.hrefPath, icon = _a.icon, _c = _a.inverted, inverted = _c === void 0 ? false : _c, isDisabled = _a.isDisabled, noWrap = _a.noWrap, onClick = _a.onClick, _d = _a.size, size = _d === void 0 ? typography.TextTypes.TextSize.REGULAR : _d, _e = _a.target, target = _e === void 0 ? '_self' : _e, tabIndex = _a.tabIndex, _f = _a.variant, variant = _f === void 0 ? exports.ELinkVariant.PRIMARY : _f, props = _tslib.__rest(_a, ["asButton", "borderRadius", "children", "hrefPath", "icon", "inverted", "isDisabled", "noWrap", "onClick", "size", "target", "tabIndex", "variant"]);
|
|
34
|
+
var disabled = !!isDisabled;
|
|
35
|
+
var palette = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette;
|
|
36
|
+
var bodyTextColor = (_b = (variant === exports.ELinkVariant.PRIMARY
|
|
37
|
+
? inverted
|
|
38
|
+
? disabled
|
|
39
|
+
? palette === null || palette === void 0 ? void 0 : palette.disabledDarkGray
|
|
40
|
+
: palette === null || palette === void 0 ? void 0 : palette.white
|
|
41
|
+
: disabled
|
|
42
|
+
? palette === null || palette === void 0 ? void 0 : palette.blueMedium
|
|
43
|
+
: palette === null || palette === void 0 ? void 0 : palette.brandBlue
|
|
44
|
+
: inverted
|
|
45
|
+
? disabled
|
|
46
|
+
? palette === null || palette === void 0 ? void 0 : palette.disabledDarkGray
|
|
47
|
+
: palette === null || palette === void 0 ? void 0 : palette.white
|
|
48
|
+
: disabled
|
|
49
|
+
? palette === null || palette === void 0 ? void 0 : palette.disabledGray
|
|
50
|
+
: palette === null || palette === void 0 ? void 0 : palette.darkest)) !== null && _b !== void 0 ? _b : palette === null || palette === void 0 ? void 0 : palette.darkest;
|
|
32
51
|
return asButton ? (React__default["default"].createElement(Link_styles.LinkAsButton, _tslib.__assign({ borderRadius: borderRadius, disabled: isDisabled, icon: icon, inverted: inverted, isDisabled: isDisabled, noWrap: noWrap, onClick: onClick, size: size, variant: variant }, props),
|
|
33
|
-
React__default["default"].createElement(typography.BodyText, { size: size }, children),
|
|
52
|
+
React__default["default"].createElement(typography.BodyText, { size: size, color: bodyTextColor }, children),
|
|
34
53
|
icon && React__default["default"].createElement(Link_styles.IconWrapper, null, icon))) : (React__default["default"].createElement(Link_styles.BaseLink, _tslib.__assign({ borderRadius: borderRadius, href: hrefPath, isDisabled: isDisabled, icon: icon, inverted: inverted, noWrap: noWrap, onClick: onClick, size: size, tabIndex: tabIndex, target: target, variant: variant }, props),
|
|
35
|
-
React__default["default"].createElement(typography.BodyText, { size: size }, children),
|
|
54
|
+
React__default["default"].createElement(typography.BodyText, { size: size, color: bodyTextColor }, children),
|
|
36
55
|
icon && React__default["default"].createElement(Link_styles.IconWrapper, null, icon)));
|
|
37
56
|
}
|
|
38
57
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Link.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -30,7 +30,7 @@ var getPortalRoot = function (portalHostSelector) {
|
|
|
30
30
|
var _a;
|
|
31
31
|
if (typeof document === 'undefined')
|
|
32
32
|
return null;
|
|
33
|
-
var hostElement = document.
|
|
33
|
+
var hostElement = document.getElementById(portalHostSelector);
|
|
34
34
|
return (_a = hostElement === null || hostElement === void 0 ? void 0 : hostElement.parentElement) !== null && _a !== void 0 ? _a : document.body;
|
|
35
35
|
};
|
|
36
36
|
var Modal = function (_a) {
|
|
@@ -44,8 +44,9 @@ var Modal = function (_a) {
|
|
|
44
44
|
React.useEffect(function () {
|
|
45
45
|
if (typeof document === 'undefined')
|
|
46
46
|
return;
|
|
47
|
-
var inertElements = Array.from(new Set(inertSelectors.flatMap(function (
|
|
48
|
-
|
|
47
|
+
var inertElements = Array.from(new Set(inertSelectors.flatMap(function (id) {
|
|
48
|
+
var element = document.getElementById(id);
|
|
49
|
+
return element ? [element] : [];
|
|
49
50
|
})));
|
|
50
51
|
var body = document.body;
|
|
51
52
|
var html = document.documentElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __rest, __assign } from '../../../../_virtual/_tslib.js';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { TextTypes, BodyText } from '@citygross/typography';
|
|
4
|
+
import { theme } from '@citygross/design-tokens';
|
|
4
5
|
import { LinkAsButton, IconWrapper, BaseLink } from './Link.styles.js';
|
|
5
6
|
|
|
6
7
|
var LinkSize;
|
|
@@ -20,11 +21,29 @@ var ELinkVariant;
|
|
|
20
21
|
ELinkVariant["TERTIARY"] = "tertiary";
|
|
21
22
|
})(ELinkVariant || (ELinkVariant = {}));
|
|
22
23
|
function Link(_a) {
|
|
23
|
-
var
|
|
24
|
+
var _b;
|
|
25
|
+
var asButton = _a.asButton, borderRadius = _a.borderRadius, children = _a.children, hrefPath = _a.hrefPath, icon = _a.icon, _c = _a.inverted, inverted = _c === void 0 ? false : _c, isDisabled = _a.isDisabled, noWrap = _a.noWrap, onClick = _a.onClick, _d = _a.size, size = _d === void 0 ? TextTypes.TextSize.REGULAR : _d, _e = _a.target, target = _e === void 0 ? '_self' : _e, tabIndex = _a.tabIndex, _f = _a.variant, variant = _f === void 0 ? ELinkVariant.PRIMARY : _f, props = __rest(_a, ["asButton", "borderRadius", "children", "hrefPath", "icon", "inverted", "isDisabled", "noWrap", "onClick", "size", "target", "tabIndex", "variant"]);
|
|
26
|
+
var disabled = !!isDisabled;
|
|
27
|
+
var palette = theme === null || theme === void 0 ? void 0 : theme.palette;
|
|
28
|
+
var bodyTextColor = (_b = (variant === ELinkVariant.PRIMARY
|
|
29
|
+
? inverted
|
|
30
|
+
? disabled
|
|
31
|
+
? palette === null || palette === void 0 ? void 0 : palette.disabledDarkGray
|
|
32
|
+
: palette === null || palette === void 0 ? void 0 : palette.white
|
|
33
|
+
: disabled
|
|
34
|
+
? palette === null || palette === void 0 ? void 0 : palette.blueMedium
|
|
35
|
+
: palette === null || palette === void 0 ? void 0 : palette.brandBlue
|
|
36
|
+
: inverted
|
|
37
|
+
? disabled
|
|
38
|
+
? palette === null || palette === void 0 ? void 0 : palette.disabledDarkGray
|
|
39
|
+
: palette === null || palette === void 0 ? void 0 : palette.white
|
|
40
|
+
: disabled
|
|
41
|
+
? palette === null || palette === void 0 ? void 0 : palette.disabledGray
|
|
42
|
+
: palette === null || palette === void 0 ? void 0 : palette.darkest)) !== null && _b !== void 0 ? _b : palette === null || palette === void 0 ? void 0 : palette.darkest;
|
|
24
43
|
return asButton ? (React.createElement(LinkAsButton, __assign({ borderRadius: borderRadius, disabled: isDisabled, icon: icon, inverted: inverted, isDisabled: isDisabled, noWrap: noWrap, onClick: onClick, size: size, variant: variant }, props),
|
|
25
|
-
React.createElement(BodyText, { size: size }, children),
|
|
44
|
+
React.createElement(BodyText, { size: size, color: bodyTextColor }, children),
|
|
26
45
|
icon && React.createElement(IconWrapper, null, icon))) : (React.createElement(BaseLink, __assign({ borderRadius: borderRadius, href: hrefPath, isDisabled: isDisabled, icon: icon, inverted: inverted, noWrap: noWrap, onClick: onClick, size: size, tabIndex: tabIndex, target: target, variant: variant }, props),
|
|
27
|
-
React.createElement(BodyText, { size: size }, children),
|
|
46
|
+
React.createElement(BodyText, { size: size, color: bodyTextColor }, children),
|
|
28
47
|
icon && React.createElement(IconWrapper, null, icon)));
|
|
29
48
|
}
|
|
30
49
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Link.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -22,7 +22,7 @@ var getPortalRoot = function (portalHostSelector) {
|
|
|
22
22
|
var _a;
|
|
23
23
|
if (typeof document === 'undefined')
|
|
24
24
|
return null;
|
|
25
|
-
var hostElement = document.
|
|
25
|
+
var hostElement = document.getElementById(portalHostSelector);
|
|
26
26
|
return (_a = hostElement === null || hostElement === void 0 ? void 0 : hostElement.parentElement) !== null && _a !== void 0 ? _a : document.body;
|
|
27
27
|
};
|
|
28
28
|
var Modal = function (_a) {
|
|
@@ -36,8 +36,9 @@ var Modal = function (_a) {
|
|
|
36
36
|
useEffect(function () {
|
|
37
37
|
if (typeof document === 'undefined')
|
|
38
38
|
return;
|
|
39
|
-
var inertElements = Array.from(new Set(inertSelectors.flatMap(function (
|
|
40
|
-
|
|
39
|
+
var inertElements = Array.from(new Set(inertSelectors.flatMap(function (id) {
|
|
40
|
+
var element = document.getElementById(id);
|
|
41
|
+
return element ? [element] : [];
|
|
41
42
|
})));
|
|
42
43
|
var body = document.body;
|
|
43
44
|
var html = document.documentElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.14",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./build/cjs/components/src/index.js",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"react-slick": "^0.30.1",
|
|
75
75
|
"slick-carousel": "^1.8.1"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "e41ec23e44dca558ad783360ea7a8a03cc0b5657"
|
|
78
78
|
}
|