@redhat-cloud-services/frontend-components-utilities 3.2.3 → 3.2.7
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/RBACHook/RBACHook.d.ts +1 -1
- package/RBACHook/RBACHook.js +5 -1
- package/ReducerRegistry/ReducerRegistry.js +1 -1
- package/RouterParams/RouterParams.js +0 -1
- package/esm/RBACHook/RBACHook.js +2 -1
- package/esm/ReducerRegistry/ReducerRegistry.js +1 -1
- package/esm/RouterParams/RouterParams.js +0 -1
- package/esm/index.css +7 -0
- package/esm/index.scss +4 -0
- package/esm/styles/_all.css +3 -0
- package/esm/styles/_all.scss +4 -0
- package/esm/styles/_helpers.css +0 -0
- package/esm/styles/_helpers.scss +0 -0
- package/esm/styles/_mixins.css +0 -0
- package/esm/styles/_mixins.scss +79 -0
- package/esm/styles/_variables.css +3 -0
- package/esm/styles/_variables.scss +42 -0
- package/esm/useInventory/useInventory.js +2 -1
- package/package.json +4 -4
- package/useInventory/useInventory.js +4 -2
package/RBACHook/RBACHook.d.ts
CHANGED
package/RBACHook/RBACHook.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.usePermissions = usePermissions;
|
|
9
|
+
exports["default"] = void 0;
|
|
9
10
|
|
|
10
11
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
12
|
|
|
@@ -59,4 +60,7 @@ function usePermissions(appName, permissionsList) {
|
|
|
59
60
|
}))();
|
|
60
61
|
}, [appName]);
|
|
61
62
|
return permissions;
|
|
62
|
-
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
var _default = usePermissions;
|
|
66
|
+
exports["default"] = _default;
|
|
@@ -59,7 +59,7 @@ var ReducerRegistry = /*#__PURE__*/function () {
|
|
|
59
59
|
var middlewares = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
60
60
|
var composeEnhancersDefault = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _redux.compose;
|
|
61
61
|
(0, _classCallCheck2["default"])(this, ReducerRegistry);
|
|
62
|
-
var composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || composeEnhancersDefault;
|
|
62
|
+
var composeEnhancers = typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || composeEnhancersDefault;
|
|
63
63
|
this.store = (0, _redux.createStore)(function () {
|
|
64
64
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initState;
|
|
65
65
|
return state;
|
package/esm/RBACHook/RBACHook.js
CHANGED
|
@@ -43,7 +43,7 @@ export var ReducerRegistry = /*#__PURE__*/function () {
|
|
|
43
43
|
|
|
44
44
|
_classCallCheck(this, ReducerRegistry);
|
|
45
45
|
|
|
46
|
-
var composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || composeEnhancersDefault;
|
|
46
|
+
var composeEnhancers = typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || composeEnhancersDefault;
|
|
47
47
|
this.store = createStore(function () {
|
|
48
48
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initState;
|
|
49
49
|
return state;
|
package/esm/index.css
ADDED
package/esm/index.scss
ADDED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
@use "sass:math";
|
|
2
|
+
|
|
3
|
+
// Convert px to rem
|
|
4
|
+
// =================================================================/
|
|
5
|
+
@mixin rem($property, $values) {
|
|
6
|
+
|
|
7
|
+
// Create a couple of empty lists as output buffers.
|
|
8
|
+
$font-size: 16px;
|
|
9
|
+
$px-values: ();
|
|
10
|
+
$rem-values: ();
|
|
11
|
+
|
|
12
|
+
// Loop through the $values list
|
|
13
|
+
@each $value in $values {
|
|
14
|
+
|
|
15
|
+
// For each property value, if it's in rem or px, derive both rem and
|
|
16
|
+
// px values for it and add those to the end of the appropriate buffer.
|
|
17
|
+
// Ensure all pixel values are rounded to the nearest pixel.
|
|
18
|
+
@if type-of($value) == number and not unitless($value) and (unit($value) == px) {
|
|
19
|
+
|
|
20
|
+
// px value given - calculate rem value from font-size
|
|
21
|
+
$new-rem-value: math.div($value, $font-size);
|
|
22
|
+
$px-values: join($px-values, round($value));
|
|
23
|
+
$rem-values: join($rem-values, unquote("#{$new-rem-value}rem"));
|
|
24
|
+
|
|
25
|
+
} @else if type-of($value) == number and not unitless($value) and (unit($value) == '%') {
|
|
26
|
+
|
|
27
|
+
// % value given - don't add px or rem
|
|
28
|
+
$px-values: join($px-values, unquote(#{$value}));
|
|
29
|
+
$rem-values: join($rem-values, unquote(#{$value}));
|
|
30
|
+
|
|
31
|
+
} @else if $value == auto {
|
|
32
|
+
|
|
33
|
+
// auto - don't add px or rem
|
|
34
|
+
$px-values: join($px-values, auto);
|
|
35
|
+
$rem-values: join($rem-values, auto);
|
|
36
|
+
|
|
37
|
+
} @else {
|
|
38
|
+
|
|
39
|
+
// unitless value - use those directly as rem and calculate the px-fallback
|
|
40
|
+
$px-values: join($px-values, round($value * $font-size));
|
|
41
|
+
$rem-values: join($rem-values, unquote("#{$value}rem"));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// output the converted rules
|
|
46
|
+
#{$property}: $px-values;
|
|
47
|
+
#{$property}: $rem-values;
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
// Generate font-size in rem
|
|
54
|
+
// =================================================================/
|
|
55
|
+
@mixin font-size($size, $line: $size * 1.4) {
|
|
56
|
+
font-size: ($size);
|
|
57
|
+
font-size: math.div($size, $ins-fontSize) + rem;
|
|
58
|
+
|
|
59
|
+
@if $line == 1 {
|
|
60
|
+
line-height: 1;
|
|
61
|
+
|
|
62
|
+
} @else if $line != null {
|
|
63
|
+
line-height: $line;
|
|
64
|
+
line-height: math.div($line, $ins-fontSize) + rem;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
// Generate transition
|
|
71
|
+
// =================================================================/
|
|
72
|
+
@mixin transition($property) {
|
|
73
|
+
|
|
74
|
+
transition: $property 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
75
|
+
-o-transition: $property 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
76
|
+
-ms-transition: $property 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
77
|
+
-moz-transition: $property 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
78
|
+
-webkit-transition: $property 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
79
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--ins-color--orange: #ec7a08;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
// Spacing
|
|
6
|
+
$ins-padding: var(--pf-global--spacer--lg);
|
|
7
|
+
$ins-margin: var(--pf-global--spacer--xl);
|
|
8
|
+
$ins-gutter: var(--pf-global--gutter);
|
|
9
|
+
|
|
10
|
+
// Font Size
|
|
11
|
+
$ins-fontSize: var(--pf-global--FontSize--md);
|
|
12
|
+
$ins-fontSize--sm: var(--pf-global--FontSize--sm);
|
|
13
|
+
$ins-fontSize--lg: var(--pf-global--FontSize--lg);
|
|
14
|
+
$ins-fontSize--xl: var(--pf-global--FontSize--xl);
|
|
15
|
+
|
|
16
|
+
// Borders
|
|
17
|
+
$ins-borderRadius: var(--pf-global--BorderRadius--sm);
|
|
18
|
+
$ins-borderRadius--round: var(--pf-global--BorderRadius--lg);
|
|
19
|
+
|
|
20
|
+
// Grid breakpoints
|
|
21
|
+
$ins-break--xs: var(--pf-global--breakpoint--xs);
|
|
22
|
+
$ins-break--sm: var(--pf-global--breakpoint--sm);
|
|
23
|
+
$ins-break--md: var(--pf-global--breakpoint--md);
|
|
24
|
+
$ins-break--lg: var(--pf-global--breakpoint--lg);
|
|
25
|
+
$ins-break--xl: var(--pf-global--breakpoint--xl);
|
|
26
|
+
|
|
27
|
+
// Colors
|
|
28
|
+
$ins-color--red: var(--pf-global--danger-color--100);
|
|
29
|
+
$ins-color--critical: $ins-color--red;
|
|
30
|
+
|
|
31
|
+
$ins-color--orange: var(--ins-color--orange);
|
|
32
|
+
$ins-color--high: $ins-color--orange;
|
|
33
|
+
|
|
34
|
+
$ins-color--yellow: var(--pf-global--warning-color--100);
|
|
35
|
+
$ins-color--medium: $ins-color--yellow;
|
|
36
|
+
|
|
37
|
+
$ins-color--green: var(--pf-global--success-color--100);
|
|
38
|
+
$ins-color--low: $ins-color--green;
|
|
39
|
+
|
|
40
|
+
$ins-color--blue: var(--pf-global--info-color--100);
|
|
41
|
+
|
|
42
|
+
$ins-color--gray: var(--pf-global--disabled-color--200);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redhat-cloud-services/frontend-components-utilities",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.7",
|
|
4
4
|
"description": "Util functions for RedHat Cloud Services project.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
"homepage": "https://github.com/RedHatInsights/frontend-components/tree/master/packages/utils#readme",
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@patternfly/react-core": ">=4.18.5",
|
|
30
|
+
"@patternfly/react-table": ">=2.1.6",
|
|
30
31
|
"react": ">=16.14.0 || >=17.0.0",
|
|
31
32
|
"react-dom": ">=16.14.0 || >=17.0.0",
|
|
32
33
|
"react-redux": ">=5.0.7",
|
|
33
|
-
"react-router-dom": ">=4.2.2"
|
|
34
|
-
"@patternfly/react-table": ">=2.1.6"
|
|
34
|
+
"react-router-dom": ">=4.2.2"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@sentry/browser": "^5.4.0",
|
|
38
38
|
"awesome-debounce-promise": "^2.1.0",
|
|
39
|
-
"axios": "^0.21.
|
|
39
|
+
"axios": "^0.21.4",
|
|
40
40
|
"commander": ">=2.20.0",
|
|
41
41
|
"mkdirp": "^1.0.4",
|
|
42
42
|
"react-content-loader": ">=3.4.1"
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.useInventory = void 0;
|
|
10
|
+
exports["default"] = exports.useInventory = void 0;
|
|
11
11
|
|
|
12
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
13
|
|
|
@@ -149,4 +149,6 @@ var useInventory = function useInventory(_ref) {
|
|
|
149
149
|
return _objectSpread(_objectSpread({}, inventory), inventoryComponents);
|
|
150
150
|
};
|
|
151
151
|
|
|
152
|
-
exports.useInventory = useInventory;
|
|
152
|
+
exports.useInventory = useInventory;
|
|
153
|
+
var _default = useInventory;
|
|
154
|
+
exports["default"] = _default;
|