Skip to content

Commit

Permalink
WIP internalize @microsoft/fast-components
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed Dec 1, 2023
1 parent 7d078b2 commit b67e872
Show file tree
Hide file tree
Showing 224 changed files with 14,893 additions and 7,708 deletions.
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,31 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

---

This project code source is modified from `@microsoft/fast-components` licensed under

FAST - https://www.fast.design/

MIT License

Copyright (c) Microsoft Corporation. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"main": "dist/esm/index.js",
"types": "dist/dts/index.d.ts",
"sideEffects": false,
"type": "module",
"scripts": {
"start": "storybook dev -p 6006",
"start:ci": "storybook dev -p 6006 --ci --quiet",
Expand All @@ -41,7 +42,6 @@
},
"dependencies": {
"@microsoft/fast-colors": "^5.3.1",
"@microsoft/fast-components": "^2.30.6",
"@microsoft/fast-element": "^1.12.0",
"@microsoft/fast-foundation": "^2.49.4",
"@microsoft/fast-web-utilities": "^5.4.1"
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/__test__/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Component schema

The `component.schema.json` is used to test against JSON schemas for each component. It should mirror the definition created by [Open UI](https://github.com/WICG/open-ui/blob/master/research/src/schemas/component.schema.json5).
s
100 changes: 100 additions & 0 deletions packages/components/src/__test__/component.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"$id": "component.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Component",
"description": "A UI Component definition.",
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"description": "The name of the component as defined in the design system.",
"type": "string"
},
"openUIName": {
"description": "The name of the component as defined in OpenUI.",
"type": "string"
},
"url": {
"description": "The url to the component doc page.",
"type": "string"
},
"definition": {
"type": "string",
"description": "This should be the formal definition of the component. It usually describes it's intended purpose."
},
"anatomy": {
"type": "array",
"items": {
"type": "object",
"description": "Each named part that makes up the whole of the component.",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
}
},
"required": [
"name"
]
},
"uniqueItems": true
},
"implementations": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "web-component"
},
"implementation": {
"$ref": "vscode-html-customdata"
}
},
"required": [
"type",
"implementation"
]
}
]
}
},
"concepts": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"category": {
"type": "string"
},
"openUIName": {
"type": "string"
},
"image": {
"type": "string"
}
},
"required": [
"name",
"image"
]
}
}
},
"required": [
"name",
"url"
]
}
6 changes: 6 additions & 0 deletions packages/components/src/__test__/setup-browser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function importAll(r: __WebpackModuleApi.RequireContext): void {
r.keys().forEach(r);
}

// Explicitly add to browser test
importAll(require.context("../", true, /\.spec\.js$/));
12 changes: 12 additions & 0 deletions packages/components/src/__test__/setup-node.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable */
if (window.document && !window.document.createRange) {
window.document.createRange = () => ({
setStart: () => {},
setEnd: () => {},
// @ts-ignore
commonAncestorContainer: {
nodeName: "BODY",
ownerDocument: document,
},
});
}
Loading

0 comments on commit b67e872

Please sign in to comment.