@pingux/astro 2.163.1-alpha.1 → 2.163.1-alpha.3
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/lib/cjs/components/ComboBoxField/ComboBoxField.js +7 -3
- package/lib/cjs/components/ListBox/ListBox.js +15 -0
- package/lib/cjs/components/ListBox/ListBox.test.js +14 -1
- package/lib/cjs/components/MenuItem/MenuItem.js +22 -13
- package/lib/cjs/components/MenuItem/MenuItem.styles.d.ts +1 -1
- package/lib/cjs/components/MenuItem/MenuItem.styles.js +1 -1
- package/lib/cjs/components/MenuItem/MenuItem.test.js +217 -194
- package/lib/cjs/components/MenuSection/MenuSection.js +2 -1
- package/lib/cjs/components/PopoverMenu/PopoverMenu.stories.js +57 -33
- package/lib/cjs/components/TimeZonePicker/TimeZonePicker.js +117 -140
- package/lib/cjs/components/TimeZonePicker/TimeZonePicker.test.js +29 -2
- package/lib/cjs/components/TimeZonePicker/helper.d.ts +6 -0
- package/lib/cjs/components/TimeZonePicker/helper.js +59 -0
- package/lib/cjs/components/TimeZonePicker/helper.test.js +79 -0
- package/lib/cjs/hooks/useGetTheme/useGetTheme.d.ts +2 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.d.ts +3 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.js +3 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/icons.d.ts +1 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/index.d.ts +1 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/menu.d.ts +15 -2
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/menu.js +20 -7
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +15 -2
- package/lib/cjs/styles/themeOverrides/onyxSideNav.d.ts +1 -0
- package/lib/cjs/styles/themes/astro/customProperties/icons.d.ts +1 -0
- package/lib/cjs/styles/themes/astro/customProperties/icons.js +1 -1
- package/lib/cjs/styles/themes/astro/customProperties/index.d.ts +1 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/icons.d.ts +1 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/icons.js +1 -1
- package/lib/cjs/styles/themes/next-gen/customProperties/index.d.ts +1 -0
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +34 -2
- package/lib/cjs/styles/themes/next-gen/variants/menu.d.ts +32 -2
- package/lib/cjs/styles/themes/next-gen/variants/menu.js +39 -9
- package/lib/cjs/styles/themes/next-gen/variants/popoverMenu.d.ts +1 -0
- package/lib/cjs/styles/themes/next-gen/variants/popoverMenu.js +1 -0
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +33 -2
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +1 -0
- package/lib/cjs/types/listBox.d.ts +1 -1
- package/lib/components/ComboBoxField/ComboBoxField.js +7 -3
- package/lib/components/ListBox/ListBox.js +15 -0
- package/lib/components/ListBox/ListBox.test.js +14 -1
- package/lib/components/MenuItem/MenuItem.js +25 -16
- package/lib/components/MenuItem/MenuItem.styles.js +1 -1
- package/lib/components/MenuItem/MenuItem.test.js +224 -201
- package/lib/components/MenuSection/MenuSection.js +2 -1
- package/lib/components/PopoverMenu/PopoverMenu.stories.js +57 -33
- package/lib/components/TimeZonePicker/TimeZonePicker.js +122 -146
- package/lib/components/TimeZonePicker/TimeZonePicker.test.js +29 -2
- package/lib/components/TimeZonePicker/helper.js +51 -0
- package/lib/components/TimeZonePicker/helper.test.js +76 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/colors.js +3 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/menu.js +20 -7
- package/lib/styles/themes/astro/customProperties/icons.js +1 -1
- package/lib/styles/themes/next-gen/customProperties/icons.js +1 -1
- package/lib/styles/themes/next-gen/variants/menu.js +38 -8
- package/lib/styles/themes/next-gen/variants/popoverMenu.js +1 -0
- package/lib/styles/themes/next-gen/variants/variants.js +2 -1
- package/lib/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -9,9 +9,10 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
9
9
|
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
|
10
10
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
|
11
11
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
12
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof _Symbol ? _Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { return _Object$defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = _Object$create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = _Object$getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(l); function g(t) { var
|
|
12
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof _Symbol ? _Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { return _Object$defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = _Object$create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = _Object$getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(l); function g(t) { var _context5; _forEachInstanceProperty(_context5 = ["next", "throw", "return"]).call(_context5, function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], _forEachInstanceProperty(t).call(t, w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(_typeof(r) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = _Object$create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = _Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { var _context6; if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, _forEachInstanceProperty(_context6 = this.tryEntries).call(_context6, m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+_sliceInstanceProperty(e).call(e, 1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import userEvent from '@testing-library/user-event';
|
|
15
|
+
import exp from 'constants';
|
|
15
16
|
import { OverlayProvider, TimeZonePicker } from '../../index';
|
|
16
17
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
|
17
18
|
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
|
@@ -125,4 +126,30 @@ universalComponentTests({
|
|
|
125
126
|
renderComponent: function renderComponent(props) {
|
|
126
127
|
return ___EmotionJSX(TimeZonePicker, _extends({}, defaultProps, props));
|
|
127
128
|
}
|
|
128
|
-
});
|
|
129
|
+
});
|
|
130
|
+
test('selecting a timezone updates the input value', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
131
|
+
var input, option;
|
|
132
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
133
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
134
|
+
case 0:
|
|
135
|
+
getComponent();
|
|
136
|
+
input = screen.queryByRole('combobox');
|
|
137
|
+
_context4.next = 4;
|
|
138
|
+
return userEvent.type(input, 'America/New York');
|
|
139
|
+
case 4:
|
|
140
|
+
expect(input).toHaveValue('America/New York');
|
|
141
|
+
expect(screen.queryByRole('listbox')).toBeInTheDocument();
|
|
142
|
+
option = screen.getByRole('option', {
|
|
143
|
+
key: 'America/New York GMT-05:00'
|
|
144
|
+
});
|
|
145
|
+
expect(option).toBeInTheDocument();
|
|
146
|
+
_context4.next = 10;
|
|
147
|
+
return userEvent.click(option);
|
|
148
|
+
case 10:
|
|
149
|
+
expect(input).toHaveValue('America/New York GMT-05:00');
|
|
150
|
+
case 11:
|
|
151
|
+
case "end":
|
|
152
|
+
return _context4.stop();
|
|
153
|
+
}
|
|
154
|
+
}, _callee4);
|
|
155
|
+
})));
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
|
2
|
+
import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
|
|
3
|
+
import _parseInt from "@babel/runtime-corejs3/core-js-stable/parse-int";
|
|
4
|
+
export var getOffSetString = function getOffSetString(timeZone) {
|
|
5
|
+
var _parts$find;
|
|
6
|
+
// Use Intl.DateTimeFormat to get the GMT offset string
|
|
7
|
+
var parts = new Intl.DateTimeFormat('en-US', {
|
|
8
|
+
timeZone: timeZone,
|
|
9
|
+
timeZoneName: 'longOffset'
|
|
10
|
+
}).formatToParts(new Date());
|
|
11
|
+
|
|
12
|
+
// Extract the GMT offset part
|
|
13
|
+
var offsetString = ((_parts$find = _findInstanceProperty(parts).call(parts, function (p) {
|
|
14
|
+
return p.type === 'timeZoneName';
|
|
15
|
+
})) === null || _parts$find === void 0 ? void 0 : _parts$find.value) || 'GMT+00:00';
|
|
16
|
+
if (offsetString !== 'GMT') {
|
|
17
|
+
return offsetString;
|
|
18
|
+
}
|
|
19
|
+
return 'GMT+00:00';
|
|
20
|
+
};
|
|
21
|
+
export var getNumericOffset = function getNumericOffset(offsetString) {
|
|
22
|
+
// Convert GMT offset string to numeric offset in hours
|
|
23
|
+
var match = offsetString.match(/([+-])(\d+):(\d+)/);
|
|
24
|
+
if (match) {
|
|
25
|
+
var _match = _slicedToArray(match, 4),
|
|
26
|
+
_ = _match[0],
|
|
27
|
+
sign = _match[1],
|
|
28
|
+
hours = _match[2],
|
|
29
|
+
minutes = _match[3];
|
|
30
|
+
// Calculate the numeric offset in hours
|
|
31
|
+
return (_parseInt(hours, 10) + _parseInt(minutes, 10) / 60) * (sign === '+' ? 1 : -1);
|
|
32
|
+
}
|
|
33
|
+
return 0;
|
|
34
|
+
};
|
|
35
|
+
export var getGmtAndOffset = function getGmtAndOffset(timeZone) {
|
|
36
|
+
try {
|
|
37
|
+
var offsetString = getOffSetString(timeZone);
|
|
38
|
+
var numericOffset = getNumericOffset(offsetString);
|
|
39
|
+
|
|
40
|
+
// Return both the GMT string and numeric offset
|
|
41
|
+
return {
|
|
42
|
+
gmt: offsetString,
|
|
43
|
+
numericOffset: numericOffset
|
|
44
|
+
};
|
|
45
|
+
} catch (e) {
|
|
46
|
+
return {
|
|
47
|
+
gmt: 'GMT+00:00',
|
|
48
|
+
numericOffset: 0
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
|
2
|
+
import { getGmtAndOffset, getNumericOffset, getOffSetString } from './helper';
|
|
3
|
+
describe('TimeZonePicker helpers', function () {
|
|
4
|
+
describe('getOffSetString', function () {
|
|
5
|
+
test('returns GMT offset string for America/New_York', function () {
|
|
6
|
+
var result = getOffSetString('America/New_York');
|
|
7
|
+
expect(result).toMatch(/GMT[+-]\d{2}:\d{2}/);
|
|
8
|
+
});
|
|
9
|
+
test('returns GMT offset string for Europe/London', function () {
|
|
10
|
+
var result = getOffSetString('Europe/London');
|
|
11
|
+
expect(result).toMatch(/GMT[+-]\d{2}:\d{2}/);
|
|
12
|
+
});
|
|
13
|
+
test('returns GMT offset string for Asia/Tokyo', function () {
|
|
14
|
+
var result = getOffSetString('Asia/Tokyo');
|
|
15
|
+
expect(result).toMatch(/GMT[+-]\d{2}:\d{2}/);
|
|
16
|
+
});
|
|
17
|
+
test('returns GMT+00:00 for UTC', function () {
|
|
18
|
+
var result = getOffSetString('UTC');
|
|
19
|
+
expect(result).toBe('GMT+00:00');
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
describe('getNumericOffset', function () {
|
|
23
|
+
test('parses positive offset correctly', function () {
|
|
24
|
+
var result = getNumericOffset('GMT+05:30');
|
|
25
|
+
expect(result).toBe(5.5);
|
|
26
|
+
});
|
|
27
|
+
test('parses negative offset correctly', function () {
|
|
28
|
+
var result = getNumericOffset('GMT-08:00');
|
|
29
|
+
expect(result).toBe(-8);
|
|
30
|
+
});
|
|
31
|
+
test('parses zero offset correctly', function () {
|
|
32
|
+
var result = getNumericOffset('GMT+00:00');
|
|
33
|
+
expect(result).toBe(0);
|
|
34
|
+
});
|
|
35
|
+
test('handles offset with minutes correctly', function () {
|
|
36
|
+
var result = getNumericOffset('GMT+03:30');
|
|
37
|
+
expect(result).toBe(3.5);
|
|
38
|
+
});
|
|
39
|
+
test('returns 0 for invalid offset string', function () {
|
|
40
|
+
var result = getNumericOffset('invalid');
|
|
41
|
+
expect(result).toBe(0);
|
|
42
|
+
});
|
|
43
|
+
test('returns 0 for GMT without offset', function () {
|
|
44
|
+
var result = getNumericOffset('GMT');
|
|
45
|
+
expect(result).toBe(0);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe('getGmtAndOffset', function () {
|
|
49
|
+
test('returns GMT string and numeric offset for valid timezone', function () {
|
|
50
|
+
var result = getGmtAndOffset('America/New_York');
|
|
51
|
+
expect(result).toHaveProperty('gmt');
|
|
52
|
+
expect(result).toHaveProperty('numericOffset');
|
|
53
|
+
expect(result.gmt).toMatch(/GMT[+-]\d{2}:\d{2}/);
|
|
54
|
+
expect(_typeof(result.numericOffset)).toBe('number');
|
|
55
|
+
});
|
|
56
|
+
test('returns GMT+00:00 and 0 for invalid timezone', function () {
|
|
57
|
+
var result = getGmtAndOffset('Invalid/Timezone');
|
|
58
|
+
expect(result).toEqual({
|
|
59
|
+
gmt: 'GMT+00:00',
|
|
60
|
+
numericOffset: 0
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
test('returns correct values for UTC', function () {
|
|
64
|
+
var result = getGmtAndOffset('UTC');
|
|
65
|
+
expect(result).toEqual({
|
|
66
|
+
gmt: 'GMT+00:00',
|
|
67
|
+
numericOffset: 0
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
test('returns correct values for Asia/Kolkata', function () {
|
|
71
|
+
var result = getGmtAndOffset('Asia/Kolkata');
|
|
72
|
+
expect(result.gmt).toMatch(/GMT\+05:30/);
|
|
73
|
+
expect(result.numericOffset).toBe(5.5);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
export var menuItem = {
|
|
2
2
|
item: {
|
|
3
3
|
bg: 'transparent',
|
|
4
|
-
padding: '
|
|
4
|
+
padding: '12px 12px',
|
|
5
5
|
outline: 'none',
|
|
6
6
|
color: 'gray-400',
|
|
7
7
|
cursor: 'pointer',
|
|
8
|
-
'&.is-
|
|
9
|
-
bg: '
|
|
10
|
-
color: '
|
|
8
|
+
'&.is-hovered': {
|
|
9
|
+
bg: '#2C323A',
|
|
10
|
+
color: 'gray-200',
|
|
11
|
+
'> *': {
|
|
12
|
+
color: 'gray-200'
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
'&.is-focused': {
|
|
16
|
+
bg: '#2C323A',
|
|
17
|
+
color: 'gray-200',
|
|
18
|
+
outline: '1px solid',
|
|
19
|
+
outlineOffset: '1px',
|
|
20
|
+
outlineColor: 'primary',
|
|
11
21
|
'> *': {
|
|
12
|
-
color: '
|
|
22
|
+
color: 'gray-200'
|
|
13
23
|
}
|
|
14
24
|
},
|
|
15
|
-
'&.is-pressed': {
|
|
25
|
+
'&.is-selected, &.is-pressed': {
|
|
16
26
|
color: 'text.secondary',
|
|
17
|
-
bg: 'gray-800'
|
|
27
|
+
bg: 'gray-800',
|
|
28
|
+
'> *': {
|
|
29
|
+
color: 'gray-200'
|
|
30
|
+
}
|
|
18
31
|
}
|
|
19
32
|
},
|
|
20
33
|
separator: {
|
|
@@ -40,4 +40,4 @@ import WebIcon from '@pingux/mdi-react/WebIcon';
|
|
|
40
40
|
import { pingLogoHorizontalSmallWhite } from '../../../../utils/devUtils/constants/logos';
|
|
41
41
|
import statuses, { statusIcon } from '../../../../utils/devUtils/constants/statuses';
|
|
42
42
|
import { Aic, Credentials, DaVinci, PamIcon, Protect, Verify } from './navBarIcons';
|
|
43
|
-
export default (_statuses$DEFAULT$sta = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_statuses$DEFAULT$sta, statuses.DEFAULT, InformationIcon), statuses.ERROR, AlertCircleIcon), statuses.SUCCESS, CheckCircleIcon), statuses.WARNING, AlertIcon), statusIcon.CRITICAL, AlertCircleOutlineIcon), statusIcon.FATAL, CloseOctagonOutlineIcon), statusIcon.INFO, InformationOutlineIcon), statusIcon.MAJOR, ArrowUpIcon), statusIcon.MINOR, ArrowDownIcon), statusIcon.WARNING_NEUTRAL, WarningIcon), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_statuses$DEFAULT$sta, "aic", Aic), "applicationsIcon", ApplicationOutlineIcon), "Ascending", MenuUp), "authenticationIcon", CheckCircleOutlineIcon), "clipboard", Clipboard), "CreateIcon", CreateIcon), "daVinci", DaVinci), "DefaultCircle", DefaultCircle), "Descending", MenuDown), "
|
|
43
|
+
export default (_statuses$DEFAULT$sta = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_statuses$DEFAULT$sta, statuses.DEFAULT, InformationIcon), statuses.ERROR, AlertCircleIcon), statuses.SUCCESS, CheckCircleIcon), statuses.WARNING, AlertIcon), statusIcon.CRITICAL, AlertCircleOutlineIcon), statusIcon.FATAL, CloseOctagonOutlineIcon), statusIcon.INFO, InformationOutlineIcon), statusIcon.MAJOR, ArrowUpIcon), statusIcon.MINOR, ArrowDownIcon), statusIcon.WARNING_NEUTRAL, WarningIcon), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_statuses$DEFAULT$sta, "aic", Aic), "applicationsIcon", ApplicationOutlineIcon), "Ascending", MenuUp), "authenticationIcon", CheckCircleOutlineIcon), "clipboard", Clipboard), "CreateIcon", CreateIcon), "daVinci", DaVinci), "DefaultCircle", DefaultCircle), "Descending", MenuDown), "popoverMenuIcon", MoreVertIcon), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_statuses$DEFAULT$sta, "ErrorCircle", AlertCircleIcon), "integrationsIcon", ConnectionIcon), "listViewMenu", MoreVertIcon), "mdiAccountCog", mdiAccountCog), "mdiAccountMultiple", AccountMultiple), "mdiEarth", Earth), "mdiEmoticonHappyOutline", EmoticonHappy), "mdiFingerprint", Fingerprint), "mdiPlayCircleIcon", PlayCircle), "mdiScaleBalance", ScaleBalance), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_statuses$DEFAULT$sta, "mdiShoCard", Credentials), "mdiTransitConnectionVariant", TransitConnection), "mdiViewDashboard", ViewDashboard), "mdiWeb", GlobeIcon), "MenuDown", MenuDown), "MenuUp", MenuUp), "monitoringIcon", PulseIcon), "openInNew", OpenInNew), "overviewIcon", WebIcon), "p1verify", Verify), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_statuses$DEFAULT$sta, "pam", PamIcon), "PingAuthorize", KeyChainVariant), "pingLogoHorizontalSmall", pingLogoHorizontalSmallWhite), "protect", Protect), "rocketLaunchIcon", RocketLaunchIcon), "shareFeedbackIcon", ChatIcon), "shieldStar", ShieldStarOutlineIcon), "SuccessCircle", CheckCircleIcon), "userExperienceIcon", MonitorScreenshotIcon), "WarningIcon", WarningIcon));
|
|
@@ -39,5 +39,5 @@ import WidgetsOutlineIcon from '@pingux/mdi-react/WidgetsOutlineIcon';
|
|
|
39
39
|
import { pingLogoHorizontalSmall } from '../../../../utils/devUtils/constants/logos';
|
|
40
40
|
import statuses, { statusIcon } from '../../../../utils/devUtils/constants/statuses';
|
|
41
41
|
import { Aic, PamIcon, Protect } from '../../astro/customProperties/navBarIcons';
|
|
42
|
-
var icons = (_icons = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_icons, statuses.DEFAULT, InformationOutlineIcon), statuses.ERROR, AlertCircleOutlineIcon), statuses.SUCCESS, CheckCircleOutlineIcon), statuses.WARNING, AlertOutlineIcon), statusIcon.CRITICAL, AlertCircleOutlineIcon), statusIcon.FATAL, CloseOctagonOutlineIcon), statusIcon.INFO, InformationOutlineIcon), statusIcon.MAJOR, ArrowUpIcon), statusIcon.MINOR, ArrowDownIcon), statusIcon.WARNING_NEUTRAL, AlertOutlineIcon), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_icons, "aic", Aic), "applicationsIcon", AppsIcon), "Ascending", ArrowUpIcon), "authenticationIcon", CheckCircleOutlineIcon), "clipboard", Clipboard), "CreateIcon", CreateOutlineIcon), "daVinci", FileTreeIcon), "DefaultCircle", DefaultCircle), "Descending", ArrowDownIcon), "
|
|
42
|
+
var icons = (_icons = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_icons, statuses.DEFAULT, InformationOutlineIcon), statuses.ERROR, AlertCircleOutlineIcon), statuses.SUCCESS, CheckCircleOutlineIcon), statuses.WARNING, AlertOutlineIcon), statusIcon.CRITICAL, AlertCircleOutlineIcon), statusIcon.FATAL, CloseOctagonOutlineIcon), statusIcon.INFO, InformationOutlineIcon), statusIcon.MAJOR, ArrowUpIcon), statusIcon.MINOR, ArrowDownIcon), statusIcon.WARNING_NEUTRAL, AlertOutlineIcon), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_icons, "aic", Aic), "applicationsIcon", AppsIcon), "Ascending", ArrowUpIcon), "authenticationIcon", CheckCircleOutlineIcon), "clipboard", Clipboard), "CreateIcon", CreateOutlineIcon), "daVinci", FileTreeIcon), "DefaultCircle", DefaultCircle), "Descending", ArrowDownIcon), "popoverMenuIcon", DotsHorizontalIcon), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_icons, "ErrorCircle", AlertCircleOutlineIcon), "integrationsIcon", WidgetsOutlineIcon), "listViewMenu", DotsHorizontalIcon), "mdiAccountCog", mdiAccountCog), "mdiAccountMultiple", AccountMultipleOutlineIcon), "mdiEarth", Settings), "mdiEmoticonHappyOutline", EmoticonHappy), "mdiFingerprint", Fingerprint), "mdiPlayCircleIcon", PlayCircleOutline), "mdiScaleBalance", ScaleBalance), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_icons, "mdiShoCard", CardAccountDetailsOutlineIcon), "mdiTransitConnectionVariant", TransitConnection), "mdiViewDashboard", ViewDashboard), "mdiWeb", GlobeIcon), "MenuDown", ChevronDownIcon), "MenuUp", ChevronUpIcon), "monitoringIcon", ShowChartIcon), "openInNew", OpenInNew), "overviewIcon", DashboardIcon), "p1verify", AccountCheckIcon), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_icons, "pam", PamIcon), "PingAuthorize", KeyOutline), "pingLogoHorizontalSmall", pingLogoHorizontalSmall), "protect", Protect), "rocketLaunchIcon", RocketLaunchIcon), "shareFeedbackIcon", ChatIcon), "shieldStar", ShieldStarOutlineIcon), "SuccessCircle", CheckCircleOutlineIcon), "userExperienceIcon", PaletteOutlineIcon), "WarningIcon", AlertOutlineIcon));
|
|
43
43
|
export default icons;
|
|
@@ -3,23 +3,53 @@ export var menu = {
|
|
|
3
3
|
border: '1px solid',
|
|
4
4
|
borderColor: 'border.base'
|
|
5
5
|
};
|
|
6
|
+
export var menuSection = {
|
|
7
|
+
sectionTitle: {
|
|
8
|
+
fontWeight: '1',
|
|
9
|
+
fontSize: 'tiny',
|
|
10
|
+
lineHeight: 'md',
|
|
11
|
+
textTransform: 'uppercase',
|
|
12
|
+
letterSpacing: '1px',
|
|
13
|
+
height: 'unset',
|
|
14
|
+
py: 'sm',
|
|
15
|
+
px: '12px',
|
|
16
|
+
color: 'font.light',
|
|
17
|
+
ml: 0
|
|
18
|
+
}
|
|
19
|
+
};
|
|
6
20
|
export var menuItem = {
|
|
7
21
|
item: {
|
|
8
22
|
bg: 'transparent',
|
|
9
|
-
padding: '
|
|
23
|
+
padding: '12px 12px',
|
|
10
24
|
outline: 'none',
|
|
11
|
-
color: '
|
|
25
|
+
color: 'gray-700',
|
|
26
|
+
fontSize: 'md',
|
|
27
|
+
lineHeight: 'body',
|
|
12
28
|
cursor: 'pointer',
|
|
13
|
-
'
|
|
29
|
+
borderRadius: '4px',
|
|
30
|
+
'&.is-hovered': {
|
|
31
|
+
bg: 'gray-100',
|
|
32
|
+
color: '#121518',
|
|
33
|
+
'> *': {
|
|
34
|
+
color: '#121518'
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
'&.is-focused': {
|
|
14
38
|
bg: 'gray-100',
|
|
15
|
-
color: '
|
|
39
|
+
color: '#121518',
|
|
40
|
+
outline: '1px solid',
|
|
41
|
+
outlineOffset: '1px',
|
|
42
|
+
outlineColor: 'primary',
|
|
16
43
|
'> *': {
|
|
17
|
-
color: '
|
|
44
|
+
color: '#121518'
|
|
18
45
|
}
|
|
19
46
|
},
|
|
20
|
-
'&.is-pressed': {
|
|
21
|
-
|
|
22
|
-
|
|
47
|
+
'&.is-pressed, &.is-selected': {
|
|
48
|
+
bg: 'lightblue',
|
|
49
|
+
color: '#121518',
|
|
50
|
+
'> *': {
|
|
51
|
+
color: '#121518'
|
|
52
|
+
}
|
|
23
53
|
}
|
|
24
54
|
},
|
|
25
55
|
separator: {
|
|
@@ -21,7 +21,7 @@ import { dataTable } from './dataTable';
|
|
|
21
21
|
import { footer } from './footer';
|
|
22
22
|
import iconWrapper from './iconWrapper';
|
|
23
23
|
import { listView, listViewItem, lisViewItemChart } from './listview';
|
|
24
|
-
import { menu, menuItem } from './menu';
|
|
24
|
+
import { menu, menuItem, menuSection } from './menu';
|
|
25
25
|
import { message } from './messages';
|
|
26
26
|
import { navBar } from './navbar';
|
|
27
27
|
import panelHeader from './panelHeader';
|
|
@@ -419,6 +419,7 @@ export default {
|
|
|
419
419
|
loader: loader,
|
|
420
420
|
menu: menu,
|
|
421
421
|
menuItem: menuItem,
|
|
422
|
+
menuSection: menuSection,
|
|
422
423
|
menuTab: menuTab,
|
|
423
424
|
message: message,
|
|
424
425
|
modal: modal,
|