@automattic/vip-design-system 2.4.5 → 2.6.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.
Files changed (97) hide show
  1. package/build/system/Breadcrumbs/Breadcrumbs.d.ts +1 -0
  2. package/build/system/Breadcrumbs/Breadcrumbs.js +75 -20
  3. package/build/system/Breadcrumbs/Breadcrumbs.stories.d.ts +2 -0
  4. package/build/system/Breadcrumbs/Breadcrumbs.stories.js +47 -7
  5. package/build/system/Breadcrumbs/Breadcrumbs.test.js +72 -0
  6. package/build/system/Breadcrumbs/styles.d.ts +2 -0
  7. package/build/system/Breadcrumbs/styles.js +8 -2
  8. package/build/system/Dropdown/Dropdown.d.ts +25 -36
  9. package/build/system/Dropdown/Dropdown.js +60 -99
  10. package/build/system/Dropdown/Dropdown.stories.d.ts +1 -26
  11. package/build/system/Dropdown/Dropdown.test.js +51 -28
  12. package/build/system/Dropdown/DropdownContent.d.ts +14 -10
  13. package/build/system/Dropdown/DropdownContent.js +43 -47
  14. package/build/system/Dropdown/DropdownItem.d.ts +20 -32
  15. package/build/system/Dropdown/DropdownItem.js +86 -103
  16. package/build/system/Dropdown/DropdownLabel.d.ts +11 -7
  17. package/build/system/Dropdown/DropdownLabel.js +29 -29
  18. package/build/system/Dropdown/DropdownSeparator.d.ts +10 -6
  19. package/build/system/Dropdown/DropdownSeparator.js +28 -28
  20. package/build/system/Dropdown/index.d.ts +17 -39
  21. package/build/system/Dropdown/index.js +23 -50
  22. package/build/system/FilterDropdown/FilterDropdown.d.ts +27 -0
  23. package/build/system/FilterDropdown/FilterDropdown.js +75 -0
  24. package/build/system/FilterDropdown/FilterDropdown.stories.d.ts +18 -0
  25. package/build/system/FilterDropdown/FilterDropdown.stories.js +46 -0
  26. package/build/system/FilterDropdown/FilterDropdown.test.d.ts +1 -0
  27. package/build/system/FilterDropdown/FilterDropdown.test.js +53 -0
  28. package/build/system/Hr/Hr.d.ts +7 -0
  29. package/build/system/Hr/Hr.js +22 -0
  30. package/build/system/Hr/Hr.stories.d.ts +23 -0
  31. package/build/system/Hr/Hr.stories.js +30 -0
  32. package/build/system/Hr/Hr.test.d.ts +1 -0
  33. package/build/system/Hr/Hr.test.js +41 -0
  34. package/build/system/Link/Link.d.ts +11 -1
  35. package/build/system/Link/Link.js +16 -1
  36. package/build/system/Link/Link.stories.d.ts +14 -1
  37. package/build/system/Link/Link.stories.js +16 -3
  38. package/build/system/Nav/styles.js +2 -1
  39. package/build/system/Page/Page.d.ts +2 -0
  40. package/build/system/Page/Page.js +10 -0
  41. package/build/system/Page/Page.test.d.ts +1 -0
  42. package/build/system/Page/Page.test.js +41 -0
  43. package/build/system/index.d.ts +3 -1
  44. package/build/system/index.js +4 -0
  45. package/build/system/theme/index.d.ts +889 -23
  46. package/build/system/theme/index.js +7 -8
  47. package/build/system/utils/stories/CustomLink.d.ts +1 -0
  48. package/build/system/utils/stories/CustomLink.js +7 -1
  49. package/package.json +1 -1
  50. package/src/system/Breadcrumbs/Breadcrumbs.stories.tsx +32 -3
  51. package/src/system/Breadcrumbs/Breadcrumbs.test.tsx +60 -0
  52. package/src/system/Breadcrumbs/Breadcrumbs.tsx +100 -29
  53. package/src/system/Breadcrumbs/styles.ts +11 -0
  54. package/src/system/Dropdown/{Dropdown.test.js → Dropdown.test.tsx} +2 -1
  55. package/src/system/Dropdown/Dropdown.tsx +72 -0
  56. package/src/system/Dropdown/DropdownContent.tsx +46 -0
  57. package/src/system/Dropdown/DropdownItem.tsx +112 -0
  58. package/src/system/Dropdown/DropdownLabel.tsx +29 -0
  59. package/src/system/Dropdown/DropdownSeparator.tsx +28 -0
  60. package/src/system/Dropdown/{index.js → index.ts} +1 -3
  61. package/src/system/FilterDropdown/FilterDropdown.stories.tsx +57 -0
  62. package/src/system/FilterDropdown/FilterDropdown.test.tsx +52 -0
  63. package/src/system/FilterDropdown/FilterDropdown.tsx +92 -0
  64. package/src/system/Hr/Hr.stories.tsx +48 -0
  65. package/src/system/Hr/Hr.test.tsx +22 -0
  66. package/src/system/Hr/Hr.tsx +11 -0
  67. package/src/system/Link/Link.stories.tsx +42 -1
  68. package/src/system/Link/Link.tsx +17 -8
  69. package/src/system/Nav/styles.ts +1 -0
  70. package/src/system/Page/Page.test.tsx +22 -0
  71. package/src/system/Page/Page.tsx +3 -0
  72. package/src/system/index.js +4 -0
  73. package/src/system/theme/index.js +7 -8
  74. package/src/system/utils/stories/CustomLink.tsx +6 -0
  75. package/tokens/valet-core/$metadata.json +1 -17
  76. package/tokens/valet-core/$themes.json +0 -2586
  77. package/src/system/Dropdown/Dropdown.js +0 -101
  78. package/src/system/Dropdown/DropdownContent.js +0 -50
  79. package/src/system/Dropdown/DropdownItem.js +0 -108
  80. package/src/system/Dropdown/DropdownLabel.js +0 -31
  81. package/src/system/Dropdown/DropdownSeparator.js +0 -30
  82. package/tokens/valet-core/figma-parsely-web-type.json +0 -1217
  83. package/tokens/valet-core/figma-valet-web-type.json +0 -1217
  84. package/tokens/valet-core/figma-wpvip-services-web-type.json +0 -1267
  85. package/tokens/valet-core/figma-wpvip-web-type.json +0 -1213
  86. package/tokens/valet-core/parsely-web-color.json +0 -729
  87. package/tokens/valet-core/parsely-web-core.json +0 -172
  88. package/tokens/valet-core/parsely-web-type.json +0 -362
  89. package/tokens/valet-core/valet-web-color.json +0 -677
  90. package/tokens/valet-core/valet-web-core.json +0 -172
  91. package/tokens/valet-core/wpvip-services-web-color.json +0 -730
  92. package/tokens/valet-core/wpvip-services-web-core.json +0 -172
  93. package/tokens/valet-core/wpvip-services-web-type.json +0 -412
  94. package/tokens/valet-core/wpvip-web-color-dark.json +0 -735
  95. package/tokens/valet-core/wpvip-web-color.json +0 -730
  96. package/tokens/valet-core/wpvip-web-type.json +0 -412
  97. package/tokens/valet-core/wpvip-web.json +0 -1310
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const Page: (props: any) => import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.Page = void 0;
5
+ var _Box = require("../Box");
6
+ var _jsxRuntime = require("theme-ui/jsx-runtime");
7
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
8
+ var Page = exports.Page = function Page(props) {
9
+ return (0, _jsxRuntime.jsx)(_Box.Box, _extends({}, props));
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ var _react = require("@testing-library/react");
4
+ var _jestAxe = require("jest-axe");
5
+ var _themeUi = require("theme-ui");
6
+ var _Page = require("./Page");
7
+ var _theme = _interopRequireDefault(require("../theme"));
8
+ var _jsxRuntime = require("theme-ui/jsx-runtime");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
+ 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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof e + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { 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 && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
11
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
12
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } /** @jsxImportSource theme-ui */ /* eslint-disable @typescript-eslint/ban-ts-comment */ // @ts-nocheck
13
+ var renderWithTheme = function renderWithTheme(children) {
14
+ return (0, _react.render)((0, _jsxRuntime.jsx)(_themeUi.ThemeUIProvider, {
15
+ theme: _theme["default"],
16
+ children: children
17
+ }));
18
+ };
19
+ var renderComponent = function renderComponent() {
20
+ return renderWithTheme((0, _jsxRuntime.jsx)(_Page.Page, {}));
21
+ };
22
+ describe('<Page />', function () {
23
+ it('renders the Page component', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
24
+ var _renderComponent, container;
25
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
26
+ while (1) switch (_context.prev = _context.next) {
27
+ case 0:
28
+ _renderComponent = renderComponent(), container = _renderComponent.container;
29
+ _context.t0 = expect;
30
+ _context.next = 4;
31
+ return (0, _jestAxe.axe)(container);
32
+ case 4:
33
+ _context.t1 = _context.sent;
34
+ (0, _context.t0)(_context.t1).toHaveNoViolations();
35
+ case 6:
36
+ case "end":
37
+ return _context.stop();
38
+ }
39
+ }, _callee);
40
+ })));
41
+ });
@@ -26,10 +26,12 @@ import { MobileMenuTrigger } from './MobileMenu/MobileMenu';
26
26
  import { MobileMenuWrapper } from './MobileMenu/MobileMenu';
27
27
  import { NewConfirmationDialog } from './NewConfirmationDialog';
28
28
  import { Grid } from './Grid';
29
+ import { FilterDropdown } from './FilterDropdown/FilterDropdown';
29
30
  import { Flex } from './Flex';
30
31
  import { Notice } from './Notice';
31
32
  import { OptionRow } from './OptionRow';
32
33
  import { Heading } from './Heading';
34
+ import { Hr } from './Hr/Hr';
33
35
  import { Input } from './Form';
34
36
  import { Label } from './Form';
35
37
  import { Spinner } from './Spinner';
@@ -57,4 +59,4 @@ import { Validation } from './Form';
57
59
  import { Wizard } from './Wizard';
58
60
  import { WizardStep } from './Wizard';
59
61
  import theme from './theme';
60
- export { Accordion, Avatar, Badge, Box, Breadcrumbs, Button, ButtonSubmit, ButtonVariant, Card, Checkbox, Code, Dialog, NewDialog, Form, Drawer, Dropdown, DialogButton, DialogMenu, DialogMenuItem, DialogDivider, DialogContent, DialogTrigger, ConfirmationDialog, MobileMenu, MobileMenuTrigger, MobileMenuWrapper, NewConfirmationDialog, Grid, Flex, Notice, OptionRow, Heading, Input, Label, Spinner, Table, TableRow, TableCell, Tooltip, Link, LinkExternal, Radio, RadioBoxGroup, Textarea, Progress, Text, Tabs, Nav, NavItem, TabsTrigger, TabsContent, TabsList, Toggle, ToggleRow, Toolbar, Validation, Wizard, WizardStep, theme };
62
+ export { Accordion, Avatar, Badge, Box, Breadcrumbs, Button, ButtonSubmit, ButtonVariant, Card, Checkbox, Code, Dialog, NewDialog, Form, Drawer, Dropdown, DialogButton, DialogMenu, DialogMenuItem, DialogDivider, DialogContent, DialogTrigger, ConfirmationDialog, MobileMenu, MobileMenuTrigger, MobileMenuWrapper, NewConfirmationDialog, Grid, FilterDropdown, Flex, Notice, OptionRow, Heading, Hr, Input, Label, Spinner, Table, TableRow, TableCell, Tooltip, Link, LinkExternal, Radio, RadioBoxGroup, Textarea, Progress, Text, Tabs, Nav, NavItem, TabsTrigger, TabsContent, TabsList, Toggle, ToggleRow, Toolbar, Validation, Wizard, WizardStep, theme };
@@ -21,6 +21,7 @@ import {
21
21
  } from './Dialog';
22
22
  import * as Drawer from './Drawer/Drawer';
23
23
  import * as Dropdown from './Dropdown';
24
+ import { FilterDropdown } from './FilterDropdown/FilterDropdown';
24
25
  import { Flex } from './Flex';
25
26
  import {
26
27
  Input,
@@ -35,6 +36,7 @@ import {
35
36
  } from './Form';
36
37
  import { Grid } from './Grid';
37
38
  import { Heading } from './Heading';
39
+ import { Hr } from './Hr/Hr';
38
40
  import { Link } from './Link';
39
41
  import LinkExternal from './LinkExternal/LinkExternal';
40
42
  import { MobileMenuWrapper, MobileMenuTrigger, MobileMenu } from './MobileMenu/MobileMenu';
@@ -84,10 +86,12 @@ export {
84
86
  MobileMenuWrapper,
85
87
  NewConfirmationDialog,
86
88
  Grid,
89
+ FilterDropdown,
87
90
  Flex,
88
91
  Notice,
89
92
  OptionRow,
90
93
  Heading,
94
+ Hr,
91
95
  Input,
92
96
  Label,
93
97
  Spinner,