diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 84e556e79aa5e..c8aab83bb1b23 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -240,6 +240,7 @@ packages/react-components/react-toast @microsoft/teams-prg packages/react-components/react-search-preview @microsoft/cxe-coastal packages/react-components/react-colorpicker-compat @microsoft/cxe-red @sopranopillow packages/react-components/react-tree-preview @microsoft/teams-prg +packages/react-components/react-nav-preview @microsoft/cxe-red @mltejera # <%= NX-CODEOWNER-PLACEHOLDER %> ## Components diff --git a/packages/react-components/react-nav-preview/.babelrc.json b/packages/react-components/react-nav-preview/.babelrc.json new file mode 100644 index 0000000000000..45fb71ca16d2c --- /dev/null +++ b/packages/react-components/react-nav-preview/.babelrc.json @@ -0,0 +1,4 @@ +{ + "extends": "../../../.babelrc-v9.json", + "plugins": ["annotate-pure-calls", "@babel/transform-react-pure-annotations"] +} diff --git a/packages/react-components/react-nav-preview/.eslintrc.json b/packages/react-components/react-nav-preview/.eslintrc.json new file mode 100644 index 0000000000000..ceea884c70dcc --- /dev/null +++ b/packages/react-components/react-nav-preview/.eslintrc.json @@ -0,0 +1,4 @@ +{ + "extends": ["plugin:@fluentui/eslint-plugin/react"], + "root": true +} diff --git a/packages/react-components/react-nav-preview/.npmignore b/packages/react-components/react-nav-preview/.npmignore new file mode 100644 index 0000000000000..a5817be2414de --- /dev/null +++ b/packages/react-components/react-nav-preview/.npmignore @@ -0,0 +1,38 @@ +.storybook/ +.vscode/ +bundle-size/ +config/ +coverage/ +docs/ +etc/ +node_modules/ +src/ +stories/ +dist/types/ +temp/ +__fixtures__ +__mocks__ +__tests__ + +*.api.json +*.log +*.spec.* +*.cy.* +*.test.* +*.yml + +# config files +*config.* +*rc.* +.editorconfig +.eslint* +.git* +.prettierignore +.swcrc +project.json + +# exclude gitignore patterns explicitly +!lib +!lib-commonjs +!lib-amd +!dist/*.d.ts diff --git a/packages/react-components/react-nav-preview/.storybook/main.js b/packages/react-components/react-nav-preview/.storybook/main.js new file mode 100644 index 0000000000000..26536b61b387f --- /dev/null +++ b/packages/react-components/react-nav-preview/.storybook/main.js @@ -0,0 +1,14 @@ +const rootMain = require('../../../../.storybook/main'); + +module.exports = /** @type {Omit} */ ({ + ...rootMain, + stories: [...rootMain.stories, '../stories/**/*.stories.mdx', '../stories/**/index.stories.@(ts|tsx)'], + addons: [...rootMain.addons], + webpackFinal: (config, options) => { + const localConfig = { ...rootMain.webpackFinal(config, options) }; + + // add your own webpack tweaks if needed + + return localConfig; + }, +}); diff --git a/packages/react-components/react-nav-preview/.storybook/preview.js b/packages/react-components/react-nav-preview/.storybook/preview.js new file mode 100644 index 0000000000000..1939500a3d18c --- /dev/null +++ b/packages/react-components/react-nav-preview/.storybook/preview.js @@ -0,0 +1,7 @@ +import * as rootPreview from '../../../../.storybook/preview'; + +/** @type {typeof rootPreview.decorators} */ +export const decorators = [...rootPreview.decorators]; + +/** @type {typeof rootPreview.parameters} */ +export const parameters = { ...rootPreview.parameters }; diff --git a/packages/react-components/react-nav-preview/.storybook/tsconfig.json b/packages/react-components/react-nav-preview/.storybook/tsconfig.json new file mode 100644 index 0000000000000..ea89218a3d916 --- /dev/null +++ b/packages/react-components/react-nav-preview/.storybook/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "", + "allowJs": true, + "checkJs": true, + "types": ["static-assets", "environment", "storybook__addons"] + }, + "include": ["../stories/**/*.stories.ts", "../stories/**/*.stories.tsx", "*.js"] +} diff --git a/packages/react-components/react-nav-preview/.swcrc b/packages/react-components/react-nav-preview/.swcrc new file mode 100644 index 0000000000000..b4ffa86dee306 --- /dev/null +++ b/packages/react-components/react-nav-preview/.swcrc @@ -0,0 +1,30 @@ +{ + "$schema": "https://json.schemastore.org/swcrc", + "exclude": [ + "/testing", + "/**/*.cy.ts", + "/**/*.cy.tsx", + "/**/*.spec.ts", + "/**/*.spec.tsx", + "/**/*.test.ts", + "/**/*.test.tsx" + ], + "jsc": { + "parser": { + "syntax": "typescript", + "tsx": true, + "decorators": false, + "dynamicImport": false + }, + "externalHelpers": true, + "transform": { + "react": { + "runtime": "classic", + "useSpread": true + } + }, + "target": "es2019" + }, + "minify": false, + "sourceMaps": true +} diff --git a/packages/react-components/react-nav-preview/LICENSE b/packages/react-components/react-nav-preview/LICENSE new file mode 100644 index 0000000000000..a87184d8f14fb --- /dev/null +++ b/packages/react-components/react-nav-preview/LICENSE @@ -0,0 +1,15 @@ +@fluentui/react-nav-preview + +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +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. + +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 diff --git a/packages/react-components/react-nav-preview/README.md b/packages/react-components/react-nav-preview/README.md new file mode 100644 index 0000000000000..03fe1e3a8d0ab --- /dev/null +++ b/packages/react-components/react-nav-preview/README.md @@ -0,0 +1,5 @@ +# @fluentui/react-nav-preview + +**React Nav components for [Fluent UI React](https://react.fluentui.dev/)** + +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. diff --git a/packages/react-components/react-nav-preview/config/api-extractor.json b/packages/react-components/react-nav-preview/config/api-extractor.json new file mode 100644 index 0000000000000..e533bf30b48a2 --- /dev/null +++ b/packages/react-components/react-nav-preview/config/api-extractor.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "extends": "@fluentui/scripts-api-extractor/api-extractor.common.v-next.json" +} diff --git a/packages/react-components/react-nav-preview/config/tests.js b/packages/react-components/react-nav-preview/config/tests.js new file mode 100644 index 0000000000000..2e211ae9e2142 --- /dev/null +++ b/packages/react-components/react-nav-preview/config/tests.js @@ -0,0 +1 @@ +/** Jest test setup file. */ diff --git a/packages/react-components/react-nav-preview/docs/Spec.md b/packages/react-components/react-nav-preview/docs/Spec.md new file mode 100644 index 0000000000000..3d95279a0f5cd --- /dev/null +++ b/packages/react-components/react-nav-preview/docs/Spec.md @@ -0,0 +1,63 @@ +# @fluentui/react-nav-preview Spec + +## Background + +_Description and use cases of this component_ + +## Prior Art + +_Include background research done for this component_ + +- _Link to Open UI research_ +- _Link to comparison of v7 and v0_ +- _Link to GitHub epic issue for the converged component_ + +## Sample Code + +_Provide some representative example code that uses the proposed API for the component_ + +## Variants + +_Describe visual or functional variants of this control, if applicable. For example, a slider could have a 2D variant._ + +## API + +_List the **Props** and **Slots** proposed for the component. Ideally this would just be a link to the component's `.types.ts` file_ + +## Structure + +- _**Public**_ +- _**Internal**_ +- _**DOM** - how the component will be rendered as HTML elements_ + +## Migration + +_Describe what will need to be done to upgrade from the existing implementations:_ + +- _Migration from v8_ +- _Migration from v0_ + +## Behaviors + +_Explain how the component will behave in use, including:_ + +- _Component States_ +- _Interaction_ + - _Keyboard_ + - _Cursor_ + - _Touch_ + - _Screen readers_ + +## Accessibility + +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. + +- Decide whether to use **native element** or folow **ARIA** and provide reasons +- 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. +- 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. +- Describe the **keyboard navigation**: Tab Oder and Arrow Key Navigation. Describe any other keyboard **shortcuts** used +- Specify texts for **state change announcements** - [ARIA live regions + ](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions) (number of available items in dropdown, error messages, confirmations, ...) +- Identify UI parts that appear on **hover or focus** and specify keyboard and screen reader interaction with them +- List cases when **focus** needs to be **trapped** in sections of the UI (for dialogs and popups or for hierarchical navigation) +- List cases when **focus** needs to be **moved programatically** (if parts of the UI are appearing/disappearing or other cases) diff --git a/packages/react-components/react-nav-preview/etc/react-nav-preview.api.md b/packages/react-components/react-nav-preview/etc/react-nav-preview.api.md new file mode 100644 index 0000000000000..ce5d9e58d410a --- /dev/null +++ b/packages/react-components/react-nav-preview/etc/react-nav-preview.api.md @@ -0,0 +1,42 @@ +## API Report File for "@fluentui/react-nav-preview" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { ComponentProps } from '@fluentui/react-utilities'; +import type { ComponentState } from '@fluentui/react-utilities'; +import type { ForwardRefComponent } from '@fluentui/react-utilities'; +import * as React_2 from 'react'; +import type { Slot } from '@fluentui/react-utilities'; +import type { SlotClassNames } from '@fluentui/react-utilities'; + +// @public +export const Nav: ForwardRefComponent; + +// @public (undocumented) +export const navClassNames: SlotClassNames; + +// @public +export type NavProps = ComponentProps & {}; + +// @public (undocumented) +export type NavSlots = { + root: Slot<'div'>; +}; + +// @public +export type NavState = ComponentState; + +// @public +export const renderNav_unstable: (state: NavState) => JSX.Element; + +// @public +export const useNav_unstable: (props: NavProps, ref: React_2.Ref) => NavState; + +// @public +export const useNavStyles_unstable: (state: NavState) => NavState; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/react-components/react-nav-preview/jest.config.js b/packages/react-components/react-nav-preview/jest.config.js new file mode 100644 index 0000000000000..edf83ec25114b --- /dev/null +++ b/packages/react-components/react-nav-preview/jest.config.js @@ -0,0 +1,21 @@ +// @ts-check + +/** + * @type {import('@jest/types').Config.InitialOptions} + */ +module.exports = { + displayName: 'react-nav-preview', + preset: '../../../jest.preset.js', + transform: { + '^.+\\.tsx?$': [ + 'ts-jest', + { + tsconfig: '/tsconfig.spec.json', + isolatedModules: true, + }, + ], + }, + coverageDirectory: './coverage', + setupFilesAfterEnv: ['./config/tests.js'], + snapshotSerializers: ['@griffel/jest-serializer'], +}; diff --git a/packages/react-components/react-nav-preview/just.config.ts b/packages/react-components/react-nav-preview/just.config.ts new file mode 100644 index 0000000000000..b7b2c9a33bf43 --- /dev/null +++ b/packages/react-components/react-nav-preview/just.config.ts @@ -0,0 +1,5 @@ +import { preset, task } from '@fluentui/scripts-tasks'; + +preset(); + +task('build', 'build:react-components').cached?.(); diff --git a/packages/react-components/react-nav-preview/package.json b/packages/react-components/react-nav-preview/package.json new file mode 100644 index 0000000000000..1f042b5f1c5d5 --- /dev/null +++ b/packages/react-components/react-nav-preview/package.json @@ -0,0 +1,61 @@ +{ + "name": "@fluentui/react-nav-preview", + "version": "0.0.0", + "private": true, + "description": "New fluentui react package", + "main": "lib-commonjs/index.js", + "module": "lib/index.js", + "typings": "./dist/index.d.ts", + "sideEffects": false, + "repository": { + "type": "git", + "url": "https://github.com/microsoft/fluentui" + }, + "license": "MIT", + "scripts": { + "build": "just-scripts build", + "clean": "just-scripts clean", + "generate-api": "just-scripts generate-api", + "lint": "just-scripts lint", + "start": "yarn storybook", + "storybook": "start-storybook", + "test": "jest --passWithNoTests", + "test-ssr": "test-ssr \"./stories/**/*.stories.tsx\"", + "type-check": "tsc -b tsconfig.json" + }, + "devDependencies": { + "@fluentui/eslint-plugin": "*", + "@fluentui/react-conformance": "*", + "@fluentui/react-conformance-griffel": "*", + "@fluentui/scripts-api-extractor": "*", + "@fluentui/scripts-tasks": "*" + }, + "dependencies": { + "@fluentui/react-jsx-runtime": "9.0.0-alpha.15", + "@fluentui/react-theme": "^9.1.11", + "@fluentui/react-utilities": "^9.11.1", + "@griffel/react": "^1.5.14", + "@swc/helpers": "^0.4.14" + }, + "peerDependencies": { + "@types/react": ">=16.8.0 <19.0.0", + "@types/react-dom": ">=16.8.0 <19.0.0", + "react": ">=16.8.0 <19.0.0", + "react-dom": ">=16.8.0 <19.0.0" + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "node": "./lib-commonjs/index.js", + "import": "./lib/index.js", + "require": "./lib-commonjs/index.js" + }, + "./package.json": "./package.json" + }, + "beachball": { + "disallowedChangeTypes": [ + "major", + "prerelease" + ] + } +} diff --git a/packages/react-components/react-nav-preview/project.json b/packages/react-components/react-nav-preview/project.json new file mode 100644 index 0000000000000..119bdfb513d39 --- /dev/null +++ b/packages/react-components/react-nav-preview/project.json @@ -0,0 +1,8 @@ +{ + "name": "@fluentui/react-nav-preview", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "projectType": "library", + "sourceRoot": "packages/react-components/react-nav-preview/src", + "tags": ["platform:web", "vNext"], + "implicitDependencies": [] +} diff --git a/packages/react-components/react-nav-preview/src/Nav.ts b/packages/react-components/react-nav-preview/src/Nav.ts new file mode 100644 index 0000000000000..c8688cfbd6062 --- /dev/null +++ b/packages/react-components/react-nav-preview/src/Nav.ts @@ -0,0 +1 @@ +export * from './components/Nav/index'; diff --git a/packages/react-components/react-nav-preview/src/components/Nav/Nav.test.tsx b/packages/react-components/react-nav-preview/src/components/Nav/Nav.test.tsx new file mode 100644 index 0000000000000..eb1bba9ece68f --- /dev/null +++ b/packages/react-components/react-nav-preview/src/components/Nav/Nav.test.tsx @@ -0,0 +1,18 @@ +import * as React from 'react'; +import { render } from '@testing-library/react'; +import { isConformant } from '../../testing/isConformant'; +import { Nav } from './Nav'; + +describe('Nav', () => { + isConformant({ + Component: Nav, + displayName: 'Nav', + }); + + // TODO add more tests here, and create visual regression tests in /apps/vr-tests + + it('renders a default state', () => { + const result = render(); + expect(result.container).toMatchSnapshot(); + }); +}); diff --git a/packages/react-components/react-nav-preview/src/components/Nav/Nav.tsx b/packages/react-components/react-nav-preview/src/components/Nav/Nav.tsx new file mode 100644 index 0000000000000..020daa9c9cd2e --- /dev/null +++ b/packages/react-components/react-nav-preview/src/components/Nav/Nav.tsx @@ -0,0 +1,18 @@ +import * as React from 'react'; +import type { ForwardRefComponent } from '@fluentui/react-utilities'; +import { useNav_unstable } from './useNav'; +import { renderNav_unstable } from './renderNav'; +import { useNavStyles_unstable } from './useNavStyles.styles'; +import type { NavProps } from './Nav.types'; + +/** + * Nav component - TODO: add more docs + */ +export const Nav: ForwardRefComponent = React.forwardRef((props, ref) => { + const state = useNav_unstable(props, ref); + + useNavStyles_unstable(state); + return renderNav_unstable(state); +}); + +Nav.displayName = 'Nav'; diff --git a/packages/react-components/react-nav-preview/src/components/Nav/Nav.types.ts b/packages/react-components/react-nav-preview/src/components/Nav/Nav.types.ts new file mode 100644 index 0000000000000..8b1649b3a6883 --- /dev/null +++ b/packages/react-components/react-nav-preview/src/components/Nav/Nav.types.ts @@ -0,0 +1,17 @@ +import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities'; + +export type NavSlots = { + root: Slot<'div'>; +}; + +/** + * Nav Props + */ +export type NavProps = ComponentProps & {}; + +/** + * State used in rendering Nav + */ +export type NavState = ComponentState; +// TODO: Remove semicolon from previous line, uncomment next line, and provide union of props to pick from NavProps. +// & Required> diff --git a/packages/react-components/react-nav-preview/src/components/Nav/__snapshots__/Nav.test.tsx.snap b/packages/react-components/react-nav-preview/src/components/Nav/__snapshots__/Nav.test.tsx.snap new file mode 100644 index 0000000000000..46296127ae9b1 --- /dev/null +++ b/packages/react-components/react-nav-preview/src/components/Nav/__snapshots__/Nav.test.tsx.snap @@ -0,0 +1,11 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Nav renders a default state 1`] = ` +
+
+ Default Nav +
+
+`; diff --git a/packages/react-components/react-nav-preview/src/components/Nav/index.ts b/packages/react-components/react-nav-preview/src/components/Nav/index.ts new file mode 100644 index 0000000000000..2c7d5ea50a622 --- /dev/null +++ b/packages/react-components/react-nav-preview/src/components/Nav/index.ts @@ -0,0 +1,5 @@ +export * from './Nav'; +export * from './Nav.types'; +export * from './renderNav'; +export * from './useNav'; +export * from './useNavStyles.styles'; diff --git a/packages/react-components/react-nav-preview/src/components/Nav/renderNav.tsx b/packages/react-components/react-nav-preview/src/components/Nav/renderNav.tsx new file mode 100644 index 0000000000000..0e7231d90cbb7 --- /dev/null +++ b/packages/react-components/react-nav-preview/src/components/Nav/renderNav.tsx @@ -0,0 +1,16 @@ +/** @jsxRuntime classic */ +/** @jsx createElement */ + +import { createElement } from '@fluentui/react-jsx-runtime'; +import { getSlotsNext } from '@fluentui/react-utilities'; +import type { NavState, NavSlots } from './Nav.types'; + +/** + * Render the final JSX of Nav + */ +export const renderNav_unstable = (state: NavState) => { + const { slots, slotProps } = getSlotsNext(state); + + // TODO Add additional slots in the appropriate place + return ; +}; diff --git a/packages/react-components/react-nav-preview/src/components/Nav/useNav.ts b/packages/react-components/react-nav-preview/src/components/Nav/useNav.ts new file mode 100644 index 0000000000000..3d2015de51f06 --- /dev/null +++ b/packages/react-components/react-nav-preview/src/components/Nav/useNav.ts @@ -0,0 +1,28 @@ +import * as React from 'react'; +import { getNativeElementProps } from '@fluentui/react-utilities'; +import type { NavProps, NavState } from './Nav.types'; + +/** + * Create the state required to render Nav. + * + * The returned state can be modified with hooks such as useNavStyles_unstable, + * before being passed to renderNav_unstable. + * + * @param props - props from this instance of Nav + * @param ref - reference to root HTMLElement of Nav + */ +export const useNav_unstable = (props: NavProps, ref: React.Ref): NavState => { + return { + // TODO add appropriate props/defaults + components: { + // TODO add each slot's element type or component + root: 'div', + }, + // TODO add appropriate slots, for example: + // mySlot: resolveShorthand(props.mySlot), + root: getNativeElementProps('div', { + ref, + ...props, + }), + }; +}; diff --git a/packages/react-components/react-nav-preview/src/components/Nav/useNavStyles.styles.ts b/packages/react-components/react-nav-preview/src/components/Nav/useNavStyles.styles.ts new file mode 100644 index 0000000000000..9f943834f43bf --- /dev/null +++ b/packages/react-components/react-nav-preview/src/components/Nav/useNavStyles.styles.ts @@ -0,0 +1,33 @@ +import { makeStyles, mergeClasses } from '@griffel/react'; +import type { SlotClassNames } from '@fluentui/react-utilities'; +import type { NavSlots, NavState } from './Nav.types'; + +export const navClassNames: SlotClassNames = { + root: 'fui-Nav', + // TODO: add class names for all slots on NavSlots. + // Should be of the form `: 'fui-Nav__` +}; + +/** + * Styles for the root slot + */ +const useStyles = makeStyles({ + root: { + // TODO Add default styles for the root element + }, + + // TODO add additional classes for different states and/or slots +}); + +/** + * Apply styling to the Nav slots based on the state + */ +export const useNavStyles_unstable = (state: NavState): NavState => { + const styles = useStyles(); + state.root.className = mergeClasses(navClassNames.root, styles.root, state.root.className); + + // TODO Add class names to slots, for example: + // state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className); + + return state; +}; diff --git a/packages/react-components/react-nav-preview/src/index.ts b/packages/react-components/react-nav-preview/src/index.ts new file mode 100644 index 0000000000000..996b12f764c89 --- /dev/null +++ b/packages/react-components/react-nav-preview/src/index.ts @@ -0,0 +1,2 @@ +export { Nav, navClassNames, renderNav_unstable, useNavStyles_unstable, useNav_unstable } from './Nav'; +export type { NavProps, NavSlots, NavState } from './Nav'; diff --git a/packages/react-components/react-nav-preview/src/testing/isConformant.ts b/packages/react-components/react-nav-preview/src/testing/isConformant.ts new file mode 100644 index 0000000000000..a3d988f29a172 --- /dev/null +++ b/packages/react-components/react-nav-preview/src/testing/isConformant.ts @@ -0,0 +1,15 @@ +import { isConformant as baseIsConformant } from '@fluentui/react-conformance'; +import type { IsConformantOptions, TestObject } from '@fluentui/react-conformance'; +import griffelTests from '@fluentui/react-conformance-griffel'; + +export function isConformant( + testInfo: Omit, 'componentPath'> & { componentPath?: string }, +) { + const defaultOptions: Partial> = { + tsConfig: { configName: 'tsconfig.spec.json' }, + componentPath: require.main?.filename.replace('.test', ''), + extraTests: griffelTests as TestObject, + }; + + baseIsConformant(defaultOptions, testInfo); +} diff --git a/packages/react-components/react-nav-preview/stories/.gitkeep b/packages/react-components/react-nav-preview/stories/.gitkeep new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/packages/react-components/react-nav-preview/stories/Nav/NavBestPractices.md b/packages/react-components/react-nav-preview/stories/Nav/NavBestPractices.md new file mode 100644 index 0000000000000..08ff8ddeeb5f8 --- /dev/null +++ b/packages/react-components/react-nav-preview/stories/Nav/NavBestPractices.md @@ -0,0 +1,5 @@ +## Best practices + +### Do + +### Don't diff --git a/packages/react-components/react-nav-preview/stories/Nav/NavDefault.stories.tsx b/packages/react-components/react-nav-preview/stories/Nav/NavDefault.stories.tsx new file mode 100644 index 0000000000000..653ad02caebd7 --- /dev/null +++ b/packages/react-components/react-nav-preview/stories/Nav/NavDefault.stories.tsx @@ -0,0 +1,4 @@ +import * as React from 'react'; +import { Nav, NavProps } from '@fluentui/react-nav-preview'; + +export const Default = (props: Partial) =>