@pingux/astro 2.141.1-alpha.0 → 2.142.0

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,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  export declare const baseState: {
3
3
  isOnyx: boolean;
4
4
  isAstro: boolean;
@@ -10,7 +10,7 @@ declare const useGetTheme: () => {
10
10
  [x: number]: import("@pingux/mdi-react").MdiReactIconComponentType;
11
11
  MenuDown: import("@pingux/mdi-react").MdiReactIconComponentType;
12
12
  MenuUp: import("@pingux/mdi-react").MdiReactIconComponentType;
13
- pingLogoHorizontalSmall: import("react").JSX.Element;
13
+ pingLogoHorizontalSmall: React.JSX.Element;
14
14
  listViewMenu: import("@pingux/mdi-react").MdiReactIconComponentType;
15
15
  Ascending: import("@pingux/mdi-react").MdiReactIconComponentType;
16
16
  Descending: import("@pingux/mdi-react").MdiReactIconComponentType;
@@ -13,10 +13,8 @@ _Object$defineProperty(exports, "__esModule", {
13
13
  value: true
14
14
  });
15
15
  exports["default"] = exports.baseState = void 0;
16
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
17
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
18
- var _react = require("react");
19
- var _react2 = require("@emotion/react");
17
+ var _react = require("@emotion/react");
20
18
  var _customProperties = require("../../styles/themeOverrides/nextGenDarkMode/customProperties");
21
19
  var _customProperties2 = require("../../styles/themes/astro/customProperties");
22
20
  var _customProperties3 = require("../../styles/themes/next-gen/customProperties");
@@ -55,28 +53,18 @@ var customThemeState = _objectSpread({
55
53
  }),
56
54
  name: 'custom'
57
55
  }, _customProperties2.astroThemeValues);
58
- var getTheme = function getTheme(theme) {
59
- if (theme === _themes.themes.NEXT_GEN) {
56
+ var useGetTheme = function useGetTheme() {
57
+ var theme = (0, _react.useTheme)();
58
+ if (theme.name === _themes.themes.NEXT_GEN) {
60
59
  return _objectSpread({}, onyxState);
61
60
  }
62
- if (theme === _themes.themes.ASTRO) {
61
+ if (theme.name === _themes.themes.ASTRO) {
63
62
  return _objectSpread({}, astroState);
64
63
  }
65
- if (theme === _themes.themes.NEXT_GEN_DARK) {
64
+ if (theme.name === _themes.themes.NEXT_GEN_DARK) {
66
65
  return _objectSpread({}, onyxDarkState);
67
66
  }
68
67
  return _objectSpread({}, customThemeState);
69
68
  };
70
- var useGetTheme = function useGetTheme() {
71
- var theme = (0, _react2.useTheme)();
72
- var _useState = (0, _react.useState)(getTheme(theme.name)),
73
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
74
- themeObject = _useState2[0],
75
- setThemeObject = _useState2[1];
76
- (0, _react.useEffect)(function () {
77
- setThemeObject(getTheme(theme.name));
78
- }, [theme.name]);
79
- return themeObject;
80
- };
81
69
  var _default = useGetTheme;
82
70
  exports["default"] = _default;
@@ -6,12 +6,11 @@ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/inst
6
6
  import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
7
7
  import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
8
8
  import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
9
- import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
10
9
  import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
11
10
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
11
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
13
12
  /* eslint-disable no-else-return */
14
- import { useEffect, useState } from 'react';
13
+
15
14
  import { useTheme } from '@emotion/react';
16
15
  import { nextGenDarkThemeValues } from '../../styles/themeOverrides/nextGenDarkMode/customProperties';
17
16
  import { astroThemeValues } from '../../styles/themes/astro/customProperties';
@@ -48,27 +47,17 @@ var customThemeState = _objectSpread({
48
47
  }),
49
48
  name: 'custom'
50
49
  }, astroThemeValues);
51
- var getTheme = function getTheme(theme) {
52
- if (theme === themes.NEXT_GEN) {
50
+ var useGetTheme = function useGetTheme() {
51
+ var theme = useTheme();
52
+ if (theme.name === themes.NEXT_GEN) {
53
53
  return _objectSpread({}, onyxState);
54
54
  }
55
- if (theme === themes.ASTRO) {
55
+ if (theme.name === themes.ASTRO) {
56
56
  return _objectSpread({}, astroState);
57
57
  }
58
- if (theme === themes.NEXT_GEN_DARK) {
58
+ if (theme.name === themes.NEXT_GEN_DARK) {
59
59
  return _objectSpread({}, onyxDarkState);
60
60
  }
61
61
  return _objectSpread({}, customThemeState);
62
62
  };
63
- var useGetTheme = function useGetTheme() {
64
- var theme = useTheme();
65
- var _useState = useState(getTheme(theme.name)),
66
- _useState2 = _slicedToArray(_useState, 2),
67
- themeObject = _useState2[0],
68
- setThemeObject = _useState2[1];
69
- useEffect(function () {
70
- setThemeObject(getTheme(theme.name));
71
- }, [theme.name]);
72
- return themeObject;
73
- };
74
63
  export default useGetTheme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.141.1-alpha.0",
3
+ "version": "2.142.0",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",