@pingux/astro 2.16.1-alpha.1 → 2.17.0-alpha.1
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/ListView/ListView.js +1 -1
- package/lib/cjs/components/ListView/ListView.mdx +4 -1
- package/lib/cjs/components/ListView/ListView.stories.js +52 -98
- package/lib/cjs/components/ListView/ListViewItem.js +126 -0
- package/lib/cjs/components/ListViewItem/ListViewItem.js +81 -100
- package/lib/cjs/{experimental → components}/ListViewItem/ListViewItem.mdx +4 -4
- package/lib/cjs/{experimental → components}/ListViewItem/ListViewItem.stories.js +32 -37
- package/lib/cjs/{experimental → components}/ListViewItem/ListViewItem.test.js +3 -3
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemEditButton.js +5 -5
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemEditButton.stories.js +5 -5
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemEditButton.test.js +2 -2
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemMenu.js +8 -8
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemMenu.stories.js +5 -5
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemMenu.test.js +2 -3
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemSwitchField.js +5 -5
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemSwitchField.stories.js +5 -5
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemSwitchField.test.js +2 -2
- package/lib/cjs/experimental/PageHeader/PageHeader.js +14 -14
- package/lib/cjs/experimental/PageHeader/PageHeader.stories.js +27 -11
- package/lib/cjs/experimental/PageHeader/PageHeader.test.js +14 -5
- package/lib/cjs/experimental/PanelHeader/PanelHeader.js +1 -1
- package/lib/cjs/experimental/PanelHeader/PanelHeader.stories.js +1 -1
- package/lib/cjs/index.d.ts +4 -4
- package/lib/cjs/index.js +8 -8
- package/lib/cjs/recipes/ListAndPanel.stories.js +195 -267
- package/lib/cjs/recipes/MaskedValue.stories.js +8 -1
- package/lib/cjs/{experimental/recipes → recipes}/ScrollableListView.stories.js +2 -2
- package/lib/cjs/utils/designUtils/figmaLinks.js +3 -0
- package/lib/components/ListView/ListView.js +1 -1
- package/lib/components/ListView/ListView.mdx +4 -1
- package/lib/components/ListView/ListView.stories.js +47 -93
- package/lib/components/ListView/ListViewItem.js +113 -0
- package/lib/components/ListViewItem/ListViewItem.js +78 -99
- package/lib/{experimental → components}/ListViewItem/ListViewItem.mdx +4 -4
- package/lib/{experimental → components}/ListViewItem/ListViewItem.stories.js +7 -12
- package/lib/{experimental → components}/ListViewItem/ListViewItem.test.js +1 -1
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemEditButton.js +4 -4
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemEditButton.stories.js +3 -3
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemEditButton.test.js +1 -1
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemMenu.js +5 -5
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemMenu.stories.js +3 -3
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemMenu.test.js +1 -2
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemSwitchField.js +4 -4
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemSwitchField.stories.js +3 -3
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemSwitchField.test.js +1 -1
- package/lib/experimental/PageHeader/PageHeader.js +14 -14
- package/lib/experimental/PageHeader/PageHeader.stories.js +25 -10
- package/lib/experimental/PageHeader/PageHeader.test.js +14 -5
- package/lib/experimental/PanelHeader/PanelHeader.js +1 -1
- package/lib/experimental/PanelHeader/PanelHeader.stories.js +1 -1
- package/lib/index.js +4 -4
- package/lib/recipes/ListAndPanel.stories.js +186 -260
- package/lib/recipes/MaskedValue.stories.js +7 -0
- package/lib/{experimental/recipes → recipes}/ScrollableListView.stories.js +2 -2
- package/lib/utils/designUtils/figmaLinks.js +3 -0
- package/package.json +1 -1
- package/lib/cjs/components/ListItem/ListItem.stories.js +0 -189
- package/lib/cjs/experimental/ListView/ListView.mdx +0 -47
- package/lib/cjs/experimental/ListView/ListView.stories.js +0 -742
- package/lib/cjs/experimental/ListViewItem/ListViewItem.js +0 -108
- package/lib/cjs/experimental/recipes/ListAndPanel.stories.js +0 -359
- package/lib/cjs/recipes/RadioButtonsWithLinks.stories.js +0 -133
- package/lib/cjs/recipes/ScrollableListView.stories.hidden.js +0 -136
- package/lib/components/ListItem/ListItem.stories.js +0 -174
- package/lib/experimental/ListView/ListView.mdx +0 -47
- package/lib/experimental/ListView/ListView.stories.js +0 -729
- package/lib/experimental/ListViewItem/ListViewItem.js +0 -93
- package/lib/experimental/recipes/ListAndPanel.stories.js +0 -342
- package/lib/recipes/RadioButtonsWithLinks.stories.js +0 -118
- package/lib/recipes/ScrollableListView.stories.hidden.js +0 -121
- /package/lib/cjs/{experimental → components}/ListViewItem/listViewItemAttributes.js +0 -0
- /package/lib/cjs/{experimental/recipes → recipes}/items.js +0 -0
- /package/lib/{experimental → components}/ListViewItem/listViewItemAttributes.js +0 -0
- /package/lib/{experimental/recipes → recipes}/items.js +0 -0
package/lib/{experimental → components}/ListViewItem/controls/ListViewItemEditButton.stories.js
RENAMED
@@ -1,12 +1,12 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import React from 'react';
|
3
|
-
import {
|
4
|
-
import {
|
3
|
+
import { ListViewItemEditButton } from '../../..';
|
4
|
+
import { iconButtonArgs, iconButtonArgTypes } from '../../IconButton/iconButtonAttributes';
|
5
5
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
6
6
|
delete iconButtonArgTypes.size;
|
7
7
|
delete iconButtonArgTypes.icon;
|
8
8
|
export default {
|
9
|
-
title: '
|
9
|
+
title: 'Components/ListViewItem/Controls/ListViewItemEditButton',
|
10
10
|
component: ListViewItemEditButton,
|
11
11
|
parameters: {
|
12
12
|
docs: {
|
package/lib/{experimental → components}/ListViewItem/controls/ListViewItemEditButton.test.js
RENAMED
@@ -1,8 +1,8 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import userEvent from '@testing-library/user-event';
|
3
|
+
import { ListViewItemEditButton } from '../../..';
|
3
4
|
import axeTest from '../../../utils/testUtils/testAxe';
|
4
5
|
import { render, screen } from '../../../utils/testUtils/testWrapper';
|
5
|
-
import ListViewItemEditButton from './ListViewItemEditButton';
|
6
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
7
|
var getComponent = function getComponent() {
|
8
8
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -2,14 +2,14 @@ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectW
|
|
2
2
|
var _excluded = ["children"];
|
3
3
|
import React from 'react';
|
4
4
|
import MoreVertIcon from '@pingux/mdi-react/MoreVertIcon';
|
5
|
-
import {
|
6
|
-
import {
|
5
|
+
import { Icon, IconButton, Menu, PopoverMenu } from '../../..';
|
6
|
+
import { menuPropTypes } from '../../Menu/menuAttributes';
|
7
7
|
|
8
8
|
/**
|
9
9
|
* ListViewItemEditButton is one of several styled control components that can be used as a child
|
10
|
-
* nested inside of the [ListViewItem](./?path=/
|
11
|
-
* Its a wrapper component around the [PopoverMenu](./?path=/
|
12
|
-
* and [Menu](./?path=/docs/components-menu--
|
10
|
+
* nested inside of the [ListViewItem](./?path=/docs/components-listviewitem--docs).
|
11
|
+
* Its a wrapper component around the [PopoverMenu](./?path=/docs/components-popovermenu--docs)
|
12
|
+
* and [Menu](./?path=/docs/components-menu--docs) component, intended to make matching
|
13
13
|
* specs easy. Most props available to the Menu component are available to ListItemMenu.
|
14
14
|
*/
|
15
15
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { Item } from 'react-stately';
|
3
|
-
import {
|
4
|
-
import {
|
3
|
+
import { ListViewItemMenu } from '../../..';
|
4
|
+
import { menuArgTypes } from '../../Menu/menuAttributes';
|
5
5
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
6
6
|
export default {
|
7
|
-
title: '
|
7
|
+
title: 'Components/ListViewItem/Controls/ListViewItemMenu',
|
8
8
|
component: ListViewItemMenu,
|
9
9
|
parameters: {
|
10
10
|
docs: {
|
@@ -12,10 +12,9 @@ import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerat
|
|
12
12
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context2; _forEachInstanceProperty(_context2 = ["next", "throw", "return"]).call(_context2, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context3; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context3 = this.tryEntries).call(_context3, resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
13
13
|
import React from 'react';
|
14
14
|
import userEvent from '@testing-library/user-event';
|
15
|
-
import { Item } from '
|
15
|
+
import { Item, ListViewItemMenu } from '../../..';
|
16
16
|
import axeTest from '../../../utils/testUtils/testAxe';
|
17
17
|
import { render, screen } from '../../../utils/testUtils/testWrapper';
|
18
|
-
import ListViewItemMenu from './ListViewItemMenu';
|
19
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
20
19
|
var getComponent = function getComponent() {
|
21
20
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import React from 'react';
|
3
|
-
import {
|
4
|
-
import {
|
3
|
+
import { SwitchField } from '../../..';
|
4
|
+
import { switchFieldPropTypes } from '../../SwitchField/switchFieldAttributes';
|
5
5
|
|
6
6
|
/**
|
7
7
|
* ListViewItemSwitchField is one of several styled control components that can be used as a child
|
8
|
-
* nested inside of the [ListViewItem](./?path=/
|
9
|
-
* Its a wrapper component around the [SwitchField](./?path=/
|
8
|
+
* nested inside of the [ListViewItem](./?path=/docs/components-listviewitem--docs).
|
9
|
+
* Its a wrapper component around the [SwitchField](./?path=/docs/form-switchfield--docs),
|
10
10
|
* intended to make matching specs easy. Most props available to the SwitchField are also
|
11
11
|
* available to ListItemEditButton.
|
12
12
|
*/
|
package/lib/{experimental → components}/ListViewItem/controls/ListViewItemSwitchField.stories.js
RENAMED
@@ -10,13 +10,13 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
10
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; }
|
11
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; }
|
12
12
|
import React from 'react';
|
13
|
-
import {
|
14
|
-
import { ListViewItemSwitchField } from '../../../index';
|
13
|
+
import { ListViewItemSwitchField } from '../../..';
|
15
14
|
import { onHoverArgTypes } from '../../../utils/docUtils/hoverProps';
|
15
|
+
import { switchFieldArgs, switchFieldArgTypes } from '../../SwitchField/switchFieldAttributes';
|
16
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
17
17
|
delete switchFieldArgTypes.label;
|
18
18
|
export default {
|
19
|
-
title: '
|
19
|
+
title: 'Components/ListViewItem/Controls/ListViewItemSwitchField',
|
20
20
|
component: ListViewItemSwitchField,
|
21
21
|
parameters: {
|
22
22
|
docs: {
|
package/lib/{experimental → components}/ListViewItem/controls/ListViewItemSwitchField.test.js
RENAMED
@@ -1,8 +1,8 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import userEvent from '@testing-library/user-event';
|
3
|
+
import { ListViewItemSwitchField } from '../../..';
|
3
4
|
import axeTest from '../../../utils/testUtils/testAxe';
|
4
5
|
import { render, screen } from '../../../utils/testUtils/testWrapper';
|
5
|
-
import ListViewItemSwitchField from './ListViewItemSwitchField';
|
6
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
7
|
var getComponent = function getComponent() {
|
8
8
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -6,12 +6,11 @@ import PlusIcon from '@pingux/mdi-react/PlusIcon';
|
|
6
6
|
import PropTypes from 'prop-types';
|
7
7
|
import { Box, Icon, IconButton, Text } from '../..';
|
8
8
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
9
|
-
var PageHeader = /*#__PURE__*/forwardRef(function (
|
10
|
-
var
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
other = _objectWithoutProperties(props, _excluded);
|
9
|
+
var PageHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
10
|
+
var buttonProps = _ref.buttonProps,
|
11
|
+
children = _ref.children,
|
12
|
+
title = _ref.title,
|
13
|
+
other = _objectWithoutProperties(_ref, _excluded);
|
15
14
|
var sx = {
|
16
15
|
wrapper: {
|
17
16
|
align: 'center',
|
@@ -32,6 +31,14 @@ var PageHeader = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
32
31
|
}
|
33
32
|
}
|
34
33
|
};
|
34
|
+
var renderButton = buttonProps && ___EmotionJSX(IconButton, _extends({
|
35
|
+
"aria-label": "icon button",
|
36
|
+
ml: "sm",
|
37
|
+
variant: "inverted"
|
38
|
+
}, buttonProps), ___EmotionJSX(Icon, {
|
39
|
+
icon: PlusIcon,
|
40
|
+
size: "sm"
|
41
|
+
}));
|
35
42
|
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Box, _extends({
|
36
43
|
isRow: true,
|
37
44
|
sx: sx.wrapper,
|
@@ -42,14 +49,7 @@ var PageHeader = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
42
49
|
}), ___EmotionJSX(Text, {
|
43
50
|
sx: sx.titleText,
|
44
51
|
as: "h1"
|
45
|
-
}, title), ___EmotionJSX(
|
46
|
-
"aria-label": "icon button",
|
47
|
-
ml: "sm",
|
48
|
-
variant: "inverted"
|
49
|
-
}, buttonProps), ___EmotionJSX(Icon, {
|
50
|
-
icon: PlusIcon,
|
51
|
-
size: "sm"
|
52
|
-
}))), ___EmotionJSX(Text, {
|
52
|
+
}, title), renderButton), ___EmotionJSX(Text, {
|
53
53
|
sx: sx.description
|
54
54
|
}, children));
|
55
55
|
});
|
@@ -18,26 +18,41 @@ export default {
|
|
18
18
|
type: 'text'
|
19
19
|
}
|
20
20
|
}
|
21
|
-
},
|
22
|
-
args: {
|
23
|
-
title: 'Title of the Page'
|
24
21
|
}
|
25
22
|
};
|
26
23
|
var description = "The description of the page. The description of the page. The description of the page. The\n description of the page.The description of the page. The description of the page. The\n description of the page. The description of the page. The description of the page. ";
|
27
24
|
export var Default = function Default(args) {
|
28
|
-
return ___EmotionJSX(PageHeader,
|
25
|
+
return ___EmotionJSX(PageHeader, _extends({
|
26
|
+
buttonProps: {
|
27
|
+
onPress: function onPress() {}
|
28
|
+
},
|
29
|
+
title: "Title of the Page"
|
30
|
+
}, args), description, ___EmotionJSX(Link, {
|
29
31
|
href: "https://uilibrary.ping-eng.com/"
|
30
32
|
}, "Learn more"));
|
31
33
|
};
|
32
|
-
export var
|
33
|
-
return ___EmotionJSX(PageHeader,
|
34
|
+
export var WithoutButton = function WithoutButton() {
|
35
|
+
return ___EmotionJSX(PageHeader, {
|
36
|
+
title: "Title of the Page"
|
37
|
+
}, description, ___EmotionJSX(Link, {
|
38
|
+
href: "https://uilibrary.ping-eng.com/"
|
39
|
+
}, "Learn more"));
|
34
40
|
};
|
35
|
-
export var
|
36
|
-
return ___EmotionJSX(PageHeader,
|
41
|
+
export var WithoutLink = function WithoutLink() {
|
42
|
+
return ___EmotionJSX(PageHeader, {
|
43
|
+
buttonProps: {
|
44
|
+
onPress: function onPress() {}
|
45
|
+
},
|
46
|
+
title: "Title of the Page"
|
47
|
+
}, description);
|
48
|
+
};
|
49
|
+
export var WithButtonProps = function WithButtonProps() {
|
50
|
+
return ___EmotionJSX(PageHeader, {
|
37
51
|
buttonProps: {
|
38
52
|
bg: 'critical.bright'
|
39
|
-
}
|
40
|
-
|
53
|
+
},
|
54
|
+
title: "Title of the Page"
|
55
|
+
}, description, ___EmotionJSX(Link, {
|
41
56
|
href: "https://uilibrary.ping-eng.com/"
|
42
57
|
}, "Learn more"));
|
43
58
|
};
|
@@ -7,7 +7,6 @@ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-st
|
|
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
9
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
10
|
-
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
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
|
import React from 'react';
|
@@ -19,11 +18,14 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
19
18
|
var testId = 'test-header';
|
20
19
|
var defaultProps = {
|
21
20
|
title: 'test-title',
|
22
|
-
'data-testid': testId
|
21
|
+
'data-testid': testId,
|
22
|
+
buttonProps: {
|
23
|
+
onPress: jest.fn()
|
24
|
+
}
|
23
25
|
};
|
24
26
|
var getComponent = function getComponent() {
|
25
|
-
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] :
|
26
|
-
return render(___EmotionJSX(PageHeader,
|
27
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultProps;
|
28
|
+
return render(___EmotionJSX(PageHeader, props, "The description of the page. The description of the page. The description of the page. The description of the page.The description of the page. The description of the page. The description of the page. The description of the page. The description of the page.\xA0", ___EmotionJSX(Link, {
|
27
29
|
href: "https://uilibrary.ping-eng.com/"
|
28
30
|
}, "Learn more")));
|
29
31
|
};
|
@@ -44,7 +46,14 @@ test('renders default PageHeader', function () {
|
|
44
46
|
expect(title).toBeInTheDocument();
|
45
47
|
expect(wrapper.children.length).toEqual(2);
|
46
48
|
});
|
47
|
-
test('
|
49
|
+
test('when there are no buttonProps, it does not render a button', function () {
|
50
|
+
getComponent({
|
51
|
+
title: 'test-title'
|
52
|
+
});
|
53
|
+
var button = screen.queryByRole('button');
|
54
|
+
expect(button).not.toBeInTheDocument();
|
55
|
+
});
|
56
|
+
test('when the button is pressed, it calls the onPress callback', function () {
|
48
57
|
var onPress = jest.fn();
|
49
58
|
var customButtonProps = {
|
50
59
|
bg: '#000000'
|
@@ -14,8 +14,8 @@ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-st
|
|
14
14
|
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
15
15
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
16
16
|
import React, { forwardRef } from 'react';
|
17
|
+
import { SharedItemPropTypes } from '../../components/ListViewItem/listViewItemAttributes';
|
17
18
|
import { Box, Icon, Text } from '../../index';
|
18
|
-
import { SharedItemPropTypes } from '../ListViewItem/listViewItemAttributes';
|
19
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
20
20
|
export var PANEL_HEADER_ICON = '-panel-header-icon';
|
21
21
|
var PanelHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
@@ -3,8 +3,8 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
3
3
|
import React from 'react';
|
4
4
|
import AccountIcon from '@pingux/mdi-react/AccountIcon';
|
5
5
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
6
|
+
import { SharedItemArgTypes } from '../../components/ListViewItem/listViewItemAttributes';
|
6
7
|
import { Item, PanelHeader, PanelHeaderCloseButton, PanelHeaderMenu, PanelHeaderSwitchField } from '../../index';
|
7
|
-
import { SharedItemArgTypes } from '../ListViewItem/listViewItemAttributes';
|
8
8
|
import PanelHeaderReadMe from './PanelHeader.mdx';
|
9
9
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
10
10
|
export default {
|
package/lib/index.js
CHANGED
@@ -83,6 +83,10 @@ export { default as ListItem } from './components/ListItem';
|
|
83
83
|
export * from './components/ListItem';
|
84
84
|
export { default as ListView } from './components/ListView';
|
85
85
|
export * from './components/ListView';
|
86
|
+
export { default as ListViewItem } from './components/ListViewItem';
|
87
|
+
export { default as ListViewItemEditButton } from './components/ListViewItem/controls/ListViewItemEditButton';
|
88
|
+
export { default as ListViewItemMenu } from './components/ListViewItem/controls/ListViewItemMenu';
|
89
|
+
export { default as ListViewItemSwitchField } from './components/ListViewItem/controls/ListViewItemSwitchField';
|
86
90
|
export { default as Loader } from './components/Loader';
|
87
91
|
export * from './components/Loader';
|
88
92
|
export { default as Menu } from './components/Menu';
|
@@ -172,10 +176,6 @@ export { TableBody as DataTableBody, Cell as DataTableCell, Column as DataTableC
|
|
172
176
|
// Experimental
|
173
177
|
export { default as ButtonBar } from './experimental/ButtonBar/ButtonBar';
|
174
178
|
export { default as EditButton } from './experimental/EditButton';
|
175
|
-
export { default as ListViewItemEditButton } from './experimental/ListViewItem/controls/ListViewItemEditButton';
|
176
|
-
export { default as ListViewItemMenu } from './experimental/ListViewItem/controls/ListViewItemMenu';
|
177
|
-
export { default as ListViewItemSwitchField } from './experimental/ListViewItem/controls/ListViewItemSwitchField';
|
178
|
-
export { default as ListViewItem } from './experimental/ListViewItem/ListViewItem';
|
179
179
|
export { default as PanelHeader } from './experimental/PanelHeader';
|
180
180
|
export { default as PanelHeaderCloseButton } from './experimental/PanelHeader/controls/PanelHeaderCloseButton';
|
181
181
|
export { default as PanelHeaderMenu } from './experimental/PanelHeader/controls/PanelHeaderMenu';
|