Skip to content

Commit 37cd6de

Browse files
committed
init: Bootstrap react-table package
1 parent 06add44 commit 37cd6de

20 files changed

+260
-0
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ packages/react-components/react-theme-sass @microsoft/teams-prg
169169
packages/react-components/theme-designer @microsoft/cxe-coastal
170170
packages/react-components/global-context @microsoft/teams-prg
171171
packages/react-components/babel-preset-global-context @microsoft/teams-prg
172+
packages/react-components/react-table @microsoft/teams-prg
172173
## <%= NX-CODEOWNER-PLACEHOLDER %>
173174

174175

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["@griffel"],
3+
"plugins": ["annotate-pure-calls", "@babel/transform-react-pure-annotations"]
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": ["plugin:@fluentui/eslint-plugin/react"],
3+
"root": true
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.storybook/
2+
.vscode/
3+
bundle-size/
4+
config/
5+
coverage/
6+
e2e/
7+
etc/
8+
node_modules/
9+
src/
10+
dist/types/
11+
temp/
12+
__fixtures__
13+
__mocks__
14+
__tests__
15+
16+
*.api.json
17+
*.log
18+
*.spec.*
19+
*.stories.*
20+
*.test.*
21+
*.yml
22+
23+
# config files
24+
*config.*
25+
*rc.*
26+
.editorconfig
27+
.eslint*
28+
.git*
29+
.prettierignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@fluentui/react-table
2+
3+
Copyright (c) Microsoft Corporation
4+
5+
All rights reserved.
6+
7+
MIT License
8+
9+
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:
10+
11+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12+
13+
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.
14+
15+
Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# @fluentui/react-table
2+
3+
**React Table components for [Fluent UI React](https://react.fluentui.dev/)**
4+
5+
These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# @fluentui/react-table Spec
2+
3+
## Background
4+
5+
_Description and use cases of this component_
6+
7+
## Prior Art
8+
9+
_Include background research done for this component_
10+
11+
- _Link to Open UI research_
12+
- _Link to comparison of v7 and v0_
13+
- _Link to GitHub epic issue for the converged component_
14+
15+
## Sample Code
16+
17+
_Provide some representative example code that uses the proposed API for the component_
18+
19+
## Variants
20+
21+
_Describe visual or functional variants of this control, if applicable. For example, a slider could have a 2D variant._
22+
23+
## API
24+
25+
_List the **Props** and **Slots** proposed for the component. Ideally this would just be a link to the component's `.types.ts` file_
26+
27+
## Structure
28+
29+
- _**Public**_
30+
- _**Internal**_
31+
- _**DOM** - how the component will be rendered as HTML elements_
32+
33+
## Migration
34+
35+
_Describe what will need to be done to upgrade from the existing implementations:_
36+
37+
- _Migration from v8_
38+
- _Migration from v0_
39+
40+
## Behaviors
41+
42+
_Explain how the component will behave in use, including:_
43+
44+
- _Component States_
45+
- _Interaction_
46+
- _Keyboard_
47+
- _Cursor_
48+
- _Touch_
49+
- _Screen readers_
50+
51+
## Accessibility
52+
53+
Base accessibility information is included in the design document. After the spec is filled and review, outcomes from it need to be communicated to design and incorporated in the design document.
54+
55+
- Decide whether to use **native element** or folow **ARIA** and provide reasons
56+
- Identify the **[ARIA](https://www.w3.org/TR/wai-aria-practices-1.2/) pattern** and, if the component is listed there, follow its specification as possible.
57+
- Identify accessibility **variants**, the `role` ([ARIA roles](https://www.w3.org/TR/wai-aria-1.1/#role_definitions)) of the component, its `slots` and `aria-*` props.
58+
- Describe the **keyboard navigation**: Tab Oder and Arrow Key Navigation. Describe any other keyboard **shortcuts** used
59+
- Specify texts for **state change announcements** - [ARIA live regions
60+
](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions) (number of available items in dropdown, error messages, confirmations, ...)
61+
- Identify UI parts that appear on **hover or focus** and specify keyboard and screen reader interaction with them
62+
- List cases when **focus** needs to be **trapped** in sections of the UI (for dialogs and popups or for hierarchical navigation)
63+
- List cases when **focus** needs to be **moved programatically** (if parts of the UI are appearing/disappearing or other cases)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3+
"extends": "@fluentui/scripts/api-extractor/api-extractor.common.v-next.json",
4+
"mainEntryPointFilePath": "<projectFolder>/dist/types/index.d.ts"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3+
"extends": "./api-extractor.json",
4+
"mainEntryPointFilePath": "<projectFolder>/dist/types/packages/react-components/<unscopedPackageName>/src/index.d.ts"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/** Jest test setup file. */

packages/react-components/react-table/etc/react-table.api.md

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// @ts-check
2+
3+
/**
4+
* @type {import('@jest/types').Config.InitialOptions}
5+
*/
6+
module.exports = {
7+
displayName: 'react-table',
8+
preset: '../../../jest.preset.js',
9+
globals: {
10+
'ts-jest': {
11+
tsConfig: '<rootDir>/tsconfig.spec.json',
12+
diagnostics: false,
13+
},
14+
},
15+
transform: {
16+
'^.+\\.tsx?$': 'ts-jest',
17+
},
18+
coverageDirectory: './coverage',
19+
setupFilesAfterEnv: ['./config/tests.js'],
20+
snapshotSerializers: ['@griffel/jest-serializer'],
21+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { preset } from '@fluentui/scripts';
2+
3+
preset();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "@fluentui/react-table",
3+
"version": "9.0.0-alpha.0",
4+
"private": true,
5+
"description": "React components for building web experiences",
6+
"main": "lib-commonjs/index.js",
7+
"module": "lib/index.js",
8+
"typings": "dist/index.d.ts",
9+
"sideEffects": false,
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/microsoft/fluentui"
13+
},
14+
"license": "MIT",
15+
"scripts": {
16+
"build": "just-scripts build",
17+
"clean": "just-scripts clean",
18+
"code-style": "just-scripts code-style",
19+
"just": "just-scripts",
20+
"lint": "just-scripts lint",
21+
"test": "jest --passWithNoTests",
22+
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
23+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/types/packages/react-components/react-table/src && yarn docs",
24+
"type-check": "tsc -b tsconfig.json"
25+
},
26+
"devDependencies": {
27+
"@fluentui/eslint-plugin": "*",
28+
"@fluentui/react-conformance": "*",
29+
"@fluentui/react-conformance-griffel": "9.0.0-beta.10",
30+
"@fluentui/scripts": "^1.0.0"
31+
},
32+
"dependencies": {
33+
"@fluentui/react-theme": "^9.0.0",
34+
"@fluentui/react-utilities": "^9.0.0",
35+
"@griffel/react": "^1.2.0",
36+
"tslib": "^2.1.0"
37+
},
38+
"peerDependencies": {
39+
"@types/react": ">=16.8.0 <18.0.0",
40+
"@types/react-dom": ">=16.8.0 <18.0.0",
41+
"react": ">=16.8.0 <18.0.0",
42+
"react-dom": ">=16.8.0 <18.0.0"
43+
},
44+
"beachball": {
45+
"disallowedChangeTypes": [
46+
"major"
47+
]
48+
}
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// TODO: replace with real exports
2+
export {};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"extends": "../../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"target": "ES2019",
5+
"noEmit": true,
6+
"isolatedModules": true,
7+
"importHelpers": true,
8+
"jsx": "react",
9+
"noUnusedLocals": true,
10+
"preserveConstEnums": true
11+
},
12+
"include": [],
13+
"files": [],
14+
"references": [
15+
{
16+
"path": "./tsconfig.lib.json"
17+
},
18+
{
19+
"path": "./tsconfig.spec.json"
20+
}
21+
]
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"noEmit": false,
5+
"lib": ["ES2019", "dom"],
6+
"outDir": "dist",
7+
"declaration": true,
8+
"declarationDir": "dist/types",
9+
"inlineSources": true,
10+
"types": ["static-assets", "environment"]
11+
},
12+
"exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx"],
13+
"include": ["./src/**/*.ts", "./src/**/*.tsx"]
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "CommonJS",
5+
"outDir": "dist",
6+
"types": ["jest", "node"]
7+
},
8+
"include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"]
9+
}

tsconfig.base.json

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"@fluentui/react-storybook": ["packages/react-components/react-storybook/src/index.ts"],
5757
"@fluentui/react-storybook-addon": ["packages/react-components/react-storybook-addon/src/index.ts"],
5858
"@fluentui/react-switch": ["packages/react-components/react-switch/src/index.ts"],
59+
"@fluentui/react-table": ["packages/react-components/react-table/src/index.ts"],
5960
"@fluentui/react-tabs": ["packages/react-components/react-tabs/src/index.ts"],
6061
"@fluentui/react-tabster": ["packages/react-components/react-tabster/src/index.ts"],
6162
"@fluentui/react-text": ["packages/react-components/react-text/src/index.ts"],

workspace.json

+7
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,13 @@
633633
"tags": ["vNext", "platform:web"],
634634
"implicitDependencies": []
635635
},
636+
"@fluentui/react-table": {
637+
"root": "packages/react-components/react-table",
638+
"projectType": "library",
639+
"implicitDependencies": [],
640+
"sourceRoot": "packages/react-components/react-table/src",
641+
"tags": ["vNext", "platform:web"]
642+
},
636643
"@fluentui/react-tabs": {
637644
"root": "packages/react-components/react-tabs",
638645
"projectType": "library",

0 commit comments

Comments
 (0)