Skip to content

Commit 47fbf88

Browse files
authored
Add components (#14)
* Add number-field * Refactor base field styles * Apply common field style to search * Set outline only in focus mode * Add checkbox * Add combobox * Add data grid * Add toolbar * Add anchored region * Add tooltip * Add tree item * Add tree view * Compiles src manually for playwright * Fix manifest * Add react components * Rename snapshot folders to match pretranspiled playwright tests * Remove visual test timeout * Correct path to snapshots * Update snapshots * Fix combobox test url * Place snapshots in the correct folders * Fix tooltip test * Don't include playwright snapshot in python package * Add tooltip snapshots
1 parent 1b92f95 commit 47fbf88

File tree

407 files changed

+2995
-447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

407 files changed

+2995
-447
lines changed

.github/workflows/visual-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
visual-test:
1111
runs-on: ubuntu-latest
12-
timeout-minutes: 40
12+
timeout-minutes: 60
1313
steps:
1414
- name: Checkout 🛎️
1515
uses: actions/checkout@v2
@@ -55,4 +55,4 @@ jobs:
5555
name: jupyter-ui-test
5656
path: |
5757
packages/components/test-assets/
58-
packages/components/src/**/*-snapshots/*
58+
packages/components/tests-out/**/*-snapshots/*

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,5 @@ temp
132132
# Visual testing
133133
packages/components/test-results
134134
lerna-debug.log
135+
packages/components/tests-out/**/*.js
136+
packages/components/tests-out/**/*.js.map

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ include packages/components/playwright.config.ts
2020
include packages/components/rollup.config.js
2121
include packages/components/tsconfigbase.json
2222
include packages/components/tsconfig.json
23+
include packages/components/tsconfig.playwright.json
2324
include packages/components/tsconfig.storybook.json
2425
graft packages/components/.storybook
2526
graft packages/components/docs
2627
graft packages/components/src
28+
prune packages/components/tests-out
2729
include packages/react-components/README.md
2830
include packages/react-components/package.json
2931
include packages/react-components/tsconfig.json

packages/components/.storybook/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
core: {
33
builder: 'webpack5'
44
},
5-
stories: ['../src/**/*.stories.ts'],
5+
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.ts'],
66
addons: [
77
'@storybook/addon-links',
88
'@storybook/addon-essentials',
Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
<style>
2-
html,
3-
body {
4-
margin: 0;
5-
display: flex;
6-
flex-direction: column;
7-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
8-
Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
9-
'Segoe UI Symbol';
10-
}
2+
html,
3+
body {
4+
margin: 0;
5+
display: flex;
6+
flex-direction: column;
7+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
8+
Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
9+
'Segoe UI Symbol';
10+
}
1111

12-
#root {
13-
display: flex;
14-
width: 100%;
15-
}
12+
#root {
13+
display: flex;
14+
width: 100%;
15+
}
1616

17-
/* For testing reaction to JupyterLab theme */
18-
:root {
19-
--jp-brand-color1: var(--md-blue-700);
20-
--jp-border-width: 1px;
21-
--jp-border-color1: var(--md-grey-400);
22-
--jp-ui-font-size1: 13px;
23-
--md-grey-400: #78909C;
24-
--md-blue-700: #1976D2;
25-
}
17+
#root>jp-tree-item,
18+
#root>jp-tree-view {
19+
flex: 1 1 auto;
20+
}
21+
22+
/* For testing reaction to JupyterLab theme */
23+
:root {
24+
--jp-brand-color1: var(--md-blue-700);
25+
--jp-border-width: 1px;
26+
--jp-border-color1: var(--md-grey-400);
27+
--jp-ui-font-size1: 13px;
28+
--md-grey-400: #78909C;
29+
--md-blue-700: #1976D2;
30+
}
2631
</style>

packages/components/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
"start:ci": "start-storybook -p 6006 --ci --quiet",
2727
"build": "rollup -c && tsc -p ./tsconfig.json",
2828
"build:docs": "build-storybook",
29+
"clean": "yarn clean:lib && yarn clean:test",
30+
"clean:lib": "rimraf dist",
31+
"clean:test": "rimraf test-results tests-out/**/*.js tests-out/**/*.js.map tsconfig.playwright.tsbuildinfo",
2932
"deploy:docs": "yarn run build:docs && gh-pages -d storybook-static",
3033
"doc": "api-extractor run --local",
3134
"prettier:check": "prettier --config ../../.prettierrc --check \"src/**/*.ts\"",
@@ -34,13 +37,14 @@
3437
"eslint": "eslint . --ext .ts --fix",
3538
"prepublishOnly": "rimraf README.md && cp ../../README.md . && yarn run build",
3639
"test": "jest --verbose --coverage",
37-
"test:visual": "playwright test"
40+
"test:visual": "tsc --incremental -p tsconfig.playwright.json && playwright test"
3841
},
3942
"dependencies": {
4043
"@microsoft/fast-colors": "^5.1.4",
4144
"@microsoft/fast-components": "^2.17.1",
4245
"@microsoft/fast-element": "^1.6.0",
43-
"@microsoft/fast-foundation": "^2.21.0"
46+
"@microsoft/fast-foundation": "^2.21.0",
47+
"@microsoft/fast-web-utilities": "^5.1.0"
4448
},
4549
"devDependencies": {
4650
"@fortawesome/fontawesome-svg-core": "^1.2.36",
@@ -71,6 +75,7 @@
7175
"gh-pages": "^3.1.0",
7276
"jest": "^27.2.4",
7377
"prettier": "^2.2.1",
78+
"rimraf": "^3.0.2",
7479
"rollup": "^2.40.0",
7580
"rollup-plugin-delete": "^2.0.0",
7681
"rollup-plugin-filesize": "^9.1.1",

packages/components/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { PlaywrightTestConfig, devices } from '@playwright/test';
33
const config: PlaywrightTestConfig = {
44
forbidOnly: !!process.env.CI,
55
retries: process.env.CI ? 2 : 0,
6-
testMatch: '**/*.test.ts',
6+
testMatch: 'tests-out/**/*.test.js',
77
webServer: {
88
command: 'yarn run start:ci',
99
port: 6006,
Lines changed: 18 additions & 0 deletions
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) Jupyter Development Team.
2+
// Distributed under the terms of the Modified BSD License.
3+
4+
import {
5+
AnchoredRegion,
6+
anchoredRegionTemplate as template
7+
} from '@microsoft/fast-foundation';
8+
import { anchoredRegionStyles as styles } from '@microsoft/fast-components';
9+
10+
/**
11+
* A function that returns a {@link @microsoft/fast-foundation#AnchoredRegion} registration for configuring the component with a DesignSystem.
12+
* Implements {@link @microsoft/fast-foundation#anchoredRegionTemplate}
13+
*
14+
*
15+
* @beta
16+
* @remarks
17+
* Generates HTML Element: `<jp-anchored-region>`
18+
*/
19+
export const jpAnchoredRegion = AnchoredRegion.compose({
20+
baseName: 'anchored-region',
21+
template,
22+
styles
23+
});
24+
25+
/**
26+
* Base class for AnchoredRegion
27+
* @public
28+
*/
29+
export { AnchoredRegion };
30+
31+
export { styles as anchoredRegionStyles };
Binary file not shown.

0 commit comments

Comments
 (0)