@automattic/vip-design-system 0.7.0 → 0.9.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.
Files changed (121) hide show
  1. package/.eslines.json +10 -0
  2. package/.eslintignore +7 -0
  3. package/.eslintrc.json +23 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +22 -0
  5. package/.github/workflows/codeql-analysis.yml +71 -0
  6. package/.github/workflows/nodejs.yaml +29 -0
  7. package/.prettierrc +9 -0
  8. package/.storybook/preview.js +8 -7
  9. package/README.md +52 -2
  10. package/babel.config.js +10 -10
  11. package/build/system/Avatar/Avatar.js +6 -2
  12. package/build/system/Avatar/Avatar.test.js +54 -0
  13. package/build/system/Badge/Badge.js +2 -2
  14. package/build/system/BlankState/BlankState.js +5 -4
  15. package/build/system/Button/Button.js +5 -1
  16. package/build/system/Card/Card.js +8 -5
  17. package/build/system/Code/Code.js +4 -4
  18. package/build/system/ConfirmationDialog/ConfirmationDialog.js +2 -2
  19. package/build/system/Dialog/Dialog.js +3 -0
  20. package/build/system/Dialog/DialogButton.js +2 -4
  21. package/build/system/Dialog/DialogContent.js +5 -5
  22. package/build/system/Form/Checkbox.js +52 -5
  23. package/build/system/Form/InlineSelect.js +32 -16
  24. package/build/system/Form/Input.js +9 -6
  25. package/build/system/Form/Label.js +2 -2
  26. package/build/system/Form/RadioBoxGroup.js +101 -0
  27. package/build/system/Form/SearchSelect.js +36 -56
  28. package/build/system/Form/Select.js +3 -3
  29. package/build/system/Form/Textarea.js +9 -6
  30. package/build/system/Form/Toggle.js +1 -1
  31. package/build/system/Form/ToggleGroup.js +78 -0
  32. package/build/system/Form/ToggleRow.js +6 -5
  33. package/build/system/Form/Validation.js +4 -4
  34. package/build/system/Form/index.js +8 -0
  35. package/build/system/Notice/Notice.js +58 -54
  36. package/build/system/Notification/Notification.js +4 -4
  37. package/build/system/OptionRow/OptionRow.js +12 -11
  38. package/build/system/ResourceList/ResourceItem.js +89 -0
  39. package/build/system/ResourceList/ResourceList.js +121 -0
  40. package/build/system/ResourceList/index.js +11 -0
  41. package/build/system/Table/TableRow.js +2 -2
  42. package/build/system/Tabs/TabItem.js +3 -3
  43. package/build/system/Tabs/Tabs.js +1 -1
  44. package/build/system/Time/index.js +91 -0
  45. package/build/system/Tooltip/Tooltip.js +49 -47
  46. package/build/system/Wizard/WizardStep.js +5 -5
  47. package/build/system/Wizard/WizardStepHorizontal.js +2 -2
  48. package/build/system/index.js +9 -2
  49. package/build/system/theme/colors.js +235 -131
  50. package/build/system/theme/index.js +140 -107
  51. package/package.json +48 -11
  52. package/src/system/Avatar/Avatar.js +6 -2
  53. package/src/system/Avatar/Avatar.stories.js +0 -5
  54. package/src/system/Avatar/Avatar.test.js +31 -0
  55. package/src/system/Badge/Badge.js +3 -3
  56. package/src/system/Badge/Badge.stories.js +0 -5
  57. package/src/system/BlankState/BlankState.js +5 -5
  58. package/src/system/BlankState/BlankState.stories.js +0 -5
  59. package/src/system/Box/Box.stories.js +0 -5
  60. package/src/system/Button/Button.js +6 -2
  61. package/src/system/Card/Card.js +6 -4
  62. package/src/system/Card/Card.stories.js +0 -5
  63. package/src/system/Code/Code.js +4 -4
  64. package/src/system/Code/Code.stories.js +4 -1
  65. package/src/system/ConfirmationDialog/ConfirmationDialog.js +2 -2
  66. package/src/system/ConfirmationDialog/ConfirmationDialog.stories.js +0 -5
  67. package/src/system/Dialog/Dialog.js +1 -1
  68. package/src/system/Dialog/Dialog.stories.js +0 -5
  69. package/src/system/Dialog/DialogButton.js +2 -3
  70. package/src/system/Dialog/DialogContent.js +17 -4
  71. package/src/system/Flex/Flex.stories.js +0 -5
  72. package/src/system/Form/Checkbox.js +44 -2
  73. package/src/system/Form/InlineSelect.js +30 -15
  74. package/src/system/Form/Input.js +6 -4
  75. package/src/system/Form/Input.stories.js +0 -5
  76. package/src/system/Form/Label.js +2 -2
  77. package/src/system/Form/RadioBoxGroup.js +68 -0
  78. package/src/system/Form/RadioBoxGroup.stories.js +37 -0
  79. package/src/system/Form/SearchSelect.js +35 -42
  80. package/src/system/Form/Select.js +18 -18
  81. package/src/system/Form/Select.stories.js +1 -1
  82. package/src/system/Form/Textarea.js +6 -4
  83. package/src/system/Form/Toggle.js +1 -1
  84. package/src/system/Form/ToggleGroup.js +63 -0
  85. package/src/system/Form/ToggleGroup.stories.js +34 -0
  86. package/src/system/Form/ToggleRow.js +5 -5
  87. package/src/system/Form/Validation.js +2 -2
  88. package/src/system/Form/index.js +3 -1
  89. package/src/system/Grid/Grid.stories.js +0 -5
  90. package/src/system/Heading/Heading.stories.js +0 -5
  91. package/src/system/Link/Link.stories.js +0 -5
  92. package/src/system/Notice/Notice.js +33 -28
  93. package/src/system/Notification/Notification.js +6 -6
  94. package/src/system/Notification/Notification.stories.js +0 -5
  95. package/src/system/OptionRow/OptionRow.js +37 -32
  96. package/src/system/OptionRow/OptionRow.stories.js +0 -5
  97. package/src/system/Progress/Progress.stories.js +0 -5
  98. package/src/system/ResourceList/ResourceItem.js +66 -0
  99. package/src/system/ResourceList/ResourceList.js +96 -0
  100. package/src/system/ResourceList/ResourceList.stories.js +300 -0
  101. package/src/system/ResourceList/index.js +7 -0
  102. package/src/system/Spinner/Spinner.stories.js +0 -5
  103. package/src/system/Table/Table.stories.js +0 -5
  104. package/src/system/Table/TableRow.js +3 -3
  105. package/src/system/Tabs/TabItem.js +3 -3
  106. package/src/system/Tabs/Tabs.js +1 -1
  107. package/src/system/Tabs/Tabs.stories.js +0 -5
  108. package/src/system/Text/Text.stories.js +0 -5
  109. package/src/system/{Timeline/Timeline.stories.js → Time/Time.stories.js} +5 -5
  110. package/src/system/Time/index.js +62 -0
  111. package/src/system/Tooltip/Tooltip.js +40 -35
  112. package/src/system/Tooltip/Tooltip.stories.js +0 -5
  113. package/src/system/Wizard/Wizard.js +7 -7
  114. package/src/system/Wizard/WizardStep.js +10 -10
  115. package/src/system/Wizard/WizardStepHorizontal.js +3 -3
  116. package/src/system/index.js +29 -4
  117. package/src/system/theme/colors.js +233 -129
  118. package/src/system/theme/index.js +298 -256
  119. package/test/setupAfterEnv.js +13 -0
  120. package/test/setupTests.js +4 -0
  121. package/src/system/Timeline/index.js +0 -40
package/.eslines.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "branches": {
3
+ "default": ["downgrade-unmodified-lines"]
4
+ },
5
+ "processors": {
6
+ "downgrade-unmodified-lines": {
7
+ "remote": "origin/master"
8
+ }
9
+ }
10
+ }
package/.eslintignore ADDED
@@ -0,0 +1,7 @@
1
+ .git
2
+ build
3
+ coverage
4
+ flow-typed
5
+ jest_0
6
+ node_modules
7
+ storybook-static
package/.eslintrc.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "parser": "@babel/eslint-parser",
3
+ "parserOptions": {
4
+ "babelOptions": {
5
+ "presets": ["@babel/preset-react"]
6
+ }
7
+ },
8
+ "extends": [ "wpvip" ],
9
+ "plugins": [
10
+ "react",
11
+ "jsx-a11y"
12
+ ],
13
+ "rules": {
14
+ "id-length": 0,
15
+ "react/jsx-uses-react": "off",
16
+ "react/react-in-jsx-scope": "off"
17
+ },
18
+ "settings": {
19
+ "react": {
20
+ "version": "16.4"
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,22 @@
1
+ ## Description
2
+
3
+ A few sentences describing the overall goals of the pull request. Any special considerations and decisions.
4
+
5
+ Also include any references to relevant discussions and documentation.
6
+
7
+ ## Checklist
8
+
9
+ - [ ] This PR has good automated test coverage
10
+ - [ ] The storybook for the component has been updated
11
+
12
+ ## Steps to Test
13
+
14
+ Outline the steps to test and verify the PR here.
15
+
16
+ Example:
17
+
18
+ 1. Pull down PR.
19
+ 1. `npm run dev`.
20
+ 1. Open Storybook.
21
+ 1. Eat cookies.
22
+ 1. Verify cookies are delicious.
@@ -0,0 +1,71 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ master ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ master ]
20
+ schedule:
21
+ - cron: '32 21 * * 6'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'javascript' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
37
+ # Learn more:
38
+ # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
39
+
40
+ steps:
41
+ - name: Checkout repository
42
+ uses: actions/checkout@v2
43
+
44
+ # Initializes the CodeQL tools for scanning.
45
+ - name: Initialize CodeQL
46
+ uses: github/codeql-action/init@v1
47
+ with:
48
+ languages: ${{ matrix.language }}
49
+ # If you wish to specify custom queries, you can do so here or in a config file.
50
+ # By default, queries listed here will override any specified in a config file.
51
+ # Prefix the list here with "+" to use these queries and those in the config file.
52
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
53
+
54
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55
+ # If this step fails, then you should remove it and run the build manually (see below)
56
+ - name: Autobuild
57
+ uses: github/codeql-action/autobuild@v1
58
+
59
+ # ℹ️ Command-line programs to run using the OS shell.
60
+ # 📚 https://git.io/JvXDl
61
+
62
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63
+ # and modify them (or add more) to build your code if your project
64
+ # uses a compiled language
65
+
66
+ #- run: |
67
+ # make bootstrap
68
+ # make release
69
+
70
+ - name: Perform CodeQL Analysis
71
+ uses: github/codeql-action/analyze@v1
@@ -0,0 +1,29 @@
1
+ name: Node.js CI
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+
8
+ runs-on: ubuntu-latest
9
+
10
+ timeout-minutes: 5
11
+
12
+ strategy:
13
+ matrix:
14
+ node-version: [14.x]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ with:
19
+ persist-credentials: false
20
+ - name: Use Node.js ${{ matrix.node-version }}
21
+ uses: actions/setup-node@v1
22
+ with:
23
+ node-version: ${{ matrix.node-version }}
24
+ - run: npm install -g npm@latest
25
+ - run: npm install
26
+ - run: npm run test
27
+ - run: npm run build
28
+ env:
29
+ CI: true
package/.prettierrc ADDED
@@ -0,0 +1,9 @@
1
+ arrowParens: "avoid"
2
+ bracketSpacing: true
3
+ jsxBracketSameLine: false
4
+ printWidth: 100
5
+ parenSpacing: true
6
+ semi: true
7
+ singleQuote: true
8
+ tabWidth: 2
9
+ useTabs: true
@@ -1,17 +1,15 @@
1
1
  import React from "react";
2
+ import ReactDOM from 'react-dom';
2
3
  import { ThemeProvider, useColorMode } from "theme-ui";
3
4
  import { addDecorator } from "@storybook/react";
4
- import { Box, theme, Link } from "../src/system";
5
- import Brightness2Icon from "@material-ui/icons/Brightness2";
6
- import WbSunnyIcon from "@material-ui/icons/WbSunny";
5
+ import { Button, Box, theme, Link } from "../src/system";
6
+ import axe from '@axe-core/react'
7
7
 
8
8
  const ThemeChanger = () => {
9
9
  const [colorMode, setColorMode] = useColorMode();
10
10
 
11
11
  const setDarkMode = (isDark) => setColorMode(isDark ? "dark" : "default");
12
12
 
13
- const ToggleIcon = colorMode == "dark" ? WbSunnyIcon : Brightness2Icon;
14
-
15
13
  return (
16
14
  <Link
17
15
  href="#!"
@@ -20,13 +18,16 @@ const ThemeChanger = () => {
20
18
  setDarkMode(colorMode == "dark" ? false : true);
21
19
  }}
22
20
  >
23
- <ToggleIcon sx={{ position: "fixed", right: 106, top: 36 }}>
21
+ <Button sx={{ position: "fixed", right: 106, top: 36 }}>
24
22
  Toggle
25
- </ToggleIcon>
23
+ </Button>
26
24
  </Link>
27
25
  );
28
26
  };
29
27
 
28
+
29
+ axe( React, ReactDOM, 1000 );
30
+
30
31
  addDecorator((story) => (
31
32
  <React.Fragment>
32
33
  <ThemeProvider theme={theme}>
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Design system components used throughout VIP.
4
4
 
5
+ [Storybook Components](https://vip-design-system-components.netlify.app/)
6
+
5
7
  ## Development
6
8
 
7
9
  ### Prerequisites
@@ -13,7 +15,7 @@ Make sure you have [node.js](https://nodejs.org/) and [NPM](https://docs.npmjs.c
13
15
  To get setup run the following command in the `vip-design-system` directory:
14
16
 
15
17
  ```
16
- npm install
18
+ npm install
17
19
  ```
18
20
 
19
21
  ### Watching for changes
@@ -24,4 +26,52 @@ You can build it continuously so that every time you make a change, build files
24
26
  npm run watch
25
27
  ```
26
28
 
27
- This is very useful when used together with [npm link ](https://docs.npmjs.com/cli/v7/commands/npm-link) so that, when you are working on another project that depends on this design system, you can make changes here and changes will be immediately availabe there.
29
+ ### Testing
30
+
31
+ We can test two ways:
32
+
33
+ **Storybook**
34
+
35
+ For components that include storybooks, we can run `npm run storybook` to view the components in a sandbox-ed storybook environment.
36
+
37
+ **npm link**
38
+
39
+ 1. Run `npm link` in your checkout of this repo.
40
+ 2. Spin up a local copy of [the VIP Dashboard](https://github.com/automattic/vip-ui) and navigate to a page using the linked components from `@automattic/vip-design-system`
41
+
42
+ Note: it's super useful to run `npm run watch` in another process, so any changes will be almost immediately available / testable.
43
+
44
+ ### Publish NPM Package Instructions
45
+
46
+ Once all the changes needed are merged to master, and you are ready to release a new version, follow these steps:
47
+
48
+ 1. Make sure you have NPM access to our @automattic organization. Ask for #vip-platform-pâtisserie help in case you need it.
49
+ 2. Pull all the changes to your local master. Make sure you have the latest master locally.
50
+ 3. We follow the [https://semver.org/](https://semver.org/) versioning. You should run the specific version you are trying to publish:
51
+
52
+ ```bash
53
+ npm version major|minor|patch
54
+ ```
55
+
56
+ 4. You should see a version bump in the `package.json` file.
57
+ 5. Build the application:
58
+
59
+ ```bash
60
+ npm run build
61
+ ```
62
+
63
+ 6. Publish the application
64
+ ```
65
+ npm publish
66
+ ```
67
+
68
+ Note: You need to have two-factor enabled in your npm account. The publish command will request a two-factor code to complete the publishing process.
69
+
70
+ 7. Push the tags to the repository and master updates.
71
+
72
+ ```
73
+ git push --tags
74
+ git push origin master
75
+ ```
76
+
77
+ 8. For major versions or breaking changes, it's recommended to [create a RELEASE](https://github.com/Automattic/vip-design-system/releases) with the published tag.
package/babel.config.js CHANGED
@@ -1,20 +1,20 @@
1
1
  module.exports = {
2
- "ignore": [
3
- "**/*.stories.js"
2
+ ignore: [
3
+ '**/*.stories.js',
4
4
  ],
5
- "presets": [
5
+ presets: [
6
6
  [
7
- "@babel/preset-env",
7
+ '@babel/preset-env',
8
8
  {
9
- "loose": true
10
- }
9
+ loose: true,
10
+ },
11
11
  ],
12
12
  [
13
- "@babel/preset-react",
13
+ '@babel/preset-react',
14
14
  {
15
- "importSource": "theme-ui",
16
- "runtime": "automatic",
17
- "throwIfNamespace": false,
15
+ importSource: 'theme-ui',
16
+ runtime: 'automatic',
17
+ throwIfNamespace: false,
18
18
  },
19
19
  ],
20
20
  ],
@@ -40,7 +40,10 @@ var Avatar = function Avatar(_ref) {
40
40
  border: '2px solid',
41
41
  borderColor: isVIP ? 'primary' : 'transparent',
42
42
  overflow: 'hidden',
43
- backgroundColor: 'white',
43
+ backgroundColor: 'primary',
44
+ display: 'inline-flex',
45
+ alignItems: 'center',
46
+ justifyContent: 'center',
44
47
  color: 'white',
45
48
  padding: '1px',
46
49
  textAlign: 'center'
@@ -48,7 +51,7 @@ var Avatar = function Avatar(_ref) {
48
51
  }, props, {
49
52
  children: src ? (0, _jsxRuntime.jsx)(_themeUi.Image, {
50
53
  src: src,
51
- alt: name,
54
+ alt: "Avatar image from " + name,
52
55
  sx: {
53
56
  borderRadius: 9999,
54
57
  width: '100%',
@@ -58,6 +61,7 @@ var Avatar = function Avatar(_ref) {
58
61
  as: "span",
59
62
  sx: {
60
63
  color: 'white',
64
+ mb: 0,
61
65
  fontWeight: 'bold',
62
66
  fontSize: 0,
63
67
  textTransform: 'uppercase'
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ var _react = require("@testing-library/react");
4
+
5
+ var _jestAxe = require("jest-axe");
6
+
7
+ var _Avatar = require("./Avatar");
8
+
9
+ var _jsxRuntime = require("theme-ui/jsx-runtime");
10
+
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
+
13
+ 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); }); }; }
14
+
15
+ describe('<Avatar />', function () {
16
+ it('renders the Avatar without an image', function () {
17
+ (0, _react.render)((0, _jsxRuntime.jsx)(_Avatar.Avatar, {
18
+ name: "John Doe"
19
+ }));
20
+ expect(_react.screen.getByText('J')).toBeInTheDocument();
21
+ });
22
+ it('renders the Avatar with image', function () {
23
+ (0, _react.render)((0, _jsxRuntime.jsx)(_Avatar.Avatar, {
24
+ name: "John Doe",
25
+ src: "path/to/image"
26
+ }));
27
+ expect(_react.screen.getByAltText('Avatar image from John Doe')).toBeInTheDocument();
28
+ });
29
+ it('should not have basic accessibility issues', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
30
+ var _render, container, results;
31
+
32
+ return regeneratorRuntime.wrap(function _callee$(_context) {
33
+ while (1) {
34
+ switch (_context.prev = _context.next) {
35
+ case 0:
36
+ _render = (0, _react.render)((0, _jsxRuntime.jsx)(_Avatar.Avatar, {
37
+ name: "John Doe",
38
+ src: "path/to/image"
39
+ })), container = _render.container;
40
+ _context.next = 3;
41
+ return (0, _jestAxe.axe)(container);
42
+
43
+ case 3:
44
+ results = _context.sent;
45
+ expect(results).toHaveNoViolations();
46
+
47
+ case 5:
48
+ case "end":
49
+ return _context.stop();
50
+ }
51
+ }
52
+ }, _callee);
53
+ })));
54
+ });
@@ -28,8 +28,8 @@ var Badge = function Badge(_ref) {
28
28
  sx: _extends({
29
29
  fontSize: 0,
30
30
  padding: 0,
31
- bg: variant + ".10",
32
- color: variant + ".90",
31
+ bg: variant + ".20",
32
+ color: variant + ".100",
33
33
  py: 1,
34
34
  verticalAlign: 'middle',
35
35
  px: 2,
@@ -35,7 +35,8 @@ var BlankState = function BlankState(_ref) {
35
35
  src: image,
36
36
  sx: {
37
37
  mb: 3
38
- }
38
+ },
39
+ alt: "Icon representing the blank state"
39
40
  }), (0, _jsxRuntime.jsx)(_.Heading, {
40
41
  variant: "h4",
41
42
  children: title
@@ -52,9 +53,9 @@ var BlankState = function BlankState(_ref) {
52
53
 
53
54
  exports.BlankState = BlankState;
54
55
  BlankState.propTypes = {
55
- image: _propTypes["default"].string,
56
+ image: _propTypes["default"].oneOfType([_propTypes["default"].object, _propTypes["default"].string]),
56
57
  icon: _propTypes["default"].node,
57
- title: _propTypes["default"].string,
58
- body: _propTypes["default"].string,
58
+ title: _propTypes["default"].node,
59
+ body: _propTypes["default"].node,
59
60
  cta: _propTypes["default"].node
60
61
  };
@@ -24,7 +24,11 @@ var Button = function Button(_ref) {
24
24
  return (0, _jsxRuntime.jsx)(_themeUi.Button, _extends({
25
25
  sx: _extends({
26
26
  verticalAlign: 'middle',
27
- display: 'inline-block',
27
+ display: 'inline-flex',
28
+ alignItems: 'center',
29
+ justifyContent: 'center',
30
+ height: '36px',
31
+ py: 0,
28
32
  '&:disabled': {
29
33
  opacity: 0.5,
30
34
  cursor: 'not-allowed',
@@ -19,7 +19,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
19
19
 
20
20
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
21
21
 
22
- var Card = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
22
+ var CardComponent = function CardComponent(_ref, ref) {
23
23
  var _ref$variant = _ref.variant,
24
24
  variant = _ref$variant === void 0 ? 'primary' : _ref$variant,
25
25
  _ref$sx = _ref.sx,
@@ -34,10 +34,13 @@ var Card = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
34
34
  overflow: 'hidden'
35
35
  }, sx)
36
36
  }, props));
37
- });
37
+ };
38
38
 
39
- exports.Card = Card;
40
- Card.propTypes = {
39
+ CardComponent.propTypes = {
41
40
  variant: _propTypes["default"].string,
42
41
  sx: _propTypes["default"].object
43
- };
42
+ };
43
+
44
+ var Card = /*#__PURE__*/_react["default"].forwardRef(CardComponent);
45
+
46
+ exports.Card = Card;
@@ -34,9 +34,9 @@ var Code = function Code(_ref) {
34
34
  sx: {
35
35
  fontSize: 1,
36
36
  display: 'block',
37
- bg: 'modes.dark.card',
38
- color: 'modes.dark.heading',
39
- borderRadius: 2,
37
+ bg: 'grey.90',
38
+ color: 'grey.10',
39
+ borderRadius: 1,
40
40
  py: 2,
41
41
  px: 3,
42
42
  verticalAlign: 'middle',
@@ -65,7 +65,7 @@ var Code = function Code(_ref) {
65
65
  sx: {
66
66
  position: 'absolute',
67
67
  top: 0,
68
- bg: 'modes.dark.heading',
68
+ bg: 'grey.10',
69
69
  right: 0,
70
70
  paddingRight: 2,
71
71
  paddingLeft: 2,
@@ -62,8 +62,8 @@ var ConfirmationDialogContent = function ConfirmationDialogContent(_ref) {
62
62
 
63
63
  exports.ConfirmationDialogContent = ConfirmationDialogContent;
64
64
  ConfirmationDialogContent.propTypes = {
65
- title: _propTypes["default"].string,
66
- body: _propTypes["default"].string,
65
+ title: _propTypes["default"].node,
66
+ body: _propTypes["default"].node,
67
67
  label: _propTypes["default"].string,
68
68
  onClose: _propTypes["default"].func,
69
69
  onConfirm: _propTypes["default"].func
@@ -74,6 +74,9 @@ var Dialog = function Dialog(_ref) {
74
74
  };
75
75
 
76
76
  return (0, _jsxRuntime.jsxs)("div", {
77
+ onClick: function onClick(e) {
78
+ return e.stopPropagation();
79
+ },
77
80
  sx: {
78
81
  position: 'relative'
79
82
  },
@@ -5,8 +5,6 @@ exports.DialogButton = void 0;
5
5
 
6
6
  var _propTypes = _interopRequireDefault(require("prop-types"));
7
7
 
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _md = require("react-icons/md");
11
9
 
12
10
  var _ = require("../");
@@ -54,10 +52,10 @@ var DialogButton = function DialogButton(_ref) {
54
52
  sx: {
55
53
  mb: 0,
56
54
  flex: '1 1 auto',
57
- 'white-space': 'nowrap',
55
+ whiteSpace: 'nowrap',
58
56
  overflow: 'hidden',
59
57
  color: 'heading',
60
- 'text-overflow': 'ellipsis'
58
+ textOverflow: 'ellipsis'
61
59
  },
62
60
  children: value
63
61
  }), (0, _jsxRuntime.jsx)(_md.MdExpandMore, {
@@ -57,8 +57,8 @@ var DialogContent = function DialogContent(_ref) {
57
57
  left: 0,
58
58
  right: 0,
59
59
  bottom: 0,
60
- backgroundColor: 'grey.50',
61
- opacity: 0.7
60
+ opacity: 0.7,
61
+ background: "linear-gradient(\n\t\t\t\t\t\t\t198.09deg,\n\t\t\t\t\t\t\t#E5F0F6 2.01%,\n\t\t\t\t\t\t\trgba(235, 238, 242, 0) 43.18%,\n\t\t\t\t\t\t\trgba(249, 234, 232, 0) 47.86%,\n\t\t\t\t\t\t\t#FFE9D1 94.31%\n\t\t\t\t\t\t),\n\t\t\t\t\t\tlinear-gradient(\n\t\t\t\t\t\t\t98.65deg,\n\t\t\t\t\t\t\t#FFE8E6 0.58%,\n\t\t\t\t\t\t\trgba(255, 233, 214, 0) 52.45%,\n\t\t\t\t\t\t\trgba(255, 233, 219, 0) 53.76%,\n\t\t\t\t\t\t\t#FFE9D1 105.86%\n\t\t\t\t\t\t), #F5F2F1"
62
62
  }
63
63
  }), variant === 'sidebar' ? (0, _jsxRuntime.jsx)(SidebarMotion, _extends({}, props)) : (0, _jsxRuntime.jsx)(DialogMotion, _extends({
64
64
  position: position,
@@ -89,8 +89,8 @@ var SidebarMotion = function SidebarMotion(props) {
89
89
  sx: {
90
90
  marginTop: 2,
91
91
  borderRadius: 2,
92
- backgroundColor: 'card',
93
- boxShadow: 'low',
92
+ backgroundColor: 'dialog',
93
+ boxShadow: 'medium',
94
94
  position: 'absolute',
95
95
  top: '100%',
96
96
  zIndex: 100,
@@ -138,7 +138,7 @@ var DialogMotion = function DialogMotion(_ref2) {
138
138
  marginTop: 2,
139
139
  transformOrigin: transformOrigin,
140
140
  borderRadius: 2,
141
- backgroundColor: 'card',
141
+ backgroundColor: 'dialog',
142
142
  boxShadow: 'low',
143
143
  position: 'absolute',
144
144
  top: '100%',
@@ -3,30 +3,77 @@
3
3
  exports.__esModule = true;
4
4
  exports.Checkbox = void 0;
5
5
 
6
- var _themeUi = require("theme-ui");
6
+ var CheckboxPrimitive = _interopRequireWildcard(require("@radix-ui/react-checkbox"));
7
7
 
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
+ var _md = require("react-icons/md");
11
+
10
12
  var _jsxRuntime = require("theme-ui/jsx-runtime");
11
13
 
12
14
  var _excluded = ["disabled"];
13
15
 
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
17
 
16
- function _extends() { _extends = Object.assign || 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); }
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
21
 
18
22
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
19
23
 
24
+ function _extends() { _extends = Object.assign || 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); }
25
+
26
+ var StyledCheckbox = function StyledCheckbox(props) {
27
+ return (0, _jsxRuntime.jsx)(CheckboxPrimitive.Root, _extends({
28
+ sx: {
29
+ all: 'unset',
30
+ backgroundColor: 'grey.10',
31
+ width: 16,
32
+ height: 16,
33
+ borderRadius: 1,
34
+ display: 'flex',
35
+ alignItems: 'center',
36
+ justifyContent: 'center',
37
+ '&:hover': {
38
+ backgroundColor: 'grey.20'
39
+ },
40
+ '&:focus': {
41
+ boxShadow: '0 0 0 2px black'
42
+ },
43
+ '&[data-state=checked]': {
44
+ backgroundColor: 'primary',
45
+ color: 'brand.0'
46
+ },
47
+ svg: {
48
+ display: 'block'
49
+ }
50
+ }
51
+ }, props));
52
+ };
53
+
54
+ var StyledIndicator = function StyledIndicator(props) {
55
+ return (0, _jsxRuntime.jsx)(CheckboxPrimitive.Indicator, _extends({
56
+ sx: {
57
+ color: 'brand.0'
58
+ }
59
+ }, props));
60
+ };
61
+
20
62
  var Checkbox = function Checkbox(_ref) {
21
63
  var disabled = _ref.disabled,
22
64
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
23
65
 
24
- return (0, _jsxRuntime.jsx)(_themeUi.Checkbox, _extends({
66
+ return (0, _jsxRuntime.jsx)(StyledCheckbox, _extends({
25
67
  sx: {
26
- opacity: disabled ? 0.4 : 1
68
+ opacity: disabled ? 0.4 : 1,
69
+ border: 'none'
27
70
  },
28
71
  disabled: disabled
29
- }, props));
72
+ }, props, {
73
+ children: (0, _jsxRuntime.jsx)(StyledIndicator, {
74
+ children: (0, _jsxRuntime.jsx)(_md.MdDone, {})
75
+ })
76
+ }));
30
77
  };
31
78
 
32
79
  exports.Checkbox = Checkbox;