@automattic/vip-design-system 0.7.1 → 0.9.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/.eslines.json +10 -0
- package/.eslintignore +7 -0
- package/.eslintrc.json +23 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +22 -0
- package/.github/workflows/codeql-analysis.yml +71 -0
- package/.github/workflows/nodejs.yaml +29 -0
- package/.prettierrc +9 -0
- package/.storybook/preview.js +8 -7
- package/README.md +52 -2
- package/babel.config.js +10 -10
- package/build/system/Avatar/Avatar.js +5 -1
- package/build/system/Avatar/Avatar.test.js +54 -0
- package/build/system/Badge/Badge.js +2 -2
- package/build/system/BlankState/BlankState.js +5 -4
- package/build/system/Button/Button.js +5 -1
- package/build/system/Card/Card.js +2 -1
- package/build/system/Code/Code.js +4 -4
- package/build/system/ConfirmationDialog/ConfirmationDialog.js +1 -1
- package/build/system/Dialog/DialogButton.js +2 -4
- package/build/system/Dialog/DialogContent.js +5 -5
- package/build/system/Form/InlineSelect.js +28 -16
- package/build/system/Form/Input.js +3 -2
- package/build/system/Form/Label.js +2 -2
- package/build/system/Form/RadioBoxGroup.js +0 -2
- package/build/system/Form/SearchSelect.js +36 -56
- package/build/system/Form/Select.js +3 -3
- package/build/system/Form/Textarea.js +3 -2
- package/build/system/Form/Toggle.js +1 -1
- package/build/system/Form/ToggleGroup.js +0 -4
- package/build/system/Form/ToggleRow.js +5 -4
- package/build/system/Form/Validation.js +4 -4
- package/build/system/Notice/Notice.js +58 -54
- package/build/system/Notification/Notification.js +3 -3
- package/build/system/OptionRow/OptionRow.js +11 -10
- package/build/system/ResourceList/ResourceItem.js +89 -0
- package/build/system/ResourceList/ResourceList.js +121 -0
- package/build/system/ResourceList/index.js +11 -0
- package/build/system/Table/TableRow.js +1 -1
- package/build/system/Tabs/TabItem.js +2 -2
- package/build/system/Tabs/Tabs.js +1 -1
- package/build/system/Time/index.js +91 -0
- package/build/system/Tooltip/Tooltip.js +49 -47
- package/build/system/Wizard/WizardStep.js +4 -4
- package/build/system/Wizard/WizardStepHorizontal.js +2 -2
- package/build/system/index.js +7 -2
- package/build/system/theme/colors.js +235 -131
- package/build/system/theme/index.js +128 -107
- package/package.json +48 -13
- package/src/system/Avatar/Avatar.js +5 -1
- package/src/system/Avatar/Avatar.stories.js +0 -5
- package/src/system/Avatar/Avatar.test.js +31 -0
- package/src/system/Badge/Badge.js +3 -3
- package/src/system/Badge/Badge.stories.js +0 -5
- package/src/system/BlankState/BlankState.js +5 -5
- package/src/system/BlankState/BlankState.stories.js +0 -5
- package/src/system/Box/Box.stories.js +0 -5
- package/src/system/Button/Button.js +6 -2
- package/src/system/Card/Card.js +16 -12
- package/src/system/Card/Card.stories.js +0 -5
- package/src/system/Code/Code.js +4 -4
- package/src/system/Code/Code.stories.js +4 -1
- package/src/system/ConfirmationDialog/ConfirmationDialog.js +1 -1
- package/src/system/ConfirmationDialog/ConfirmationDialog.stories.js +0 -5
- package/src/system/Dialog/Dialog.stories.js +0 -5
- package/src/system/Dialog/DialogButton.js +2 -3
- package/src/system/Dialog/DialogContent.js +17 -4
- package/src/system/Flex/Flex.stories.js +0 -5
- package/src/system/Form/InlineSelect.js +28 -15
- package/src/system/Form/Input.js +3 -1
- package/src/system/Form/Input.stories.js +0 -5
- package/src/system/Form/Label.js +2 -2
- package/src/system/Form/RadioBoxGroup.js +1 -2
- package/src/system/Form/RadioBoxGroup.stories.js +4 -5
- package/src/system/Form/SearchSelect.js +35 -42
- package/src/system/Form/Select.js +18 -18
- package/src/system/Form/Select.stories.js +1 -1
- package/src/system/Form/Textarea.js +3 -1
- package/src/system/Form/Toggle.js +1 -1
- package/src/system/Form/ToggleGroup.js +34 -37
- package/src/system/Form/ToggleGroup.stories.js +30 -32
- package/src/system/Form/ToggleRow.js +4 -4
- package/src/system/Form/Validation.js +2 -2
- package/src/system/Grid/Grid.stories.js +0 -5
- package/src/system/Heading/Heading.stories.js +0 -5
- package/src/system/Link/Link.stories.js +0 -5
- package/src/system/Notice/Notice.js +33 -28
- package/src/system/Notification/Notification.js +5 -5
- package/src/system/Notification/Notification.stories.js +0 -5
- package/src/system/OptionRow/OptionRow.js +36 -31
- package/src/system/OptionRow/OptionRow.stories.js +0 -5
- package/src/system/Progress/Progress.stories.js +0 -5
- package/src/system/ResourceList/ResourceItem.js +66 -0
- package/src/system/ResourceList/ResourceList.js +96 -0
- package/src/system/ResourceList/ResourceList.stories.js +300 -0
- package/src/system/ResourceList/index.js +7 -0
- package/src/system/Spinner/Spinner.stories.js +0 -5
- package/src/system/Table/Table.stories.js +0 -5
- package/src/system/Table/TableRow.js +2 -2
- package/src/system/Tabs/TabItem.js +2 -2
- package/src/system/Tabs/Tabs.js +1 -1
- package/src/system/Tabs/Tabs.stories.js +0 -5
- package/src/system/Text/Text.stories.js +0 -5
- package/src/system/{Timeline/Timeline.stories.js → Time/Time.stories.js} +5 -5
- package/src/system/Time/index.js +62 -0
- package/src/system/Tooltip/Tooltip.js +40 -35
- package/src/system/Tooltip/Tooltip.stories.js +0 -5
- package/src/system/Wizard/Wizard.js +7 -7
- package/src/system/Wizard/WizardStep.js +9 -9
- package/src/system/Wizard/WizardStepHorizontal.js +3 -3
- package/src/system/index.js +27 -4
- package/src/system/theme/colors.js +233 -129
- package/src/system/theme/index.js +290 -260
- package/test/setupAfterEnv.js +13 -0
- package/test/setupTests.js +4 -0
- package/src/system/Timeline/index.js +0 -40
package/.eslines.json
ADDED
package/.eslintignore
ADDED
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
package/.storybook/preview.js
CHANGED
|
@@ -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
|
|
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
|
-
<
|
|
21
|
+
<Button sx={{ position: "fixed", right: 106, top: 36 }}>
|
|
24
22
|
Toggle
|
|
25
|
-
</
|
|
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
|
-
|
|
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
|
-
|
|
3
|
-
|
|
2
|
+
ignore: [
|
|
3
|
+
'**/*.stories.js',
|
|
4
4
|
],
|
|
5
|
-
|
|
5
|
+
presets: [
|
|
6
6
|
[
|
|
7
|
-
|
|
7
|
+
'@babel/preset-env',
|
|
8
8
|
{
|
|
9
|
-
|
|
10
|
-
}
|
|
9
|
+
loose: true,
|
|
10
|
+
},
|
|
11
11
|
],
|
|
12
12
|
[
|
|
13
|
-
|
|
13
|
+
'@babel/preset-react',
|
|
14
14
|
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
importSource: 'theme-ui',
|
|
16
|
+
runtime: 'automatic',
|
|
17
|
+
throwIfNamespace: false,
|
|
18
18
|
},
|
|
19
19
|
],
|
|
20
20
|
],
|
|
@@ -41,6 +41,9 @@ var Avatar = function Avatar(_ref) {
|
|
|
41
41
|
borderColor: isVIP ? 'primary' : 'transparent',
|
|
42
42
|
overflow: 'hidden',
|
|
43
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
|
+
});
|
|
@@ -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"].
|
|
58
|
-
body: _propTypes["default"].
|
|
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-
|
|
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',
|
|
@@ -34,9 +34,9 @@ var Code = function Code(_ref) {
|
|
|
34
34
|
sx: {
|
|
35
35
|
fontSize: 1,
|
|
36
36
|
display: 'block',
|
|
37
|
-
bg: '
|
|
38
|
-
color: '
|
|
39
|
-
borderRadius:
|
|
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: '
|
|
68
|
+
bg: 'grey.10',
|
|
69
69
|
right: 0,
|
|
70
70
|
paddingRight: 2,
|
|
71
71
|
paddingLeft: 2,
|
|
@@ -62,7 +62,7 @@ var ConfirmationDialogContent = function ConfirmationDialogContent(_ref) {
|
|
|
62
62
|
|
|
63
63
|
exports.ConfirmationDialogContent = ConfirmationDialogContent;
|
|
64
64
|
ConfirmationDialogContent.propTypes = {
|
|
65
|
-
title: _propTypes["default"].
|
|
65
|
+
title: _propTypes["default"].node,
|
|
66
66
|
body: _propTypes["default"].node,
|
|
67
67
|
label: _propTypes["default"].string,
|
|
68
68
|
onClose: _propTypes["default"].func,
|
|
@@ -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
|
-
|
|
55
|
+
whiteSpace: 'nowrap',
|
|
58
56
|
overflow: 'hidden',
|
|
59
57
|
color: 'heading',
|
|
60
|
-
|
|
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
|
-
|
|
61
|
-
|
|
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: '
|
|
93
|
-
boxShadow: '
|
|
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: '
|
|
141
|
+
backgroundColor: 'dialog',
|
|
142
142
|
boxShadow: 'low',
|
|
143
143
|
position: 'absolute',
|
|
144
144
|
top: '100%',
|
|
@@ -28,8 +28,7 @@ var selectStyles = {
|
|
|
28
28
|
margin: 0,
|
|
29
29
|
border: 0,
|
|
30
30
|
padding: 0,
|
|
31
|
-
boxShadow: 'none'
|
|
32
|
-
fontSize: _.theme.fontSizes[2]
|
|
31
|
+
boxShadow: 'none'
|
|
33
32
|
});
|
|
34
33
|
},
|
|
35
34
|
container: function container(provided) {
|
|
@@ -52,7 +51,7 @@ var selectStyles = {
|
|
|
52
51
|
menu: function menu() {
|
|
53
52
|
return {
|
|
54
53
|
boxShadow: 'none',
|
|
55
|
-
borderTop:
|
|
54
|
+
borderTop: '1px solid'
|
|
56
55
|
};
|
|
57
56
|
}
|
|
58
57
|
};
|
|
@@ -64,7 +63,7 @@ var InlineSelect = function InlineSelect(_ref) {
|
|
|
64
63
|
_ref$noneLabel = _ref.noneLabel,
|
|
65
64
|
noneLabel = _ref$noneLabel === void 0 ? 'All' : _ref$noneLabel,
|
|
66
65
|
_ref$position = _ref.position,
|
|
67
|
-
position = _ref$position === void 0 ?
|
|
66
|
+
position = _ref$position === void 0 ? 'left' : _ref$position,
|
|
68
67
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
69
68
|
|
|
70
69
|
var valueLabel = noneLabel;
|
|
@@ -92,22 +91,35 @@ var InlineSelect = function InlineSelect(_ref) {
|
|
|
92
91
|
hideSelectedOptions: false,
|
|
93
92
|
isClearable: false,
|
|
94
93
|
menuIsOpen: true,
|
|
95
|
-
options: options,
|
|
96
94
|
styles: selectStyles,
|
|
95
|
+
classNamePrefix: 'select',
|
|
96
|
+
options: options,
|
|
97
97
|
placeholder: "Search...",
|
|
98
98
|
tabSelectsValue: false,
|
|
99
|
-
value: value
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
99
|
+
value: value,
|
|
100
|
+
sx: {
|
|
101
|
+
'.select__control': {
|
|
102
|
+
background: 'none',
|
|
103
|
+
color: 'heading'
|
|
104
|
+
},
|
|
105
|
+
'.select__single-value': {
|
|
106
|
+
color: 'heading',
|
|
107
|
+
px: 1
|
|
108
|
+
},
|
|
109
|
+
'.react-select__option': {
|
|
110
|
+
bg: 'grey.10',
|
|
111
|
+
'&:hover': {
|
|
112
|
+
bg: 'grey.10'
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
'.select__option--is-focused': {
|
|
116
|
+
bg: 'grey.10'
|
|
117
|
+
},
|
|
118
|
+
'.select__menu': {
|
|
119
|
+
borderColor: 'border'
|
|
120
|
+
}
|
|
109
121
|
}
|
|
110
|
-
}))
|
|
122
|
+
}, props))
|
|
111
123
|
});
|
|
112
124
|
return (0, _jsxRuntime.jsx)(_.Dialog, {
|
|
113
125
|
content: Content,
|
|
@@ -38,7 +38,7 @@ var Input = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
38
38
|
required: required,
|
|
39
39
|
sx: {
|
|
40
40
|
border: '1px solid',
|
|
41
|
-
borderColor: '
|
|
41
|
+
borderColor: 'grey.60',
|
|
42
42
|
backgroundColor: 'card',
|
|
43
43
|
borderRadius: 1,
|
|
44
44
|
lineHeight: 'inherit',
|
|
@@ -74,4 +74,5 @@ Input.propTypes = {
|
|
|
74
74
|
required: _propTypes["default"].bool,
|
|
75
75
|
forLabel: _propTypes["default"].string,
|
|
76
76
|
errorMessage: _propTypes["default"].string
|
|
77
|
-
};
|
|
77
|
+
};
|
|
78
|
+
Input.displayName = 'Input';
|
|
@@ -11,12 +11,12 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
11
11
|
|
|
12
12
|
var Label = function Label(props) {
|
|
13
13
|
return (0, _jsxRuntime.jsx)(_.Heading, _extends({
|
|
14
|
-
variant: "
|
|
14
|
+
variant: "h4",
|
|
15
15
|
as: "label",
|
|
16
16
|
sx: {
|
|
17
17
|
display: 'block',
|
|
18
18
|
mb: 2,
|
|
19
|
-
color: '
|
|
19
|
+
color: 'muted'
|
|
20
20
|
}
|
|
21
21
|
}, props));
|
|
22
22
|
};
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.RadioBoxGroup = void 0;
|
|
5
5
|
|
|
6
|
-
var _react = _interopRequireDefault(require("react"));
|
|
7
|
-
|
|
8
6
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
7
|
|
|
10
8
|
var RadioGroupPrimitive = _interopRequireWildcard(require("@radix-ui/react-radio-group"));
|