├── .editorconfig
├── .github
├── CODEOWNERS
├── dependabot.yml
└── workflows
│ ├── ci-change.yml
│ ├── ci.yml
│ └── docs.yml
├── .gitignore
├── .prettierignore
├── .prettierrc
├── .storybook
├── copied-from-fluentui-core
│ ├── components
│ │ ├── FluentDocsContainer.tsx
│ │ ├── FluentDocsPage.tsx
│ │ └── Toc.tsx
│ ├── docs-root-v9.css
│ └── docs-root.css
├── main.ts
├── preview.tsx
└── tsconfig.json
├── .syncpackrc
├── .verdaccio
└── config.yml
├── .vscode
├── extensions.json
└── settings.json
├── .yarn
└── releases
│ └── cli.js
├── .yarnrc
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── SUPPORT.md
├── apps
└── docsite
│ ├── .babelrc
│ ├── .storybook
│ ├── main.ts
│ ├── manager.ts
│ ├── preview.tsx
│ ├── theme.ts
│ └── tsconfig.json
│ ├── eslint.config.js
│ ├── project.json
│ ├── public
│ └── fluentui-logo.svg
│ ├── src
│ └── Welcome.mdx
│ └── tsconfig.json
├── azure-pipelines.yml
├── babel.config.json
├── beachball.config.js
├── beachball.hooks.js
├── eslint.config.js
├── jest.config.ts
├── jest.preset.js
├── migrations.json
├── nx.json
├── package.json
├── packages
├── azure-theme
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ ├── components
│ │ │ ├── AzureDarkTheme
│ │ │ │ ├── AzureDarkTheme.test.tsx
│ │ │ │ ├── AzureDarkTheme.tsx
│ │ │ │ └── index.tsx
│ │ │ └── AzureLightTheme
│ │ │ │ ├── AzureLightTheme.test.tsx
│ │ │ │ ├── AzureLightTheme.tsx
│ │ │ │ └── index.tsx
│ │ ├── index.ts
│ │ └── tokens
│ │ │ ├── brandRamp.tsx
│ │ │ └── colorPalette.tsx
│ ├── stories
│ │ ├── .gitkeep
│ │ ├── Accordion.stories.tsx
│ │ ├── All.stories.tsx
│ │ ├── Avatar.stories.tsx
│ │ ├── AvatarGroup.stories.tsx
│ │ ├── Badge.stories.tsx
│ │ ├── Breadcrumb.stories.tsx
│ │ ├── Buttons.stories.tsx
│ │ ├── Cards.stories.tsx
│ │ ├── Checkbox.stories.tsx
│ │ ├── Combobox.stories.tsx
│ │ ├── DataGrid.stories.tsx
│ │ ├── Dialog.stories.tsx
│ │ ├── Divider.stories.tsx
│ │ ├── Drawer.stories.tsx
│ │ ├── Dropdown.stories.tsx
│ │ ├── Field.stories.tsx
│ │ ├── InfoLabel.stories.tsx
│ │ ├── Input.stories.tsx
│ │ ├── Label.stories.tsx
│ │ ├── Link.stories.tsx
│ │ ├── Menu.stories.tsx
│ │ ├── MessageBar.stories.tsx
│ │ ├── Overflow.stories.tsx
│ │ ├── Persona.stories.tsx
│ │ ├── Popover.stories.tsx
│ │ ├── RadioGroup.stories.tsx
│ │ ├── Select.stories.tsx
│ │ ├── Skeleton.stories.tsx
│ │ ├── Slider.stories.tsx
│ │ ├── SpinButton.stories.tsx
│ │ ├── Switch.stories.tsx
│ │ ├── TabList.stories.tsx
│ │ ├── Table.stories.tsx
│ │ ├── Text.stories.tsx
│ │ ├── Textarea.stories.tsx
│ │ ├── Toast.stories.tsx
│ │ ├── Toolbar.stories.tsx
│ │ ├── Tooltip.stories.tsx
│ │ ├── Tree.stories.tsx
│ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── houdini-utils
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ ├── index.ts
│ │ ├── paint
│ │ │ ├── fallback
│ │ │ │ ├── animate.ts
│ │ │ │ ├── anims
│ │ │ │ │ └── play.ts
│ │ │ │ ├── fallbackPaintAnimation.ts
│ │ │ │ ├── keyframe.ts
│ │ │ │ ├── lerp.ts
│ │ │ │ └── util
│ │ │ │ │ ├── canvas.ts
│ │ │ │ │ ├── color.test.ts
│ │ │ │ │ ├── color.ts
│ │ │ │ │ ├── css.test.ts
│ │ │ │ │ ├── css.ts
│ │ │ │ │ └── wrapper.ts
│ │ │ └── houdini
│ │ │ │ └── registerPaintWorklet.ts
│ │ ├── types.ts
│ │ └── util
│ │ │ ├── addModule.ts
│ │ │ ├── blobify.ts
│ │ │ └── featureDetect.ts
│ ├── stories
│ │ └── Utils
│ │ │ ├── Default.stories.tsx
│ │ │ ├── Fallback.stories.tsx
│ │ │ ├── FallbackWithDuration.stories.tsx
│ │ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ ├── tsconfig.spec.json
│ └── tsconfig.storybook.json
├── nx-plugin
│ ├── .swcrc
│ ├── README.md
│ ├── eslint.config.js
│ ├── executors.json
│ ├── generators.json
│ ├── jest-setup.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ ├── executors
│ │ │ ├── build
│ │ │ │ ├── executor.spec.ts
│ │ │ │ ├── executor.ts
│ │ │ │ ├── schema.d.ts
│ │ │ │ └── schema.json
│ │ │ ├── playwright
│ │ │ │ ├── executor.ts
│ │ │ │ ├── schema.d.ts
│ │ │ │ └── schema.json
│ │ │ └── type-check
│ │ │ │ ├── executor.spec.ts
│ │ │ │ ├── executor.ts
│ │ │ │ ├── schema.d.ts
│ │ │ │ └── schema.json
│ │ ├── generators
│ │ │ ├── add-codeowners.spec.ts
│ │ │ ├── add-codeowners.ts
│ │ │ ├── component-playwright-spec
│ │ │ │ ├── files
│ │ │ │ │ └── src
│ │ │ │ │ │ └── components
│ │ │ │ │ │ └── __componentName__
│ │ │ │ │ │ └── __componentName__.component-browser-spec.tsx.template
│ │ │ │ ├── generator.spec.ts
│ │ │ │ ├── generator.ts
│ │ │ │ ├── schema.d.ts
│ │ │ │ └── schema.json
│ │ │ ├── component
│ │ │ │ ├── files
│ │ │ │ │ ├── src
│ │ │ │ │ │ └── components
│ │ │ │ │ │ │ └── __componentName__
│ │ │ │ │ │ │ ├── __componentName__.styles.ts.template
│ │ │ │ │ │ │ ├── __componentName__.test.tsx.template
│ │ │ │ │ │ │ ├── __componentName__.tsx.template
│ │ │ │ │ │ │ └── index.ts.template
│ │ │ │ │ └── stories
│ │ │ │ │ │ └── __componentName__
│ │ │ │ │ │ ├── Default.stories.tsx.template
│ │ │ │ │ │ └── index.stories.tsx.template
│ │ │ │ ├── generator.spec.ts
│ │ │ │ ├── generator.ts
│ │ │ │ ├── schema.d.ts
│ │ │ │ ├── schema.json
│ │ │ │ └── update-dependencies.ts
│ │ │ ├── configure-storybook
│ │ │ │ ├── files
│ │ │ │ │ ├── .babelrc.template
│ │ │ │ │ ├── .storybook
│ │ │ │ │ │ ├── main.ts.template
│ │ │ │ │ │ ├── preview.tsx.template
│ │ │ │ │ │ └── tsconfig.json.template
│ │ │ │ │ └── stories
│ │ │ │ │ │ └── .gitkeep
│ │ │ │ ├── generator.spec.ts
│ │ │ │ ├── generator.ts
│ │ │ │ ├── schema.d.ts
│ │ │ │ └── schema.json
│ │ │ ├── library
│ │ │ │ ├── files
│ │ │ │ │ ├── .swcrc
│ │ │ │ │ ├── eslint.config.js.template
│ │ │ │ │ ├── src
│ │ │ │ │ │ └── index.ts.template
│ │ │ │ │ ├── tsconfig.json.template
│ │ │ │ │ ├── tsconfig.lib.json.template
│ │ │ │ │ └── tsconfig.spec.json.template
│ │ │ │ ├── findInstalledReactComponentsVersion.ts
│ │ │ │ ├── generator.spec.ts
│ │ │ │ ├── generator.ts
│ │ │ │ ├── schema.d.ts
│ │ │ │ └── schema.json
│ │ │ └── playwright-component-configuration
│ │ │ │ ├── files
│ │ │ │ ├── playwright.config.ts.template
│ │ │ │ └── playwright
│ │ │ │ │ ├── index.html.template
│ │ │ │ │ └── index.tsx.template
│ │ │ │ ├── generator.spec.ts
│ │ │ │ ├── generator.ts
│ │ │ │ ├── schema.d.ts
│ │ │ │ └── schema.json
│ │ ├── index.ts
│ │ ├── utils-testing.ts
│ │ └── utils.ts
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── pierce-dom
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ └── index.ts
│ ├── stories
│ │ └── .gitkeep
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── react-chat
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ ├── components
│ │ │ ├── Chat
│ │ │ │ ├── Chat.test.tsx
│ │ │ │ ├── Chat.tsx
│ │ │ │ ├── Chat.types.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── renderChat.tsx
│ │ │ │ ├── useChat.ts
│ │ │ │ ├── useChatMoverAttribute.tsx
│ │ │ │ └── useChatStyles.styles.ts
│ │ │ ├── ChatMessage
│ │ │ │ ├── ChatMessage.styles.ts
│ │ │ │ ├── ChatMessage.test.tsx
│ │ │ │ ├── ChatMessage.tsx
│ │ │ │ ├── ChatMessage.types.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── renderChatMessage.tsx
│ │ │ │ └── useChatMessage.ts
│ │ │ ├── ChatMyMessage
│ │ │ │ ├── ChatMyMessage.styles.ts
│ │ │ │ ├── ChatMyMessage.test.tsx
│ │ │ │ ├── ChatMyMessage.tsx
│ │ │ │ ├── ChatMyMessage.types.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── renderChatMyMessage.tsx
│ │ │ │ └── useChatMyMessage.tsx
│ │ │ ├── styles
│ │ │ │ ├── shared.mixins.ts
│ │ │ │ └── shared.styles.ts
│ │ │ └── utils
│ │ │ │ ├── getDecorationIcon.tsx
│ │ │ │ ├── mergeCallbacks.ts
│ │ │ │ ├── useChatMessagePopoverTrigger.test.ts
│ │ │ │ ├── useChatMessagePopoverTrigger.ts
│ │ │ │ └── useEventCallback.ts
│ │ └── index.ts
│ ├── stories
│ │ ├── Chat
│ │ │ ├── ChatWithFocusableContent.stories.tsx
│ │ │ ├── Default.stories.tsx
│ │ │ └── index.stories.tsx
│ │ ├── ChatMessage
│ │ │ ├── Decoration.stories.tsx
│ │ │ ├── Default.stories.tsx
│ │ │ ├── Slots.stories.tsx
│ │ │ └── index.stories.tsx
│ │ └── ChatMyMessage
│ │ │ ├── Decoration.stories.tsx
│ │ │ ├── Default.stories.tsx
│ │ │ ├── Slots.stories.tsx
│ │ │ ├── Status.stories.tsx
│ │ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── react-contextual-pane
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── README.md
│ ├── eslint.config.cjs
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ ├── components
│ │ │ ├── Footer
│ │ │ │ ├── Footer.styles.ts
│ │ │ │ ├── Footer.test.tsx
│ │ │ │ ├── Footer.tsx
│ │ │ │ └── index.ts
│ │ │ └── Header
│ │ │ │ ├── Header.styles.ts
│ │ │ │ ├── Header.test.tsx
│ │ │ │ ├── Header.tsx
│ │ │ │ ├── HeaderTitle.tsx
│ │ │ │ └── index.ts
│ │ ├── index.ts
│ │ └── lib
│ │ │ └── useEllipsisCheck.tsx
│ ├── stories
│ │ ├── .gitkeep
│ │ ├── Footer
│ │ │ ├── CustomChildren.stories.tsx
│ │ │ ├── Default.stories.tsx
│ │ │ └── index.stories.tsx
│ │ ├── Header
│ │ │ ├── Actions.stories.tsx
│ │ │ ├── Brand.stories.tsx
│ │ │ ├── Default.stories.tsx
│ │ │ ├── LongTitle.stories.tsx
│ │ │ ├── Truncation.stories.tsx
│ │ │ ├── index.stories.tsx
│ │ │ └── styles.ts
│ │ └── Mock
│ │ │ ├── Avatar.tsx
│ │ │ └── mocks.styles.ts
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── react-data-grid-react-window-grid
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ ├── components
│ │ │ ├── DataGrid
│ │ │ │ ├── DataGrid.tsx
│ │ │ │ ├── DataGrid.types.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── renderDataGrid.tsx
│ │ │ │ └── useDataGrid.ts
│ │ │ ├── DataGridBody
│ │ │ │ ├── DataGridBody.tsx
│ │ │ │ ├── DataGridBody.types.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── renderDataGridBody.tsx
│ │ │ │ ├── useDataGridBody.tsx
│ │ │ │ └── useDataGridBodyStyles.styles.ts
│ │ │ ├── DataGridCell
│ │ │ │ ├── DataGridCell.tsx
│ │ │ │ ├── index.ts
│ │ │ │ └── useDataGridCell.ts
│ │ │ ├── DataGridHeaderCell
│ │ │ │ ├── DataGridHeaderCell.tsx
│ │ │ │ ├── index.ts
│ │ │ │ └── useDataGridHeaderCell.ts
│ │ │ └── DataGridHeaderRow
│ │ │ │ ├── DataGridHeaderRow.tsx
│ │ │ │ ├── DataGridHeaderRow.types.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── renderDataGridHeaderRow.tsx
│ │ │ │ └── useDataGridHeaderRow.tsx
│ │ ├── contexts
│ │ │ ├── bodyRefContext.ts
│ │ │ ├── columnIndexContext.ts
│ │ │ ├── headerListRefContext.ts
│ │ │ └── rowIndexContext.ts
│ │ └── index.ts
│ ├── stories
│ │ └── DataGrid
│ │ │ ├── DataGridScrollingIndicators.stories.tsx
│ │ │ ├── VirtualizedDataGrid.stories.tsx
│ │ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── react-data-grid-react-window
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ ├── components
│ │ │ ├── DataGrid
│ │ │ │ ├── DataGrid.tsx
│ │ │ │ ├── DataGrid.types.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── renderDataGrid.tsx
│ │ │ │ └── useDataGrid.ts
│ │ │ ├── DataGridBody
│ │ │ │ ├── DataGridBody.tsx
│ │ │ │ ├── DataGridBody.types.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── renderDataGridBody.tsx
│ │ │ │ ├── useDataGridBody.tsx
│ │ │ │ └── useDataGridBodyStyles.styles.ts
│ │ │ ├── DataGridHeader
│ │ │ │ ├── DataGridHeader.tsx
│ │ │ │ ├── index.ts
│ │ │ │ ├── useDataGridHeader.ts
│ │ │ │ └── useDataGridHeaderStyles.styles.ts
│ │ │ └── DataGridRow
│ │ │ │ ├── DataGridRow.tsx
│ │ │ │ ├── index.ts
│ │ │ │ ├── useDataGridRow.styles.ts
│ │ │ │ └── useDataGridRow.tsx
│ │ ├── contexts
│ │ │ ├── bodyRefContext.ts
│ │ │ ├── headerRefContext.ts
│ │ │ └── rowIndexContext.ts
│ │ └── index.ts
│ ├── stories
│ │ └── DataGrid
│ │ │ ├── DataGridScrollingIndicators.stories.tsx
│ │ │ ├── ReactWindowOverrides.stories.tsx
│ │ │ ├── ResizableDataGrid.stories.tsx
│ │ │ ├── VirtualizedDataGrid.stories.tsx
│ │ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── react-draggable-dialog
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── playwright.config.ts
│ ├── playwright
│ │ ├── index.html
│ │ └── index.tsx
│ ├── project.json
│ ├── src
│ │ ├── components
│ │ │ ├── DraggableDialog
│ │ │ │ ├── DraggableDialog.component-browser-spec.tsx
│ │ │ │ ├── DraggableDialog.test.tsx
│ │ │ │ ├── DraggableDialog.tsx
│ │ │ │ ├── DraggableDialog.types.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── useDraggableDialog.test.ts
│ │ │ │ ├── useDraggableDialog.ts
│ │ │ │ └── utils
│ │ │ │ │ ├── getParsedDraggableMargin.ts
│ │ │ │ │ └── restrictToMarginModifier.ts
│ │ │ ├── DraggableDialogHandle
│ │ │ │ ├── DraggableDialogHandle.styles.ts
│ │ │ │ ├── DraggableDialogHandle.test.tsx
│ │ │ │ ├── DraggableDialogHandle.tsx
│ │ │ │ ├── DraggableDialogHandle.types.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── useDraggableDialogHandle.test.ts
│ │ │ │ └── useDraggableDialogHandle.ts
│ │ │ └── DraggableDialogSurface
│ │ │ │ ├── DraggableDialogSurface.styles.ts
│ │ │ │ ├── DraggableDialogSurface.test.tsx
│ │ │ │ ├── DraggableDialogSurface.tsx
│ │ │ │ ├── DraggableDialogSurface.types.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── useDraggableDialogSurface.test.ts
│ │ │ │ └── useDraggableDialogSurface.ts
│ │ ├── contexts
│ │ │ └── DraggableDialogContext.ts
│ │ ├── index.ts
│ │ └── utils
│ │ │ └── assertDialogParent.ts
│ ├── stories
│ │ └── DraggableDialog
│ │ │ ├── CustomBoundary.stories.tsx
│ │ │ ├── Default.stories.tsx
│ │ │ ├── InitialPosition.stories.tsx
│ │ │ ├── NoBoundary.stories.tsx
│ │ │ ├── WithMargin.stories.tsx
│ │ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── react-gamepad-navigation
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── playwright.config.ts
│ ├── playwright
│ │ ├── index.html
│ │ └── index.tsx
│ ├── project.json
│ ├── src
│ │ ├── core
│ │ │ ├── Constants.ts
│ │ │ ├── GamepadEvents.ts
│ │ │ ├── GamepadMappings.ts
│ │ │ ├── GamepadUtils.ts
│ │ │ ├── InputManager.ts
│ │ │ ├── InputProcessor.ts
│ │ │ └── NavigationManager.ts
│ │ ├── hooks
│ │ │ ├── useGamepadNavigation.test.ts
│ │ │ ├── useGamepadNavigation.ts
│ │ │ ├── useGamepadNavigationGroup.test.ts
│ │ │ └── useGamepadNavigationGroup.ts
│ │ ├── index.ts
│ │ └── types
│ │ │ ├── DirectionalSource.ts
│ │ │ ├── FluentGPNShadowDOMAPI.ts
│ │ │ ├── FocusDirection.ts
│ │ │ ├── GamepadEventHandlers.ts
│ │ │ ├── InputMode.ts
│ │ │ ├── Keys.ts
│ │ │ └── Trigger.ts
│ ├── stories
│ │ ├── .gitkeep
│ │ ├── ComposedElements.stories.tsx
│ │ ├── Default.stories.tsx
│ │ ├── MultipleGroups.stories.tsx
│ │ ├── SingleElements.stories.tsx
│ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── react-headless-provider
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ ├── components
│ │ │ └── HeadlessFluentProvider
│ │ │ │ ├── HeadlessFluentProvider.test.tsx
│ │ │ │ ├── HeadlessFluentProvider.tsx
│ │ │ │ └── index.ts
│ │ └── index.ts
│ ├── stories
│ │ └── HeadlessFluentProvider
│ │ │ ├── Default.stories.tsx
│ │ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── react-interactive-tab
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── playwright.config.ts
│ ├── playwright
│ │ ├── index.html
│ │ └── index.tsx
│ ├── project.json
│ ├── src
│ │ ├── components
│ │ │ └── InteractiveTab
│ │ │ │ ├── InteractiveTab.test.tsx
│ │ │ │ ├── InteractiveTab.tsx
│ │ │ │ ├── InteractiveTab.types.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── renderInteractiveTab.tsx
│ │ │ │ ├── useInteractiveTab.ts
│ │ │ │ └── useInteractiveTabStyles.styles.ts
│ │ └── index.ts
│ ├── stories
│ │ ├── .gitkeep
│ │ └── InteractiveTab
│ │ │ ├── Default.stories.tsx
│ │ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── react-keytips
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── manager.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── playwright.config.ts
│ ├── playwright
│ │ ├── index.html
│ │ └── index.tsx
│ ├── project.json
│ ├── src
│ │ ├── Keytip.ts
│ │ ├── Keytips.ts
│ │ ├── components
│ │ │ ├── Keytip
│ │ │ │ ├── Keytip.test.tsx
│ │ │ │ ├── Keytip.tsx
│ │ │ │ ├── Keytip.types.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── internal
│ │ │ │ │ └── Keytip.types.ts
│ │ │ │ ├── renderKeytip.tsx
│ │ │ │ ├── useKeytip.tsx
│ │ │ │ └── useKeytipStyles.styles.ts
│ │ │ └── Keytips
│ │ │ │ ├── Keytips.component-browser-spec.tsx
│ │ │ │ ├── Keytips.test.tsx
│ │ │ │ ├── Keytips.tsx
│ │ │ │ ├── Keytips.types.ts
│ │ │ │ ├── KeytipsExamples.component-browser-spec.tsx
│ │ │ │ ├── index.ts
│ │ │ │ ├── renderKeytips.tsx
│ │ │ │ └── useKeytips.tsx
│ │ ├── constants.ts
│ │ ├── docs
│ │ │ ├── MIGRATION.md
│ │ │ ├── Spec.md
│ │ │ └── assets
│ │ │ │ ├── positioning.png
│ │ │ │ └── style-variants.png
│ │ ├── hooks
│ │ │ ├── useEventService.test.ts
│ │ │ ├── useEventService.ts
│ │ │ ├── useHotkeys
│ │ │ │ ├── index.ts
│ │ │ │ ├── isMatchingKeyboardEvent.ts
│ │ │ │ ├── parseHotkey.ts
│ │ │ │ ├── useHotkeys.test.ts
│ │ │ │ ├── useHotkeys.ts
│ │ │ │ └── useHotkeys.types.ts
│ │ │ ├── useIsMacOS.test.ts
│ │ │ ├── useIsMacOS.ts
│ │ │ ├── useKeytipRef.test.ts
│ │ │ ├── useKeytipRef.ts
│ │ │ ├── useKeytipsManager.ts
│ │ │ ├── useTree.test.ts
│ │ │ └── useTree.ts
│ │ ├── index.ts
│ │ └── utilities
│ │ │ ├── createNode.ts
│ │ │ ├── index.ts
│ │ │ ├── isDisabled.ts
│ │ │ ├── isTargetVisible.ts
│ │ │ ├── omit.ts
│ │ │ └── sequencesToID.ts
│ ├── stories
│ │ ├── Default.md
│ │ ├── Default.stories.tsx
│ │ ├── Dynamic.md
│ │ ├── Dynamic.stories.tsx
│ │ ├── Overflow
│ │ │ ├── Help
│ │ │ │ └── index.tsx
│ │ │ ├── Home
│ │ │ │ ├── EmailMenuButton.tsx
│ │ │ │ └── index.tsx
│ │ │ ├── Overflow.stories.tsx
│ │ │ ├── OverflowItemCustom.tsx
│ │ │ ├── OverflowMenu.tsx
│ │ │ ├── View
│ │ │ │ └── index.tsx
│ │ │ ├── keytipsMap.ts
│ │ │ ├── shared.types.ts
│ │ │ └── useStyles.ts
│ │ ├── Shortcuts.md
│ │ ├── Shortcuts.stories.tsx
│ │ ├── WithTabs.stories.tsx
│ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── react-resize-handle
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── playwright.config.ts
│ ├── playwright
│ │ ├── index.html
│ │ └── index.tsx
│ ├── project.json
│ ├── public
│ │ └── demo.gif
│ ├── src
│ │ ├── hooks
│ │ │ ├── useKeyboardHandler.ts
│ │ │ ├── useMouseHandler.ts
│ │ │ ├── useResizeHandle.component-browser-spec.tsx
│ │ │ ├── useResizeHandle.test.tsx
│ │ │ ├── useResizeHandle.ts
│ │ │ ├── useResizeHandleExample.component-browser-spec.tsx
│ │ │ ├── useUnitHandle.test.tsx
│ │ │ └── useUnitHandle.ts
│ │ ├── index.ts
│ │ ├── types.ts
│ │ └── utils
│ │ │ ├── clamp.ts
│ │ │ └── index.ts
│ ├── stories
│ │ ├── .gitkeep
│ │ ├── Default.stories.tsx
│ │ ├── Handle.tsx
│ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── react-shadow
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ ├── index.ts
│ │ ├── root.tsx
│ │ └── types.ts
│ ├── stories
│ │ └── root
│ │ │ ├── Default.stories.tsx
│ │ │ ├── InsertionPoint.stories.tsx
│ │ │ ├── Portals.stories.tsx
│ │ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── react-themeless-provider
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ ├── components
│ │ │ └── ThemelessFluentProvider
│ │ │ │ ├── ThemelessFluentProvider.test.tsx
│ │ │ │ ├── ThemelessFluentProvider.tsx
│ │ │ │ ├── index.ts
│ │ │ │ ├── renderThemelessFluentProvider.tsx
│ │ │ │ └── useThemelessFluentProviderStyles.styles.tsx
│ │ ├── index.ts
│ │ └── utils
│ │ │ └── createCSSStyleSheetFromTheme.ts
│ ├── stories
│ │ ├── .gitkeep
│ │ └── ThemelessFluentProvider
│ │ │ ├── Default.stories.tsx
│ │ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── react-tree-grid
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── playwright.config.ts
│ ├── playwright
│ │ ├── index.html
│ │ └── index.tsx
│ ├── project.json
│ ├── src
│ │ ├── components
│ │ │ ├── TreeGrid
│ │ │ │ ├── TreeGrid.component-browser-spec.tsx
│ │ │ │ ├── TreeGrid.tsx
│ │ │ │ ├── TreeGrid.types.ts
│ │ │ │ ├── TreeGridExample.component-browser-spec.tsx
│ │ │ │ └── index.ts
│ │ │ ├── TreeGridCell
│ │ │ │ ├── TreeGridCell.tsx
│ │ │ │ ├── TreeGridCell.types.ts
│ │ │ │ └── index.ts
│ │ │ ├── TreeGridInteraction
│ │ │ │ ├── TreeGridInteraction.tsx
│ │ │ │ ├── TreeGridInteraction.types.ts
│ │ │ │ └── index.ts
│ │ │ ├── TreeGridRow
│ │ │ │ ├── TreeGridRow.tsx
│ │ │ │ ├── TreeGridRow.types.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useTreeGridRowStyles.styles.ts
│ │ │ └── TreeGridRowTrigger
│ │ │ │ ├── TreeGridRowTrigger.tsx
│ │ │ │ └── index.ts
│ │ ├── contexts
│ │ │ └── TreeGridRowContext.ts
│ │ ├── hooks
│ │ │ └── useFindParentRow.ts
│ │ └── index.ts
│ ├── stories
│ │ ├── Calls.stories.tsx
│ │ ├── Default.stories.tsx
│ │ ├── EmailInbox.stories.tsx
│ │ ├── LiveMeetingsList.stories.tsx
│ │ ├── Meet.stories.tsx
│ │ ├── Virtualization.stories.tsx
│ │ ├── a11y.md
│ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── stylelint-plugin
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ ├── create-rule.ts
│ │ ├── get-doc-url.ts
│ │ ├── has-docs.test.ts
│ │ ├── index.ts
│ │ ├── normalize-rule-name.ts
│ │ ├── postcss-utils.ts
│ │ └── rules
│ │ │ ├── combinator-depth
│ │ │ ├── README.md
│ │ │ ├── combinator-depth.test.ts
│ │ │ └── combinator-depth.ts
│ │ │ └── no-focus-visible
│ │ │ ├── README.md
│ │ │ ├── no-focus-visible.test.ts
│ │ │ └── no-focus-visible.ts
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── teams-components
│ ├── .babelrc
│ ├── .storybook
│ │ ├── main.ts
│ │ ├── preview.tsx
│ │ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ ├── components
│ │ │ ├── Button
│ │ │ │ ├── Button.test.tsx
│ │ │ │ ├── Button.tsx
│ │ │ │ ├── index.ts
│ │ │ │ └── validateProps.ts
│ │ │ ├── MenuButton
│ │ │ │ ├── MenuButton.styles.ts
│ │ │ │ ├── MenuButton.test.tsx
│ │ │ │ ├── MenuButton.tsx
│ │ │ │ └── index.ts
│ │ │ └── ToggleButton
│ │ │ │ ├── ToggleButton.test.tsx
│ │ │ │ ├── ToggleButton.tsx
│ │ │ │ ├── index.ts
│ │ │ │ └── validateProps.ts
│ │ ├── index.ts
│ │ ├── strictSlot.ts
│ │ └── strictStyles
│ │ │ ├── STRICT_SYMBOL.ts
│ │ │ ├── createStrictClass.test.ts
│ │ │ ├── createStrictClass.ts
│ │ │ ├── index.ts
│ │ │ ├── makeStrictStyles.production.test.ts
│ │ │ ├── makeStrictStyles.test.ts
│ │ │ ├── makeStrictStyles.ts
│ │ │ ├── mergeStrictClasses.production.test.ts
│ │ │ ├── mergeStrictClasses.test.ts
│ │ │ ├── mergeStrictClasses.ts
│ │ │ ├── types.ts
│ │ │ ├── validateStrictClasses.test.ts
│ │ │ └── validateStrictClasses.ts
│ ├── stories
│ │ ├── .gitkeep
│ │ ├── Button
│ │ │ ├── Default.stories.tsx
│ │ │ └── index.stories.tsx
│ │ ├── MenuButton
│ │ │ ├── Default.stories.tsx
│ │ │ └── index.stories.tsx
│ │ └── ToggleButton
│ │ │ ├── Default.stories.tsx
│ │ │ └── index.stories.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── token-analyzer
│ ├── .swcrc
│ ├── README.md
│ ├── eslint.config.cjs
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
└── variant-theme
│ ├── .babelrc
│ ├── .storybook
│ ├── main.ts
│ ├── preview.tsx
│ └── tsconfig.json
│ ├── .swcrc
│ ├── CHANGELOG.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── eslint.config.js
│ ├── jest.config.ts
│ ├── package.json
│ ├── playwright.config.ts
│ ├── playwright
│ ├── index.html
│ └── index.tsx
│ ├── project.json
│ ├── src
│ ├── ThemeDesigner
│ │ ├── colors
│ │ │ ├── csswg.ts
│ │ │ ├── geometry.ts
│ │ │ ├── hueMap.ts
│ │ │ ├── index.ts
│ │ │ ├── palettes.ts
│ │ │ ├── templates.ts
│ │ │ └── types.ts
│ │ ├── generated-api.ts
│ │ └── utils
│ │ │ ├── brandColors.ts
│ │ │ ├── getBrandTokensFromPalette.ts
│ │ │ ├── getOverridableTokenBrandColors.ts
│ │ │ ├── themeList.ts
│ │ │ ├── toString.ts
│ │ │ └── useDebounce.ts
│ ├── ThemeGenerator.ts
│ └── index.ts
│ ├── stories
│ └── .gitkeep
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── patches
└── beachball+2.33.2.patch
├── project.json
├── tools
├── scripts
│ ├── preinstall.mjs
│ ├── publish.mjs
│ └── verify-repo-integrity.mjs
└── tsconfig.tools.json
├── tsconfig.base.json
└── yarn.lock
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: 'github-actions'
4 | directory: '/'
5 | schedule:
6 | interval: 'weekly'
7 | # Weekly updates for devDependencies.
8 | - package-ecosystem: 'npm'
9 | directory: '/'
10 | schedule:
11 | interval: 'weekly'
12 | allow:
13 | - dependency-type: 'development'
14 | open-pull-requests-limit: 6
15 | versioning-strategy: increase
16 |
--------------------------------------------------------------------------------
/.github/workflows/ci-change.yml:
--------------------------------------------------------------------------------
1 | name: Changelog
2 | on:
3 | pull_request:
4 |
5 | jobs:
6 | pr:
7 | runs-on: ubuntu-latest
8 | if: ${{ github.event_name == 'pull_request' }}
9 | steps:
10 | - uses: actions/checkout@v4
11 | with:
12 | fetch-depth: 0
13 |
14 | - uses: actions/setup-node@v4
15 | with:
16 | node-version: '20'
17 |
18 | - run: npx beachball check --changehint "Run 'yarn change' to generate a change file"
19 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | # Add files here to ignore them from prettier formatting
2 | /dist
3 | /coverage
4 | .yarn/
5 | patches/
6 | packages/nx-plugin/src/generators/**/files/
7 |
8 | /.nx/cache
9 | /.nx/workspace-data
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true
3 | }
4 |
--------------------------------------------------------------------------------
/.storybook/copied-from-fluentui-core/docs-root-v9.css:
--------------------------------------------------------------------------------
1 | /* remove the docs wrapper bg to let page bg show through */
2 | /* remove unnecessary padding now that theme switcher is not taking up space */
3 | #storybook-docs .sbdocs-wrapper {
4 | background: transparent !important;
5 | padding: 0 48px;
6 | }
7 |
8 | /* sb-show-main is missing during page transitions causing a page shift */
9 | /* todo: cleanup once we no longer inherit docs-root */
10 | .sb-show-main.sb-main-fullscreen,
11 | .sb-main-fullscreen {
12 | margin: 0;
13 | padding: 0;
14 | display: block;
15 | }
16 |
17 | /* remove loading overlay */
18 | .sb-preparing-story,
19 | .sb-preparing-docs,
20 | .sb-nopreview,
21 | .sb-errordisplay {
22 | display: none !important;
23 | }
24 |
--------------------------------------------------------------------------------
/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | const config: StorybookConfig = {
4 | stories: [],
5 | addons: ['@storybook/addon-docs', '@nx/react/plugins/storybook'],
6 | framework: {
7 | name: '@storybook/react-webpack5',
8 | options: {},
9 | },
10 | docs: {
11 | autodocs: true,
12 | },
13 | };
14 |
15 | export default config;
16 |
--------------------------------------------------------------------------------
/.syncpackrc:
--------------------------------------------------------------------------------
1 | {
2 | "dependencyTypes": [
3 | "prod",
4 | "peer"
5 | ],
6 | "versionGroups": [
7 | {
8 | "packages": [
9 | "**"
10 | ],
11 | "dependencies": [
12 | "@fluentui/react-components"
13 | ],
14 | "dependencyTypes": [
15 | "peer"
16 | ],
17 | "isIgnored": true
18 | },
19 | {
20 | "packages": [
21 | "@fluentui-contrib/react-interactive-tab",
22 | "@fluentui-contrib/react-keytips"
23 | ],
24 | "dependencies": [
25 | "@fluentui/react-jsx-runtime",
26 | "@fluentui/react-utilities"
27 | ],
28 | "dependencyTypes": [
29 | "prod"
30 | ],
31 | "isIgnored": true
32 | }
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "nrwl.angular-console",
4 | "esbenp.prettier-vscode",
5 | "dbaeumer.vscode-eslint",
6 | "firsttris.vscode-jest-runner",
7 | "ms-playwright.playwright"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/.yarnrc:
--------------------------------------------------------------------------------
1 | yarn-path ".yarn/releases/cli.js"
2 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Microsoft Open Source Code of Conduct
2 |
3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4 |
5 | Resources:
6 |
7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
10 |
--------------------------------------------------------------------------------
/apps/docsite/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/apps/docsite/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: [
9 | // docsite stories
10 | '../src/**/*.mdx',
11 | '../src/**/index.stories.@(js|jsx|ts|tsx)',
12 | // packages stories
13 | '../../../packages/*/stories/**/*.mdx',
14 | '../../../packages/*/stories/**/index.stories.@(js|jsx|ts|tsx)',
15 | ],
16 | };
17 |
18 | export default config;
19 |
--------------------------------------------------------------------------------
/apps/docsite/.storybook/manager.ts:
--------------------------------------------------------------------------------
1 | import { addons } from '@storybook/manager-api';
2 |
3 | import fluentStorybookTheme from './theme';
4 |
5 | addons.setConfig({
6 | enableShortcuts: false,
7 | theme: fluentStorybookTheme,
8 | showPanel: false,
9 | showToolbar: false,
10 | });
11 |
--------------------------------------------------------------------------------
/apps/docsite/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | parameters: {
9 | ...rootPreview.parameters,
10 | options: {
11 | storySort: {
12 | method: 'alphabetical',
13 | order: ['Welcome', 'Packages'],
14 | },
15 | },
16 | },
17 | };
18 |
19 | export default preview;
20 |
--------------------------------------------------------------------------------
/apps/docsite/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/apps/docsite/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "jsx": "react-jsx",
5 | "allowJs": false,
6 | "esModuleInterop": false,
7 | "allowSyntheticDefaultImports": true,
8 | "strict": true
9 | },
10 | "files": [],
11 | "include": [],
12 | "references": [
13 | {
14 | "path": "./.storybook/tsconfig.base.json"
15 | }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/babel.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "sourceType": "unambiguous",
3 | "presets": [
4 | [
5 | "@babel/preset-env",
6 | {
7 | "targets": {
8 | "chrome": 100
9 | }
10 | }
11 | ],
12 | "@babel/preset-typescript",
13 | "@babel/preset-react"
14 | ],
15 | "plugins": []
16 | }
--------------------------------------------------------------------------------
/beachball.config.js:
--------------------------------------------------------------------------------
1 | // @ts-check
2 |
3 | /**
4 | * @type {import('beachball').BeachballConfig}
5 | */
6 | module.exports = {
7 | gitTags: false,
8 | ignorePatterns: [
9 | '**/*.test.tsx',
10 | '**/*.test.ts',
11 | '**/*.spec.tsx',
12 | '**/*.spec.ts',
13 | '**/*.component-browser-spec.tsx',
14 | '**/*.stories.tsx',
15 | '**/eslint.config.js',
16 | '**/jest.config.js',
17 | '**/playwright.config.ts',
18 | '**/project.json',
19 | '**/*.md',
20 | '**/*.babelrc',
21 | '**/playwright/**',
22 | '**/.storybook/**',
23 | ],
24 | hooks: require('./beachball.hooks'),
25 | };
26 |
--------------------------------------------------------------------------------
/jest.config.ts:
--------------------------------------------------------------------------------
1 | import { getJestProjectsAsync } from '@nx/jest';
2 |
3 | export default async () => ({
4 | projects: await getJestProjectsAsync(),
5 | });
6 |
--------------------------------------------------------------------------------
/jest.preset.js:
--------------------------------------------------------------------------------
1 | const nxPreset = require('@nx/jest/preset').default;
2 |
3 | module.exports = {
4 | ...nxPreset,
5 | transform: {
6 | // TODO: override the nx default transform. without this we need to have ts-jest installed...
7 | // @see https://github.com/nrwl/nx/blob/master/packages/jest/preset/jest-preset.ts#L8-L13
8 | '^.+\\.(ts|js|html)$': ['@swc/jest'],
9 | },
10 | maxWorkers: isCI() ? 1 : '50%',
11 | };
12 |
13 | function isCI() {
14 | return (
15 | (process.env.CI && process.env.CI !== 'false') ||
16 | process.env.TF_BUILD === 'true' ||
17 | process.env.GITHUB_ACTIONS === 'true'
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/packages/azure-theme/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/azure-theme/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/azure-theme/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/azure-theme/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/azure-theme/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/azure-theme/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/azure-theme",
3 | "version": "0.1.1",
4 | "dependencies": {
5 | "@swc/helpers": "~0.5.11"
6 | },
7 | "main": "./src/index.js",
8 | "typings": "./src/index.d.ts",
9 | "beachball": {
10 | "disallowedChangeTypes": [
11 | "prerelease",
12 | "major"
13 | ]
14 | },
15 | "peerDependencies": {
16 | "@fluentui/react-components": ">=9.46.3 <10.0.0"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/packages/azure-theme/src/components/AzureDarkTheme/AzureDarkTheme.test.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { render } from '@testing-library/react';
3 | import { AzureDarkTheme } from './AzureDarkTheme';
4 | import { FluentProvider } from '@fluentui/react-components';
5 | describe('AzureDarkTheme', () => {
6 | it('should render', () => {
7 | render();
8 | });
9 | });
10 |
--------------------------------------------------------------------------------
/packages/azure-theme/src/components/AzureDarkTheme/AzureDarkTheme.tsx:
--------------------------------------------------------------------------------
1 | import { Theme, createDarkTheme } from '@fluentui/react-components';
2 | import { brandAzure } from '../../tokens/brandRamp';
3 |
4 | const darkColors: Theme = createDarkTheme(brandAzure);
5 |
6 | export const AzureDarkTheme: Theme = {
7 | ...darkColors,
8 | };
9 |
--------------------------------------------------------------------------------
/packages/azure-theme/src/components/AzureDarkTheme/index.tsx:
--------------------------------------------------------------------------------
1 | export * from './AzureDarkTheme';
2 |
--------------------------------------------------------------------------------
/packages/azure-theme/src/components/AzureLightTheme/AzureLightTheme.test.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/azure-theme/src/components/AzureLightTheme/AzureLightTheme.test.tsx
--------------------------------------------------------------------------------
/packages/azure-theme/src/components/AzureLightTheme/AzureLightTheme.tsx:
--------------------------------------------------------------------------------
1 | import { Theme, createLightTheme } from '@fluentui/react-components';
2 | import { brandAzure } from '../../tokens/brandRamp';
3 |
4 | const lightColors: Theme = createLightTheme(brandAzure);
5 |
6 | export const AzureLightTheme: Theme = {
7 | ...lightColors,
8 | };
9 |
--------------------------------------------------------------------------------
/packages/azure-theme/src/components/AzureLightTheme/index.tsx:
--------------------------------------------------------------------------------
1 | export * from './AzureLightTheme';
2 |
--------------------------------------------------------------------------------
/packages/azure-theme/src/index.ts:
--------------------------------------------------------------------------------
1 | export { AzureLightTheme } from './components/AzureLightTheme';
2 | export { AzureDarkTheme } from './components/AzureDarkTheme';
3 |
--------------------------------------------------------------------------------
/packages/azure-theme/stories/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/azure-theme/stories/.gitkeep
--------------------------------------------------------------------------------
/packages/azure-theme/stories/All.stories.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | export const AllControls = () => {
4 | return (
5 |
8 | );
9 | };
10 |
--------------------------------------------------------------------------------
/packages/azure-theme/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/azure-theme/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/azure-theme/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/houdini-utils/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/houdini-utils/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/houdini-utils/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/houdini-utils/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/houdini-utils/README.md:
--------------------------------------------------------------------------------
1 | # @fluentui-contrib/houdini-utils
2 |
3 | This library exposes some low level utilities to use the [houdini APIs](https://developer.mozilla.org/en-US/docs/Web/API/Houdini_APIs)
4 | as well as a canvas fallback that should be usable with the [paint worklet](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Painting_API#the_paint_worklet) that would normally be used by houdini.
5 |
6 | Please refer to the [documentation samples](https://microsoft.github.io/fluentui-contrib/houdini-utils/) for usage guidance
7 |
--------------------------------------------------------------------------------
/packages/houdini-utils/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/houdini-utils/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/houdini-utils",
3 | "version": "0.3.5",
4 | "dependencies": {
5 | "@swc/helpers": "~0.5.11"
6 | },
7 | "main": "./src/index.js",
8 | "typings": "./src/index.d.ts"
9 | }
10 |
--------------------------------------------------------------------------------
/packages/houdini-utils/src/index.ts:
--------------------------------------------------------------------------------
1 | export { PaintWorklet } from './types';
2 | export type { PaintWorkletGeometry } from './types';
3 | export { registerPaintWorklet } from './paint/houdini/registerPaintWorklet';
4 | export { fallbackPaintAnimation } from './paint/fallback/fallbackPaintAnimation';
5 | export {
6 | hasHoudini,
7 | hasMozElement,
8 | hasWebkitCanvas,
9 | } from './util/featureDetect';
10 |
11 | export { blobify } from './util/blobify';
12 | export { addModule } from './util/addModule';
13 |
--------------------------------------------------------------------------------
/packages/houdini-utils/src/paint/houdini/registerPaintWorklet.ts:
--------------------------------------------------------------------------------
1 | import { addModule } from '../../util/addModule';
2 | import { hasHoudini } from '../../util/featureDetect';
3 |
4 | export const registerPaintWorklet = (baseUrl: string, filebaseUrl: string) => {
5 | if (hasHoudini()) {
6 | return addModule(baseUrl, filebaseUrl);
7 | }
8 |
9 | return Promise.resolve();
10 | };
11 |
--------------------------------------------------------------------------------
/packages/houdini-utils/stories/Utils/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta } from '@storybook/react';
2 | import description from '../../README.md';
3 |
4 | export { Default } from './Default.stories';
5 | export { Fallback } from './Fallback.stories';
6 | export { FallbackWithDuration } from './FallbackWithDuration.stories';
7 |
8 | const meta: Meta = {
9 | title: 'Packages/houdini-utils',
10 | parameters: {
11 | docs: {
12 | description: {
13 | component: description,
14 | },
15 | hideArgsTable: true,
16 | },
17 | },
18 | };
19 |
20 | export default meta;
21 |
--------------------------------------------------------------------------------
/packages/houdini-utils/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/houdini-utils/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/houdini-utils/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/nx-plugin/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/nx-plugin/README.md:
--------------------------------------------------------------------------------
1 | # @fluentui-contrib/nx-plugin
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Building
6 |
7 | Run `nx build nx-plugin` to build the library.
8 |
9 | ## Running unit tests
10 |
11 | Run `nx test nx-plugin` to execute the unit tests via [Jest](https://jestjs.io).
12 |
--------------------------------------------------------------------------------
/packages/nx-plugin/executors.json:
--------------------------------------------------------------------------------
1 | {
2 | "executors": {
3 | "build": {
4 | "implementation": "./src/executors/build/executor",
5 | "schema": "./src/executors/build/schema.json",
6 | "description": "build executor"
7 | },
8 | "playwright": {
9 | "implementation": "./src/executors/playwright/executor",
10 | "schema": "./src/executors/playwright/schema.json",
11 | "description": "playwright executor"
12 | },
13 | "type-check": {
14 | "implementation": "./src/executors/type-check/executor",
15 | "schema": "./src/executors/type-check/schema.json",
16 | "description": "type-check executor"
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/executors/build/schema.d.ts:
--------------------------------------------------------------------------------
1 | export interface BuildExecutorSchema {} // eslint-disable-line
2 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/executors/build/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/schema",
3 | "version": 2,
4 | "title": "Build executor",
5 | "description": "",
6 | "type": "object",
7 | "properties": {},
8 | "required": []
9 | }
10 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/executors/type-check/executor.spec.ts:
--------------------------------------------------------------------------------
1 | describe('TypeCheck Executor', () => {
2 | it('can run', async () => {
3 | expect(true).toBe(true);
4 | });
5 | });
6 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/executors/type-check/schema.d.ts:
--------------------------------------------------------------------------------
1 | export interface TypeCheckExecutorSchema {} // eslint-disable-line
2 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/executors/type-check/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/schema",
3 | "version": 2,
4 | "title": "TypeCheck executor",
5 | "description": "",
6 | "type": "object",
7 | "properties": {},
8 | "required": []
9 | }
10 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/component-playwright-spec/files/src/components/__componentName__/__componentName__.component-browser-spec.tsx.template:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { test, expect } from '@playwright/experimental-ct-react';
3 | import { <%= componentName %> } from './<%= componentName %>.tsx';
4 |
5 |
6 | test.use({ viewport: { width: 500, height: 500 } });
7 |
8 | test('should fail', async ({ mount }) => {
9 | const component = await mount(<<%= componentName %>/>);
10 | await expect(component).toContainText('Update this test file');
11 | });
12 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/component-playwright-spec/generator.ts:
--------------------------------------------------------------------------------
1 | import {
2 | formatFiles,
3 | generateFiles,
4 | Tree,
5 | readProjectConfiguration,
6 | } from '@nx/devkit';
7 | import * as path from 'path';
8 | import { PlaywrightComponentSpecGeneratorSchema } from './schema';
9 |
10 | export default async function (
11 | tree: Tree,
12 | options: PlaywrightComponentSpecGeneratorSchema
13 | ) {
14 | const { name } = options;
15 | const projectConfig = readProjectConfiguration(tree, name);
16 | generateFiles(
17 | tree,
18 | path.join(__dirname, 'files'),
19 | projectConfig.root,
20 | options
21 | );
22 | await formatFiles(tree);
23 | }
24 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/component-playwright-spec/schema.d.ts:
--------------------------------------------------------------------------------
1 | export interface PlaywrightComponentSpecGeneratorSchema {
2 | name: string;
3 | componentName: string;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/component/files/src/components/__componentName__/__componentName__.test.tsx.template:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { render } from '@testing-library/react';
3 | import { <%= componentName %> } from './<%= componentName %>';
4 |
5 | describe('<%= componentName %>', () => {
6 | it('should render', () => {
7 | render(<<%= componentName %> />);
8 | });
9 | });
10 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/component/files/src/components/__componentName__/__componentName__.tsx.template:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { mergeClasses } from '@fluentui/react-components';
3 | import { useStyles } from './<%= componentName %>.styles';
4 |
5 | export const <%= componentName %>: React.FC = () => {
6 | const styles = useStyles();
7 | return Hello World!
;
8 | };
9 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/component/files/src/components/__componentName__/index.ts.template:
--------------------------------------------------------------------------------
1 | export * from './<%= componentName %>';
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/component/files/stories/__componentName__/Default.stories.tsx.template:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { <%= componentName %> } from '<%= npmScope %>/<%= name %>';
3 |
4 | export const Default = () => <<%= componentName %> />;
5 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/component/files/stories/__componentName__/index.stories.tsx.template:
--------------------------------------------------------------------------------
1 | import type { Meta } from '@storybook/react';
2 | import { <%= componentName %> } from '<%= npmScope %>/<%= name %>';
3 | export { Default } from './Default.stories';
4 |
5 | const meta = {
6 | title: 'Packages/<%= name %>/<%= componentName %>',
7 | component: <%= componentName %>,
8 | } satisfies Meta>;
9 |
10 | export default meta;
11 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/component/schema.d.ts:
--------------------------------------------------------------------------------
1 | export interface ComponentGeneratorSchema {
2 | name: string;
3 | componentName: string;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/component/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/schema",
3 | "$id": "Component",
4 | "title": "",
5 | "type": "object",
6 | "properties": {
7 | "name": {
8 | "type": "string",
9 | "description": "",
10 | "$default": {
11 | "$source": "argv",
12 | "index": 0
13 | },
14 | "x-prompt": "In what library should this componnet be created"
15 | },
16 | "componentName": {
17 | "type": "string",
18 | "description": "",
19 | "$default": {
20 | "$source": "argv",
21 | "index": 1
22 | },
23 | "x-prompt": "What is the component name?"
24 | }
25 | },
26 | "required": ["name", "componentName"]
27 | }
28 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/configure-storybook/files/.babelrc.template:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/configure-storybook/files/.storybook/main.ts.template:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '<%= rootOffset %>/.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/configure-storybook/files/.storybook/preview.tsx.template:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '<%= rootOffset %>/.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/configure-storybook/files/stories/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/nx-plugin/src/generators/configure-storybook/files/stories/.gitkeep
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/configure-storybook/schema.d.ts:
--------------------------------------------------------------------------------
1 | export interface ConfigureStorybookGeneratorSchema {
2 | name: string;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/configure-storybook/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/schema",
3 | "$id": "ConfigureStorybook",
4 | "title": "",
5 | "type": "object",
6 | "properties": {
7 | "name": {
8 | "type": "string",
9 | "description": "Project for which to generate Storybook configuration.",
10 | "$default": {
11 | "$source": "argv",
12 | "index": 0
13 | },
14 | "x-prompt": "For which project do you want to generate Storybook configuration?",
15 | "x-dropdown": "projects"
16 | }
17 | },
18 | "required": ["name"]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/library/files/eslint.config.js.template:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.js', '**/*.jsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | ];
16 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/library/files/src/index.ts.template:
--------------------------------------------------------------------------------
1 | export {};
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/library/files/tsconfig.json.template:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/library/files/tsconfig.lib.json.template:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.test.tsx" , "files/**"]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/library/files/tsconfig.spec.json.template:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/library/schema.d.ts:
--------------------------------------------------------------------------------
1 | export interface LibraryGeneratorSchema {
2 | name: string;
3 | owner: string;
4 | testEnvironment?: 'jsdom' | 'node';
5 | }
6 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/playwright-component-configuration/files/playwright/index.html.template:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Testing Page
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/playwright-component-configuration/files/playwright/index.tsx.template:
--------------------------------------------------------------------------------
1 | // Import styles, initialize component theme here.
2 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/playwright-component-configuration/schema.d.ts:
--------------------------------------------------------------------------------
1 | export interface PlaywrightComponentConfigurationGeneratorSchema {
2 | name: string;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/generators/playwright-component-configuration/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/schema",
3 | "$id": "ConfigurePlaywright",
4 | "title": "",
5 | "type": "object",
6 | "properties": {
7 | "name": {
8 | "type": "string",
9 | "description": "Project for which to generate Playwright configuration.",
10 | "$default": {
11 | "$source": "argv",
12 | "index": 0
13 | },
14 | "x-prompt": "For which project do you want to generate Playwright configuration?",
15 | "x-dropdown": "projects"
16 | }
17 | },
18 | "required": ["name"]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/nx-plugin/src/index.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/nx-plugin/src/index.ts
--------------------------------------------------------------------------------
/packages/nx-plugin/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "module": "commonjs"
5 | },
6 | "files": [],
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/nx-plugin/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true,
6 | "types": ["node"]
7 | },
8 | "include": ["src/**/*.ts"],
9 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts", "src/**/files/**"]
10 | }
11 |
--------------------------------------------------------------------------------
/packages/nx-plugin/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.spec.ts",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/pierce-dom/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/pierce-dom/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/pierce-dom/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/pierce-dom/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/pierce-dom/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log - @fluentui-contrib/pierce-dom
2 |
3 | This log was last generated on Thu, 10 Apr 2025 14:11:17 GMT and should not be manually modified.
4 |
5 |
6 |
7 | ## 0.1.1
8 |
9 | Thu, 10 Apr 2025 14:11:17 GMT
10 |
11 | ### Patches
12 |
13 | - fix: normalize package dependencies (hochelmartin@gmail.com)
14 | - fix: add missing runtime @swc/helper dependency (hochelmartin@gmail.com)
15 |
16 | ## 0.1.0
17 |
18 | Wed, 31 Jan 2024 23:19:33 GMT
19 |
20 | ### Minor changes
21 |
22 | - Bumping pierce-dom. (marata@microsoft.com)
23 |
--------------------------------------------------------------------------------
/packages/pierce-dom/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/pierce-dom/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/pierce-dom",
3 | "version": "0.1.1",
4 | "dependencies": {
5 | "@swc/helpers": "~0.5.11"
6 | },
7 | "peerDependencies": {
8 | "@fluentui/react-components": ">=9.46.3 <10.0.0",
9 | "tabster": ">=6.0.0"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/packages/pierce-dom/stories/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/pierce-dom/stories/.gitkeep
--------------------------------------------------------------------------------
/packages/pierce-dom/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/pierce-dom/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/pierce-dom/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-chat/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/react-chat/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/react-chat/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/react-chat/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/react-chat/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/react-chat/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/react-chat",
3 | "version": "0.1.11",
4 | "peerDependencies": {
5 | "@fluentui/react-components": ">=9.25.1 <10.0.0",
6 | "@fluentui/react-icons": ">=2.0.204 <3.0.0",
7 | "@types/react": ">=16.8.0 <19.0.0",
8 | "react": ">=16.8.0 <19.0.0"
9 | },
10 | "dependencies": {
11 | "@swc/helpers": "~0.5.11",
12 | "@fluentui/react-jsx-runtime": "^9.0.29"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-chat/src/components/Chat/Chat.test.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { render } from '@testing-library/react';
3 | import { Chat } from './Chat';
4 |
5 | describe('Chat', () => {
6 | it('should render', () => {
7 | render();
8 | });
9 |
10 | it('should be able to override tabster', () => {
11 | const { container } = render();
12 | expect(container.firstElementChild?.getAttribute('data-tabster')).toBe(
13 | 'foo'
14 | );
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/packages/react-chat/src/components/Chat/Chat.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { useChat_unstable } from './useChat';
3 | import { renderChat_unstable } from './renderChat';
4 | import { useChatStyles_unstable } from './useChatStyles.styles';
5 | import type { ChatProps } from './Chat.types';
6 | import type { ForwardRefComponent } from '@fluentui/react-components';
7 |
8 | export const Chat: ForwardRefComponent = React.forwardRef(
9 | (props, ref) => {
10 | const state = useChat_unstable(props, ref);
11 |
12 | useChatStyles_unstable(state);
13 | return renderChat_unstable(state);
14 | }
15 | );
16 |
17 | Chat.displayName = 'Chat';
18 |
--------------------------------------------------------------------------------
/packages/react-chat/src/components/Chat/Chat.types.ts:
--------------------------------------------------------------------------------
1 | import type {
2 | ComponentProps,
3 | ComponentState,
4 | Slot,
5 | } from '@fluentui/react-components';
6 |
7 | export type ChatSlots = {
8 | root: Slot<'div'>;
9 | };
10 |
11 | /**
12 | * Chat Props
13 | */
14 | export type ChatProps = ComponentProps;
15 |
16 | /**
17 | * State used in rendering Chat
18 | */
19 | export type ChatState = ComponentState;
20 | // TODO: Remove semicolon from previous line, uncomment next line, and provide union of props to pick from ChatProps.
21 | // & Required>
22 |
--------------------------------------------------------------------------------
/packages/react-chat/src/components/Chat/index.ts:
--------------------------------------------------------------------------------
1 | export * from './Chat';
2 | export * from './Chat.types';
3 | export * from './renderChat';
4 | export * from './useChat';
5 | export * from './useChatStyles.styles';
6 |
7 | export * from './useChatMoverAttribute';
8 |
--------------------------------------------------------------------------------
/packages/react-chat/src/components/Chat/renderChat.tsx:
--------------------------------------------------------------------------------
1 | /** @jsxRuntime classic */
2 | /** @jsx createElement */
3 |
4 | // eslint-disable-next-line @typescript-eslint/no-unused-vars
5 | import { createElement } from '@fluentui/react-jsx-runtime';
6 |
7 | import { assertSlots } from '@fluentui/react-components';
8 | import type { ChatState, ChatSlots } from './Chat.types';
9 |
10 | /**
11 | * Render the final JSX of Chat
12 | */
13 | export const renderChat_unstable = (state: ChatState) => {
14 | assertSlots(state);
15 |
16 | return ;
17 | };
18 |
--------------------------------------------------------------------------------
/packages/react-chat/src/components/Chat/useChatMoverAttribute.tsx:
--------------------------------------------------------------------------------
1 | import { useArrowNavigationGroup } from '@fluentui/react-components';
2 |
3 | export const useChatMoverAttribute_unstable = (): ReturnType<
4 | typeof useArrowNavigationGroup
5 | > =>
6 | useArrowNavigationGroup({
7 | axis: 'vertical',
8 | memorizeCurrent: true,
9 | unstable_hasDefault: true,
10 | });
11 |
--------------------------------------------------------------------------------
/packages/react-chat/src/components/ChatMessage/index.ts:
--------------------------------------------------------------------------------
1 | export * from './ChatMessage';
2 | export * from './ChatMessage.types';
3 | export * from './renderChatMessage';
4 | export * from './useChatMessage';
5 | export * from './ChatMessage.styles';
6 |
--------------------------------------------------------------------------------
/packages/react-chat/src/components/ChatMyMessage/index.ts:
--------------------------------------------------------------------------------
1 | export * from './ChatMyMessage';
2 | export * from './ChatMyMessage.types';
3 | export * from './renderChatMyMessage';
4 | export * from './useChatMyMessage';
5 | export * from './ChatMyMessage.styles';
6 |
--------------------------------------------------------------------------------
/packages/react-chat/src/components/styles/shared.styles.ts:
--------------------------------------------------------------------------------
1 | import { makeStyles, tokens } from '@fluentui/react-components';
2 |
3 | /**
4 | * This file has styles hooks shared by all chat message components
5 | */
6 |
7 | export const useDecorationClasses = makeStyles({
8 | default: {
9 | color: tokens.colorPaletteRedForeground3,
10 | },
11 | mention: {
12 | color: tokens.colorPaletteDarkOrangeForeground3,
13 | },
14 | mentionContrast: {
15 | color: tokens.colorBrandForegroundLink, // hcHyperlink '#ffff00'
16 | },
17 | });
18 |
--------------------------------------------------------------------------------
/packages/react-chat/src/components/utils/getDecorationIcon.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import {
3 | AlertUrgentFilled,
4 | ImportantFilled,
5 | MentionFilled,
6 | PeopleFilled,
7 | } from '@fluentui/react-icons';
8 |
9 | export const getDecorationIcon = (
10 | decoration?: 'important' | 'urgent' | 'mention' | 'mentionEveryone'
11 | ) => {
12 | switch (decoration) {
13 | case 'important':
14 | return ;
15 | case 'urgent':
16 | return ;
17 | case 'mention':
18 | return ;
19 | case 'mentionEveryone':
20 | return ;
21 | default:
22 | return null;
23 | }
24 | };
25 |
--------------------------------------------------------------------------------
/packages/react-chat/src/components/utils/mergeCallbacks.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * TODO - replace this with Fluent UI utility
3 | * https://github.com/microsoft/fluentui/pull/28428
4 | */
5 | export function mergeCallbacks(
6 | callback1: ((...args: Args) => void) | undefined,
7 | callback2: ((...args: Args) => void) | undefined
8 | ) {
9 | return (...args: Args) => {
10 | callback1?.(...args);
11 | callback2?.(...args);
12 | };
13 | }
14 |
--------------------------------------------------------------------------------
/packages/react-chat/stories/Chat/Default.stories.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { Avatar } from '@fluentui/react-components';
3 | import { Chat, ChatMessage, ChatMyMessage } from '@fluentui-contrib/react-chat';
4 |
5 | export const Default = () => {
6 | return (
7 |
8 |
11 | }
12 | >
13 | Hello I am Ashley
14 |
15 | Nice to meet you!
16 |
17 | );
18 | };
19 |
--------------------------------------------------------------------------------
/packages/react-chat/stories/Chat/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta } from '@storybook/react';
2 | import { Chat } from '@fluentui-contrib/react-chat';
3 | import description from '../../README.md';
4 |
5 | export { Default } from './Default.stories';
6 | export { ChatWithFocusableContent } from './ChatWithFocusableContent.stories';
7 |
8 | const meta: Meta = {
9 | title: 'Packages/react-chat/Chat',
10 | component: Chat,
11 | parameters: {
12 | docs: {
13 | description: {
14 | component: description,
15 | },
16 | },
17 | },
18 | };
19 |
20 | export default meta;
21 |
--------------------------------------------------------------------------------
/packages/react-chat/stories/ChatMessage/Decoration.stories.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { Chat, ChatMessage } from '@fluentui-contrib/react-chat';
3 |
4 | export const Decoration = () => {
5 | return (
6 |
7 | Important message
8 | Urgent message
9 | Message with mention
10 |
11 | Message mentioning everyone
12 |
13 |
14 | );
15 | };
16 |
--------------------------------------------------------------------------------
/packages/react-chat/stories/ChatMessage/Default.stories.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { Avatar } from '@fluentui/react-components';
3 | import { Chat, ChatMessage } from '@fluentui-contrib/react-chat';
4 |
5 | export const Default = () => {
6 | return (
7 |
8 |
11 | }
12 | >
13 | Hello I am Ashley
14 |
15 |
16 | );
17 | };
18 |
--------------------------------------------------------------------------------
/packages/react-chat/stories/ChatMessage/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta } from '@storybook/react';
2 | import { ChatMessage } from '@fluentui-contrib/react-chat';
3 |
4 | export { Default } from './Default.stories';
5 | export { Decoration } from './Decoration.stories';
6 | export { Slots } from './Slots.stories';
7 |
8 | const meta: Meta = {
9 | title: 'Packages/react-chat/ChatMessage',
10 | component: ChatMessage,
11 | };
12 |
13 | export default meta;
14 |
--------------------------------------------------------------------------------
/packages/react-chat/stories/ChatMyMessage/Decoration.stories.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { Chat, ChatMyMessage } from '@fluentui-contrib/react-chat';
3 |
4 | export const Decoration = () => {
5 | return (
6 |
7 | Important message
8 | Urgent message
9 |
10 | );
11 | };
12 |
--------------------------------------------------------------------------------
/packages/react-chat/stories/ChatMyMessage/Default.stories.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { Chat, ChatMyMessage } from '@fluentui-contrib/react-chat';
3 |
4 | export const Default = () => {
5 | return (
6 |
7 | Nice to meet you!
8 |
9 | );
10 | };
11 |
--------------------------------------------------------------------------------
/packages/react-chat/stories/ChatMyMessage/Status.stories.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { Chat, ChatMyMessage } from '@fluentui-contrib/react-chat';
3 |
4 | export const Status = () => {
5 | return (
6 |
7 | Failed message
8 | Sending message
9 | Received message
10 | Read message
11 | Blocked message
12 | Scheduled message
13 |
14 | );
15 | };
16 |
--------------------------------------------------------------------------------
/packages/react-chat/stories/ChatMyMessage/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta } from '@storybook/react';
2 | import { ChatMyMessage } from '@fluentui-contrib/react-chat';
3 | export { Default } from './Default.stories';
4 | export { Decoration } from './Decoration.stories';
5 | export { Status } from './Status.stories';
6 | export { Slots } from './Slots.stories';
7 |
8 | const meta: Meta = {
9 | title: 'Packages/react-chat/ChatMyMessage',
10 | component: ChatMyMessage,
11 | };
12 |
13 | export default meta;
14 |
--------------------------------------------------------------------------------
/packages/react-chat/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "jsx": "react"
5 | },
6 | "files": [],
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-chat/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-chat/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/README.md:
--------------------------------------------------------------------------------
1 | # react-contextual-pane
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Building
6 |
7 | Run `nx build react-contextual-pane` to build the library.
8 |
9 | ## Running unit tests
10 |
11 | Run `nx test react-contextual-pane` to execute the unit tests via [Jest](https://jestjs.io).
12 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/eslint.config.cjs:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.json'],
7 | rules: {
8 | '@nx/dependency-checks': [
9 | 'error',
10 | {
11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'],
12 | },
13 | ],
14 | },
15 | languageOptions: {
16 | parser: require('jsonc-eslint-parser'),
17 | },
18 | },
19 | ];
20 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.js', '**/*.jsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | ];
16 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/react-contextual-pane",
3 | "version": "0.0.1",
4 | "main": "./src/index.js",
5 | "types": "./src/index.d.ts",
6 | "dependencies": {
7 | "@swc/helpers": "~0.5.11"
8 | },
9 | "private": true,
10 | "peerDependencies": {
11 | "@fluentui/react-components": ">=9.54.13 <10.0.0",
12 | "@types/react": ">=16.8.0 <19.0.0",
13 | "react": ">=16.8.0 <19.0.0"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/src/components/Footer/Footer.styles.ts:
--------------------------------------------------------------------------------
1 | import { makeStyles } from '@fluentui/react-components';
2 |
3 | export const useStyles = makeStyles({
4 | paneFooterRoot: {
5 | alignItems: 'center',
6 | display: 'flex',
7 | justifyContent: 'space-between',
8 | width: '100%',
9 | },
10 | });
11 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/src/components/Footer/Footer.test.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { render } from '@testing-library/react';
3 | import { Footer } from './Footer';
4 |
5 | describe('Footer', () => {
6 | it('should render', () => {
7 | render();
8 | });
9 | });
10 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/src/components/Footer/index.ts:
--------------------------------------------------------------------------------
1 | export * from './Footer';
2 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/src/components/Header/Header.test.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { render } from '@testing-library/react';
3 | import { Header } from './Header';
4 |
5 | describe('Header', () => {
6 | it('should render', () => {
7 | render();
8 | });
9 | });
10 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/src/components/Header/index.ts:
--------------------------------------------------------------------------------
1 | export * from './Header';
2 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/src/index.ts:
--------------------------------------------------------------------------------
1 | export { Footer } from './components/Footer';
2 | export { Header } from './components/Header';
3 | export {};
4 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/stories/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/react-contextual-pane/stories/.gitkeep
--------------------------------------------------------------------------------
/packages/react-contextual-pane/stories/Footer/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta } from '@storybook/react';
2 | import { Footer } from '@fluentui-contrib/react-contextual-pane';
3 | export { Default } from './Default.stories';
4 | export { CustomChildren } from './CustomChildren.stories';
5 |
6 | const meta = {
7 | title: 'Packages/react-contextual-pane/Footer',
8 | component: Footer,
9 | } satisfies Meta;
10 |
11 | export default meta;
12 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/stories/Header/LongTitle.stories.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { Header } from '@fluentui-contrib/react-contextual-pane';
3 | import { useStyles } from './styles';
4 |
5 | export const LongTitle = () => {
6 | const styles = useStyles();
7 |
8 | return (
9 |
10 |
11 |
12 | );
13 | };
14 |
15 | LongTitle.parameters = {
16 | docs: {
17 | source: {
18 | type: 'code',
19 | },
20 | description: {
21 | story: `When a very long title is passed it will be truncated and we have a
22 | tooltip present for it`,
23 | },
24 | },
25 | };
26 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/stories/Header/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta } from '@storybook/react';
2 | import { Header } from '@fluentui-contrib/react-contextual-pane';
3 | export { Default } from './Default.stories';
4 | export { LongTitle } from './LongTitle.stories';
5 | export { Brand } from './Brand.stories';
6 | export { Actions } from './Actions.stories';
7 | export { Truncation } from './Truncation.stories';
8 |
9 | const meta = {
10 | title: 'Packages/react-contextual-pane/Header',
11 | component: Header,
12 | } satisfies Meta;
13 |
14 | export default meta;
15 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/stories/Header/styles.ts:
--------------------------------------------------------------------------------
1 | import { makeStyles, tokens } from '@fluentui/react-components';
2 |
3 | export const useStyles = makeStyles({
4 | pane: {
5 | width: '320px',
6 | border: `1px solid ${tokens.colorNeutralStroke2}`,
7 | height: '200px',
8 | },
9 | paneFluid: {
10 | width: '100%',
11 | resize: 'horizontal',
12 | overflow: 'auto',
13 | },
14 | });
15 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/stories/Mock/mocks.styles.ts:
--------------------------------------------------------------------------------
1 | import { makeStyles } from '@fluentui/react-components';
2 |
3 | export const useStyles = makeStyles({
4 | avatarWrapper: {
5 | width: '32px',
6 | height: '32px',
7 | display: 'flex',
8 | alignItems: 'center',
9 | justifyContent: 'center',
10 | },
11 | });
12 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-contextual-pane/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/react-data-grid-react-window-grid",
3 | "version": "2.3.1",
4 | "peerDependencies": {
5 | "@fluentui/react-components": ">=9.30.0 <10.0.0",
6 | "@types/react": ">=16.8.0 <19.0.0",
7 | "react": ">=16.8.0 <19.0.0"
8 | },
9 | "dependencies": {
10 | "@swc/helpers": "~0.5.11",
11 | "react-window": "^1.8.5"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/src/components/DataGrid/DataGrid.types.ts:
--------------------------------------------------------------------------------
1 | import {
2 | DataGridProps as BaseDataGridProps,
3 | DataGridState as BaseDataGridState,
4 | } from '@fluentui/react-components';
5 | import { RefObject } from 'react';
6 | import { VariableSizeGrid, VariableSizeList } from 'react-window';
7 | export type DataGridProps = BaseDataGridProps & {
8 | bodyRef?: RefObject;
9 | headerRef?: RefObject;
10 | };
11 |
12 | export type DataGridState = BaseDataGridState &
13 | Required>;
14 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/src/components/DataGrid/index.ts:
--------------------------------------------------------------------------------
1 | export * from './DataGrid';
2 | export * from './useDataGrid';
3 | export * from './renderDataGrid';
4 | export * from './DataGrid.types';
5 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/src/components/DataGridBody/index.ts:
--------------------------------------------------------------------------------
1 | export * from './DataGridBody';
2 | export * from './DataGridBody.types';
3 | export * from './renderDataGridBody';
4 | export * from './useDataGridBody';
5 | export { dataGridBodyGridClassName } from './useDataGridBodyStyles.styles';
6 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/src/components/DataGridBody/useDataGridBodyStyles.styles.ts:
--------------------------------------------------------------------------------
1 | import type { DataGridBodyState } from './DataGridBody.types';
2 | import { useDataGridBodyStyles_unstable as useDataGridBodyStylesBase_unstable } from '@fluentui/react-components';
3 |
4 | /**
5 | * Apply styling to the DataGridBody slots based on the state
6 | */
7 | export const useDataGridBodyStyles_unstable = (
8 | state: DataGridBodyState
9 | ): DataGridBodyState => {
10 | useDataGridBodyStylesBase_unstable({ ...state, renderRow: () => null });
11 | return state;
12 | };
13 |
14 | export const dataGridBodyGridClassName =
15 | 'fui-DataGridReactWindowGridBody__grid';
16 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/src/components/DataGridCell/index.ts:
--------------------------------------------------------------------------------
1 | export * from './DataGridCell';
2 | export * from './useDataGridCell';
3 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/src/components/DataGridHeaderCell/DataGridHeaderCell.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import {
3 | useDataGridHeaderCell_unstable,
4 | useDataGridHeaderCellStyles_unstable,
5 | DataGridHeaderCellProps,
6 | renderDataGridHeaderCell_unstable,
7 | } from '@fluentui/react-components';
8 |
9 | export const DataGridHeaderCell = React.forwardRef<
10 | HTMLDivElement,
11 | DataGridHeaderCellProps
12 | >((props, ref) => {
13 | const state = useDataGridHeaderCell_unstable(props, ref);
14 |
15 | useDataGridHeaderCellStyles_unstable(state);
16 |
17 | return renderDataGridHeaderCell_unstable(state);
18 | });
19 |
20 | DataGridHeaderCell.displayName = 'DataGridHeaderCell';
21 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/src/components/DataGridHeaderCell/index.ts:
--------------------------------------------------------------------------------
1 | export * from './DataGridHeaderCell';
2 | export * from './useDataGridHeaderCell';
3 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/src/components/DataGridHeaderRow/index.ts:
--------------------------------------------------------------------------------
1 | export * from './DataGridHeaderRow';
2 | export * from './DataGridHeaderRow.types';
3 | export * from './useDataGridHeaderRow';
4 | export { dataGridHeaderListClassName } from './renderDataGridHeaderRow';
5 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/src/contexts/bodyRefContext.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { VariableSizeGrid } from 'react-window';
3 |
4 | const bodyRefContext: React.Context<
5 | React.MutableRefObject
6 | > = React.createContext>({
7 | current: null,
8 | });
9 |
10 | export const bodyRefContextDefaultValue: React.MutableRefObject =
11 | { current: null };
12 |
13 | export const useBodyRefContext = () =>
14 | React.useContext(bodyRefContext) ?? bodyRefContextDefaultValue;
15 |
16 | export const BodyRefContextProvider = bodyRefContext.Provider;
17 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/src/contexts/columnIndexContext.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | const columnIndexContext = React.createContext(undefined);
4 |
5 | export const columnIndexContextDefaultValue: number | undefined = undefined;
6 |
7 | export const ariaColumnIndexStart = 1;
8 | export const useColumnIndexContext = () =>
9 | React.useContext(columnIndexContext) ?? columnIndexContextDefaultValue;
10 |
11 | export const ColumnIndexContextProvider = columnIndexContext.Provider;
12 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/src/contexts/rowIndexContext.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | const rowIndexContext = React.createContext(undefined);
4 |
5 | export const rowIndexContextDefaultValue: number | undefined = undefined;
6 |
7 | export const useRowIndexContext = () =>
8 | React.useContext(rowIndexContext) ?? rowIndexContextDefaultValue;
9 |
10 | export const RowIndexContextProvider = rowIndexContext.Provider;
11 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/stories/DataGrid/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta } from '@storybook/react';
2 | import { DataGrid } from '@fluentui-contrib/react-data-grid-react-window-grid';
3 | import description from '../../README.md';
4 |
5 | export { VirtualizedDataGrid } from './VirtualizedDataGrid.stories';
6 | export { DataGridScrollingIndicators } from './DataGridScrollingIndicators.stories';
7 |
8 | const meta: Meta = {
9 | title: 'Packages/react-data-grid-react-window-grid',
10 | component: DataGrid,
11 | parameters: {
12 | docs: {
13 | description: {
14 | component: description,
15 | },
16 | },
17 | },
18 | };
19 |
20 | export default meta;
21 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window-grid/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/README.md:
--------------------------------------------------------------------------------
1 | # @fluentui-contrib/react-data-grid-react-window
2 |
3 | A variant of the Fluent UI [DataGrid](https://react.fluentui.dev/?path=/docs/components-datagrid--default) that is
4 | virtualized using [react-window](https://react-window.vercel.app/#/examples/list/fixed-size).
5 |
6 | ## Try it out
7 |
8 | ```sh
9 | yarn add @fluentui-contrib/react-data-grid-react-window
10 |
11 | npm install @fluentui-contrib/react-data-grid-react-window
12 | ```
13 |
14 | For a full usage example please take a look at [The documentation sample](https://github.com/microsoft/fluentui-contrib/blob/main/packages/react-data-grid-react-window/stories/DataGrid/VirtualizedDataGrid.stories.tsx).
15 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/react-data-grid-react-window",
3 | "version": "1.3.2",
4 | "dependencies": {
5 | "@swc/helpers": "~0.5.11",
6 | "react-window": "^1.8.5"
7 | },
8 | "peerDependencies": {
9 | "@fluentui/react-components": ">=9.25.1 <10.0.0",
10 | "react": ">=16.8.0 <19.0.0"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/src/components/DataGrid/DataGrid.types.ts:
--------------------------------------------------------------------------------
1 | import type { DataGridState as DataGridStateBase } from '@fluentui/react-components';
2 |
3 | /**
4 | * State used in rendering DataGrid
5 | */
6 | export type DataGridState = DataGridStateBase & {
7 | headerRef: React.RefObject;
8 | bodyRef: React.RefObject;
9 | };
10 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/src/components/DataGrid/index.ts:
--------------------------------------------------------------------------------
1 | export * from './DataGrid';
2 | export * from './DataGrid.types';
3 | export * from './renderDataGrid';
4 | export * from './useDataGrid';
5 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/src/components/DataGridBody/index.ts:
--------------------------------------------------------------------------------
1 | export * from './DataGridBody';
2 | export * from './DataGridBody.types';
3 | export * from './renderDataGridBody';
4 | export * from './useDataGridBody';
5 | export * from './useDataGridBodyStyles.styles';
6 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/src/components/DataGridBody/useDataGridBodyStyles.styles.ts:
--------------------------------------------------------------------------------
1 | import type { DataGridBodyState } from './DataGridBody.types';
2 | import { useDataGridBodyStyles_unstable as useDataGridBodyStylesBase_unstable } from '@fluentui/react-components';
3 |
4 | /**
5 | * Apply styling to the DataGridBody slots based on the state
6 | */
7 | export const useDataGridBodyStyles_unstable = (
8 | state: DataGridBodyState
9 | ): DataGridBodyState => {
10 | useDataGridBodyStylesBase_unstable({ ...state, renderRow: () => null });
11 | return state;
12 | };
13 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/src/components/DataGridHeader/index.ts:
--------------------------------------------------------------------------------
1 | export * from './DataGridHeader';
2 | export * from './useDataGridHeader';
3 | export * from './useDataGridHeaderStyles.styles';
4 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/src/components/DataGridRow/index.ts:
--------------------------------------------------------------------------------
1 | export * from './DataGridRow';
2 | export * from './useDataGridRow';
3 | export * from './useDataGridRow.styles';
4 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/src/contexts/bodyRefContext.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | const bodyRefContext: React.Context<
4 | React.MutableRefObject
5 | > = React.createContext>({
6 | current: null,
7 | });
8 |
9 | export const bodyRefContextDefaultValue: React.MutableRefObject =
10 | { current: null };
11 |
12 | export const useBodyRefContext = () =>
13 | React.useContext(bodyRefContext) ?? bodyRefContextDefaultValue;
14 |
15 | export const BodyRefContextProvider = bodyRefContext.Provider;
16 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/src/contexts/headerRefContext.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | const headerRefContext: React.Context<
4 | React.MutableRefObject
5 | > = React.createContext>({
6 | current: null,
7 | });
8 |
9 | export const headerRefContextDefaultValue: React.MutableRefObject =
10 | { current: null };
11 |
12 | export const useHeaderRefContext = () =>
13 | React.useContext(headerRefContext) ?? headerRefContextDefaultValue;
14 |
15 | export const HeaderRefContextProvider = headerRefContext.Provider;
16 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/src/contexts/rowIndexContext.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | const rowIndexContext = React.createContext(undefined);
4 |
5 | export const tableRowIndexContextDefaultValue = undefined;
6 |
7 | export const useTableRowIndexContext = () =>
8 | React.useContext(rowIndexContext) ?? tableRowIndexContextDefaultValue;
9 |
10 | export const TableRowIndexContextProvider = rowIndexContext.Provider;
11 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true,
6 | "types": ["node"]
7 | },
8 | "include": ["src/**/*.ts"],
9 | "exclude": [
10 | "jest.config.ts",
11 | "src/**/*.test.ts",
12 | "src/**/*.test.tsx",
13 | "files/**",
14 | "**/*.stories.ts",
15 | "**/*.stories.js",
16 | "**/*.stories.jsx",
17 | "**/*.stories.tsx"
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-data-grid-react-window/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/react-draggable-dialog",
3 | "version": "0.1.2",
4 | "dependencies": {
5 | "@swc/helpers": "~0.5.11",
6 | "@dnd-kit/core": "^6.1.0",
7 | "@dnd-kit/utilities": "^3.2.2",
8 | "@dnd-kit/modifiers": "^7.0.0"
9 | },
10 | "peerDependencies": {
11 | "@fluentui/react-components": ">=9.35.1 <10.0.0",
12 | "@types/react": ">=16.8.0 <19.0.0",
13 | "react": ">=16.8.0 <19.0.0"
14 | },
15 | "beachball": {
16 | "disallowedChangeTypes": [
17 | "major",
18 | "prerelease"
19 | ]
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/playwright/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Testing Page
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/playwright/index.tsx:
--------------------------------------------------------------------------------
1 | // Import styles, initialize component theme here.
2 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/src/components/DraggableDialog/DraggableDialog.component-browser-spec.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { test, expect } from '@playwright/experimental-ct-react';
3 |
4 | test.use({ viewport: { width: 500, height: 500 } });
5 |
6 | test('should render basic component', async ({ mount }) => {
7 | const component = await mount(Example
);
8 |
9 | await expect(component).toBeVisible();
10 | });
11 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/src/components/DraggableDialog/DraggableDialog.test.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { render } from '@testing-library/react';
3 |
4 | import { DraggableDialog } from './DraggableDialog';
5 |
6 | describe('DraggableDialog', () => {
7 | it('should render', () => {
8 | const text = 'Context';
9 | const { getByText } = render(
10 |
11 | {text}
12 |
13 | );
14 |
15 | expect(() => getByText(text)).toBeTruthy();
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/src/components/DraggableDialog/index.ts:
--------------------------------------------------------------------------------
1 | export * from './DraggableDialog';
2 | export type * from './DraggableDialog.types';
3 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/src/components/DraggableDialogHandle/DraggableDialogHandle.styles.ts:
--------------------------------------------------------------------------------
1 | import { makeStyles } from '@fluentui/react-components';
2 |
3 | export const useStyles = makeStyles({
4 | root: {
5 | cursor: 'move',
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/src/components/DraggableDialogHandle/index.ts:
--------------------------------------------------------------------------------
1 | export * from './DraggableDialogHandle';
2 | export type * from './DraggableDialogHandle.types';
3 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/src/components/DraggableDialogSurface/DraggableDialogSurface.styles.ts:
--------------------------------------------------------------------------------
1 | import { makeStyles } from '@fluentui/react-components';
2 |
3 | export const useStyles = makeStyles({
4 | root: {
5 | width: 'max-content',
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/src/components/DraggableDialogSurface/DraggableDialogSurface.types.ts:
--------------------------------------------------------------------------------
1 | import { DialogSurfaceProps } from '@fluentui/react-components';
2 |
3 | export type DraggableDialogSurfaceProps = DialogSurfaceProps;
4 |
5 | export type DraggableDialogSurfaceState = {
6 | /**
7 | * Ref to the draggable dialog surface.
8 | */
9 | ref: React.RefObject;
10 |
11 | /**
12 | * Style to apply to the draggable dialog surface.
13 | */
14 | style: React.CSSProperties | undefined;
15 |
16 | /**
17 | * Where the draggable surface should be mounted on DOM
18 | */
19 | mountNode?: DraggableDialogSurfaceProps['mountNode'];
20 | };
21 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/src/components/DraggableDialogSurface/index.ts:
--------------------------------------------------------------------------------
1 | export * from './DraggableDialogSurface';
2 | export type * from './DraggableDialogSurface.types';
3 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/src/index.ts:
--------------------------------------------------------------------------------
1 | export type {
2 | DraggableDialogMargin,
3 | DraggableDialogMarginAxis,
4 | DraggableDialogMarginViewport,
5 | DraggableDialogPosition,
6 | DraggableDialogProps,
7 | } from './components/DraggableDialog';
8 | export type { DraggableDialogHandleProps } from './components/DraggableDialogHandle';
9 | export type { DraggableDialogSurfaceProps } from './components/DraggableDialogSurface';
10 |
11 | export { DraggableDialog } from './components/DraggableDialog';
12 | export { DraggableDialogHandle } from './components/DraggableDialogHandle';
13 | export { DraggableDialogSurface } from './components/DraggableDialogSurface';
14 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/src/utils/assertDialogParent.ts:
--------------------------------------------------------------------------------
1 | export const assertDialogParent = (
2 | hasParent: boolean,
3 | componentName: string
4 | ) => {
5 | if (process.env.NODE_ENV !== 'production') {
6 | if (!hasParent) {
7 | console.error(
8 | `Warning: ${componentName} is not a descendant of DraggableDialog`
9 | );
10 | }
11 | }
12 | };
13 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-draggable-dialog/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/react-gamepad-navigation",
3 | "version": "0.1.2",
4 | "main": "./src/index.js",
5 | "typings": "./src/index.d.ts",
6 | "dependencies": {
7 | "@fluentui/react-tabster": "^9.17.2",
8 | "@swc/helpers": "~0.5.11"
9 | },
10 | "peerDependencies": {
11 | "@fluentui/react-components": ">=9.56.8 <10.0.0",
12 | "@types/react": ">=16.8.0 <19.0.0",
13 | "react": ">=16.8.0 <19.0.0"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/playwright/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Testing Page
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/playwright/index.tsx:
--------------------------------------------------------------------------------
1 | // Import styles, initialize component theme here.
2 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/src/core/Constants.ts:
--------------------------------------------------------------------------------
1 | export const consolePrefix = '[GamepadNavigation]';
2 | export const selectOptionsVisibleAttribute = 'data-fui-select-options-visible';
3 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/src/hooks/useGamepadNavigationGroup.test.ts:
--------------------------------------------------------------------------------
1 | // import { renderHook } from '@testing-library/react';
2 | import { useGamepadNavigationGroup } from './useGamepadNavigationGroup';
3 |
4 | describe('useGamepadNavigationGroup', () => {
5 | it('TODO: add unit test for this hook', () => {
6 | expect(typeof useGamepadNavigationGroup).toBe('function');
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/src/index.ts:
--------------------------------------------------------------------------------
1 | export { useGamepadNavigationGroup } from './hooks/useGamepadNavigationGroup';
2 | export type { UseGamepadNavigationGroupOptions } from './hooks/useGamepadNavigationGroup';
3 | export type { GamepadNavigationOptions } from './hooks/useGamepadNavigation';
4 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/src/types/DirectionalSource.ts:
--------------------------------------------------------------------------------
1 | export const DirectionalSource = {
2 | Dpad: 'Dpad',
3 | LeftStick: 'LeftStick',
4 | ArrowKey: 'ArrowKey',
5 | } as const;
6 |
7 | export type DirectionalSource =
8 | (typeof DirectionalSource)[keyof typeof DirectionalSource];
9 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/src/types/FluentGPNShadowDOMAPI.ts:
--------------------------------------------------------------------------------
1 | import { GamepadEventHandlers } from './GamepadEventHandlers';
2 |
3 | export type FluentGPNShadowDOMAPI = {
4 | gamepadInitialized: boolean;
5 | windowId: string;
6 | eventHandlers?: GamepadEventHandlers;
7 | removeEventListeners?: () => void;
8 | };
9 |
10 | export type WindowWithFluentGPNShadowDOMAPI = Window & {
11 | __FluentGPNShadowDOMAPI?: FluentGPNShadowDOMAPI;
12 | };
13 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/src/types/FocusDirection.ts:
--------------------------------------------------------------------------------
1 | import { MoverKeys } from './Keys';
2 |
3 | export const FocusDirection = {
4 | None: 0,
5 | Up: MoverKeys.ArrowUp,
6 | Down: MoverKeys.ArrowDown,
7 | Left: MoverKeys.ArrowLeft,
8 | Right: MoverKeys.ArrowRight,
9 | } as const;
10 |
11 | export type FocusDirection =
12 | (typeof FocusDirection)[keyof typeof FocusDirection];
13 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/src/types/GamepadEventHandlers.ts:
--------------------------------------------------------------------------------
1 | export type GamepadEventHandlers = {
2 | onTouchStart: (e: TouchEvent) => void;
3 | onMouseDown: (e: MouseEvent) => void;
4 | onGamepadConnected: (e: GamepadEvent) => void;
5 | onGamepadDisconnected: (e: GamepadEvent) => void;
6 | onTargetWindowBlur: () => void;
7 | onTargetWindowFocus: () => void;
8 | };
9 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/src/types/Trigger.ts:
--------------------------------------------------------------------------------
1 | export const Trigger = {
2 | Left: 'left',
3 | Right: 'right',
4 | } as const;
5 |
6 | export type Trigger = (typeof Trigger)[keyof typeof Trigger];
7 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/stories/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/react-gamepad-navigation/stories/.gitkeep
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/stories/MultipleGroups.stories.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { Default } from './Default.stories';
3 | import { makeStyles } from '@fluentui/react-components';
4 |
5 | const useStyles = makeStyles({
6 | container: {
7 | display: 'flex',
8 | flexWrap: 'wrap',
9 | },
10 | });
11 | export const MultipleGroups = () => {
12 | const styles = useStyles();
13 | return (
14 |
15 |
16 |
17 |
18 |
19 | );
20 | };
21 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/stories/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta } from '@storybook/react';
2 | import description from '../README.md';
3 |
4 | export { Default } from './Default.stories';
5 | export { SingleElements } from './SingleElements.stories';
6 | export { ComposedElements } from './ComposedElements.stories';
7 | export { MultipleGroups } from './MultipleGroups.stories';
8 |
9 | const meta: Meta = {
10 | title: 'Packages/react-gamepad-navigation',
11 | parameters: {
12 | docs: {
13 | description: {
14 | component: description,
15 | },
16 | },
17 | layout: 'fullscreen',
18 | },
19 | };
20 |
21 | export default meta;
22 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-gamepad-navigation/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-headless-provider/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/react-headless-provider/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/react-headless-provider/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/react-headless-provider/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/react-headless-provider/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/react-headless-provider/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/react-headless-provider",
3 | "version": "1.0.3",
4 | "dependencies": {
5 | "@swc/helpers": "~0.5.11"
6 | },
7 | "peerDependencies": {
8 | "@fluentui/react-shared-contexts": ">=9.7.2 <10.0.0",
9 | "@fluentui/react-components": ">=9.25.1 <10.0.0",
10 | "@types/react": ">=16.8.0 <19.0.0",
11 | "react": ">=16.8.0 <19.0.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/react-headless-provider/src/components/HeadlessFluentProvider/HeadlessFluentProvider.test.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { render } from '@testing-library/react';
3 |
4 | import { HeadlessFluentProvider } from './HeadlessFluentProvider';
5 |
6 | describe('HeadlessFluentProvider', () => {
7 | it('should render children', () => {
8 | const { getByText } = render(
9 |
10 | Hello world!
11 |
12 | );
13 |
14 | expect(() => getByText('Hello world!')).not.toThrow();
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/packages/react-headless-provider/src/components/HeadlessFluentProvider/index.ts:
--------------------------------------------------------------------------------
1 | export * from './HeadlessFluentProvider';
2 |
--------------------------------------------------------------------------------
/packages/react-headless-provider/src/index.ts:
--------------------------------------------------------------------------------
1 | export { HeadlessFluentProvider } from './components/HeadlessFluentProvider';
2 | export {};
3 |
--------------------------------------------------------------------------------
/packages/react-headless-provider/stories/HeadlessFluentProvider/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta } from '@storybook/react';
2 | import { HeadlessFluentProvider } from '@fluentui-contrib/react-headless-provider';
3 | import description from '../../README.md';
4 |
5 | export { Default } from './Default.stories';
6 |
7 | const meta: Meta = {
8 | title: 'Packages/react-headless-provider',
9 | component: HeadlessFluentProvider,
10 | parameters: {
11 | docs: {
12 | description: {
13 | component: description,
14 | },
15 | },
16 | },
17 | };
18 |
19 | export default meta;
20 |
--------------------------------------------------------------------------------
/packages/react-headless-provider/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-headless-provider/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-headless-provider/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-interactive-tab/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/react-interactive-tab/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/react-interactive-tab/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/react-interactive-tab/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/react-interactive-tab/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/react-interactive-tab/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/react-interactive-tab",
3 | "version": "0.1.2",
4 | "main": "./src/index.js",
5 | "typings": "./src/index.d.ts",
6 | "dependencies": {
7 | "@fluentui/react-jsx-runtime": "^9.0.29",
8 | "@fluentui/react-tabs": "^9.5.0",
9 | "@swc/helpers": "~0.5.11"
10 | },
11 | "peerDependencies": {
12 | "@fluentui/react-components": ">=9.54.13 <10.0.0",
13 | "@types/react": ">=16.8.0 <19.0.0",
14 | "react": ">=16.8.0 <19.0.0"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/packages/react-interactive-tab/playwright/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Testing Page
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/react-interactive-tab/playwright/index.tsx:
--------------------------------------------------------------------------------
1 | // Import styles, initialize component theme here.
2 |
--------------------------------------------------------------------------------
/packages/react-interactive-tab/src/components/InteractiveTab/index.ts:
--------------------------------------------------------------------------------
1 | export * from './InteractiveTab';
2 | export * from './InteractiveTab.types';
3 | export * from './renderInteractiveTab';
4 | export * from './useInteractiveTab';
5 | export * from './useInteractiveTabStyles.styles';
6 |
--------------------------------------------------------------------------------
/packages/react-interactive-tab/src/index.ts:
--------------------------------------------------------------------------------
1 | export type {
2 | InteractiveTabProps,
3 | InteractiveTabSlots,
4 | InteractiveTabState,
5 | } from './components/InteractiveTab';
6 | export {
7 | InteractiveTab,
8 | interactiveTabClassNames,
9 | renderInteractiveTab_unstable,
10 | useInteractiveTabStyles_unstable,
11 | useInteractiveTab_unstable,
12 | } from './components/InteractiveTab';
13 |
--------------------------------------------------------------------------------
/packages/react-interactive-tab/stories/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/react-interactive-tab/stories/.gitkeep
--------------------------------------------------------------------------------
/packages/react-interactive-tab/stories/InteractiveTab/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta } from '@storybook/react';
2 | import { InteractiveTab } from '@fluentui-contrib/react-interactive-tab';
3 | import description from '../../README.md';
4 |
5 | export { Default } from './Default.stories';
6 |
7 | const meta = {
8 | title: 'Packages/react-interactive-tab',
9 | component: InteractiveTab,
10 | parameters: {
11 | docs: {
12 | description: {
13 | component: description,
14 | },
15 | },
16 | },
17 | } satisfies Meta;
18 |
19 | export default meta;
20 |
--------------------------------------------------------------------------------
/packages/react-interactive-tab/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-interactive-tab/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-interactive-tab/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-keytips/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/react-keytips/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/react-keytips/.storybook/manager.ts:
--------------------------------------------------------------------------------
1 | import { addons } from '@storybook/manager-api';
2 |
3 | addons.setConfig({
4 | enableShortcuts: false,
5 | });
6 |
--------------------------------------------------------------------------------
/packages/react-keytips/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/react-keytips/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/react-keytips/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/react-keytips/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/react-keytips",
3 | "version": "0.3.0",
4 | "main": "./src/index.js",
5 | "typings": "./src/index.d.ts",
6 | "peerDependencies": {
7 | "@fluentui/react-components": ">=9.46.3 <10.0.0",
8 | "@types/react": ">=16.8.0 <19.0.0",
9 | "react": ">=16.8.0 <19.0.0"
10 | },
11 | "dependencies": {
12 | "@fluentui/react-jsx-runtime": "^9.0.29",
13 | "@fluentui/react-utilities": "^9.16.0",
14 | "@fluentui/react-positioning": "^9.15.0",
15 | "@fluentui/keyboard-keys": "~9.0.6",
16 | "@swc/helpers": "~0.5.11"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-keytips/playwright/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Testing Page
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/react-keytips/playwright/index.tsx:
--------------------------------------------------------------------------------
1 | // Import styles, initialize component theme here.
2 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/Keytip.ts:
--------------------------------------------------------------------------------
1 | export * from './components/Keytip';
2 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/Keytips.ts:
--------------------------------------------------------------------------------
1 | export * from './components/Keytips';
2 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/components/Keytip/Keytip.test.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { render, screen } from '@testing-library/react';
3 | import { Keytip, keytipClassNames } from './index';
4 |
5 | describe('Keytip', () => {
6 | it('renders a default state', () => {
7 | render();
8 | const keytip = screen.getByRole('tooltip');
9 | expect(keytip.classList.contains(keytipClassNames.content)).toBeTruthy();
10 | expect(keytip.id).toBe('keytip-ktp-a');
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/components/Keytip/Keytip.tsx:
--------------------------------------------------------------------------------
1 | import { useKeytip_unstable } from './useKeytip';
2 | import { renderKeytip_unstable } from './renderKeytip';
3 | import type { KeytipProps } from './Keytip.types';
4 | import { useKeytipStyles_unstable } from './useKeytipStyles.styles';
5 |
6 | /**
7 | * Keytip component. Responsible for rendering an individual keytip,
8 | * is not supposed to be used directly, but is used by the Keytips component.
9 | *
10 | */
11 | export const Keytip = (props: KeytipProps) => {
12 | const state = useKeytip_unstable(props);
13 | useKeytipStyles_unstable(state);
14 |
15 | return renderKeytip_unstable(state);
16 | };
17 |
18 | Keytip.displayName = 'Keytip';
19 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/components/Keytip/index.ts:
--------------------------------------------------------------------------------
1 | export * from './Keytip';
2 | export * from './Keytip.types';
3 | export * from './renderKeytip';
4 | export * from './useKeytip';
5 | export * from './useKeytipStyles.styles';
6 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/components/Keytip/internal/Keytip.types.ts:
--------------------------------------------------------------------------------
1 | import type { KeytipProps } from '../Keytip.types';
2 |
3 | /** @internal */
4 | export type KeytipWithId = KeytipProps & {
5 | uniqueId: string;
6 | };
7 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/components/Keytip/renderKeytip.tsx:
--------------------------------------------------------------------------------
1 | /** @jsxRuntime classic */
2 | /** @jsx createElement */
3 |
4 | import type { KeytipSlots, KeytipState } from './Keytip.types';
5 | import { assertSlots } from '@fluentui/react-utilities';
6 | // eslint-disable-next-line @typescript-eslint/no-unused-vars
7 | import { createElement } from '@fluentui/react-jsx-runtime';
8 |
9 | /**
10 | * Render the final JSX of Keytip
11 | */
12 | export const renderKeytip_unstable = (state: KeytipState) => {
13 | assertSlots(state);
14 | if (!state.shouldRenderKeytip) return null;
15 | return {state.content.children};
16 | };
17 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/components/Keytips/Keytips.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { useKeytips_unstable } from './useKeytips';
3 | import { renderKeytips_unstable } from './renderKeytips';
4 | import type { KeytipsProps } from './Keytips.types';
5 |
6 | /**
7 | * Keytips component - handles the logic for
8 | * entering and exiting keytips mode, showing all Keytips.
9 | */
10 | export const Keytips: React.FC = (props) => {
11 | const state = useKeytips_unstable(props);
12 | return renderKeytips_unstable(state);
13 | };
14 |
15 | Keytips.displayName = 'Keytips';
16 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/components/Keytips/index.ts:
--------------------------------------------------------------------------------
1 | export * from './Keytips';
2 | export * from './Keytips.types';
3 | export * from './renderKeytips';
4 | export * from './useKeytips';
5 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/docs/assets/positioning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/react-keytips/src/docs/assets/positioning.png
--------------------------------------------------------------------------------
/packages/react-keytips/src/docs/assets/style-variants.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/react-keytips/src/docs/assets/style-variants.png
--------------------------------------------------------------------------------
/packages/react-keytips/src/hooks/useHotkeys/index.ts:
--------------------------------------------------------------------------------
1 | export { useHotkeys } from './useHotkeys';
2 | export { parseHotkey } from './parseHotkey';
3 |
4 | export * from './useHotkeys.types';
5 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/hooks/useHotkeys/parseHotkey.ts:
--------------------------------------------------------------------------------
1 | const MODIFIERS = new Set(['shift', 'alt', 'control', 'meta', 'mod']);
2 |
3 | export function parseHotkey(hotkey: string) {
4 | const keys = hotkey.toLowerCase().split('+');
5 |
6 | const modifiers = {
7 | alt: keys.includes('alt'),
8 | ctrl: keys.includes('ctrl') || keys.includes('control'),
9 | shift: keys.includes('shift'),
10 | meta: keys.includes('meta'),
11 | mod: keys.includes('mod'),
12 | };
13 |
14 | const key = keys.find((k) => !MODIFIERS.has(k));
15 |
16 | return {
17 | ...modifiers,
18 | key,
19 | };
20 | }
21 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/hooks/useHotkeys/useHotkeys.types.ts:
--------------------------------------------------------------------------------
1 | type HotkeyOptions = {
2 | preventDefault?: boolean;
3 | stopPropagation?: boolean;
4 | delay?: number;
5 | };
6 |
7 | export type KeyWithModifiers = {
8 | alt: boolean;
9 | ctrl: boolean;
10 | shift: boolean;
11 | meta: boolean;
12 | mod: boolean;
13 | key?: string;
14 | };
15 |
16 | export type Hotkey = [string, (ev: KeyboardEvent) => void, HotkeyOptions?];
17 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/hooks/useIsMacOS.ts:
--------------------------------------------------------------------------------
1 | import { useFluent } from '@fluentui/react-components';
2 |
3 | export function useIsMacOS() {
4 | const { targetDocument } = useFluent();
5 | const platform =
6 | targetDocument?.defaultView?.navigator?.platform || 'Windows';
7 | const isMac = /Mac|iPod|iPhone|iPad/.test(platform);
8 |
9 | return isMac;
10 | }
11 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/utilities/index.ts:
--------------------------------------------------------------------------------
1 | export * from './sequencesToID';
2 | export * from './createNode';
3 | export * from './isTargetVisible';
4 | export * from './isDisabled';
5 | export * from './omit';
6 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/utilities/isDisabled.ts:
--------------------------------------------------------------------------------
1 | export const isDisabled = (target?: HTMLElement): boolean => {
2 | if (!target) return false;
3 |
4 | return (
5 | target.hasAttribute('disabled') ||
6 | target.getAttribute('aria-disabled')?.toLowerCase() === 'true'
7 | );
8 | };
9 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/utilities/isTargetVisible.ts:
--------------------------------------------------------------------------------
1 | import { isDisabled } from './isDisabled';
2 |
3 | export const isTargetVisible = (
4 | target?: HTMLElement | null,
5 | win?: Document['defaultView']
6 | ): boolean => {
7 | if (!target || !win) return false;
8 | if (isDisabled(target)) return false;
9 | if (
10 | target?.hasAttribute('data-overflowing') ||
11 | target?.parentElement?.hasAttribute('data-overflowing')
12 | )
13 | return false;
14 |
15 | const style = win.getComputedStyle(target);
16 | return style.display !== 'none' || style.visibility !== 'hidden';
17 | };
18 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/utilities/omit.ts:
--------------------------------------------------------------------------------
1 | export const omit = , K extends keyof T>(
2 | obj: T,
3 | keys: K[]
4 | ) => {
5 | return Object.keys(obj).reduce((result, key) => {
6 | if (!keys.includes(key as K)) {
7 | (result as T)[key as K] = obj[key];
8 | }
9 | return result;
10 | }, {} as Omit);
11 | };
12 |
--------------------------------------------------------------------------------
/packages/react-keytips/src/utilities/sequencesToID.ts:
--------------------------------------------------------------------------------
1 | import { KTP_PREFIX, KTP_SEPARATOR } from '../constants';
2 |
3 | export function sequencesToID(keySequences: string[]): string {
4 | return keySequences
5 | .reduce((prevValue: string, keySequence: string): string => {
6 | return (
7 | prevValue + KTP_SEPARATOR + keySequence.split('').join(KTP_SEPARATOR)
8 | );
9 | }, KTP_PREFIX)
10 | .toLowerCase();
11 | }
12 |
--------------------------------------------------------------------------------
/packages/react-keytips/stories/Dynamic.md:
--------------------------------------------------------------------------------
1 | If a `Keytip` triggers dynamic content that includes its own keytips, you must add the `dynamic` prop to the `useKeytipRef` for the relevant component. Additionally, the child keytips should include the parents key sequence in their key sequences.
2 |
3 | Take the case below; clicking Button 1 and Button 2 will update the text of Button3. Triggering the keytip for Button 1 or Button 2 will then also change the keytip sequence of Button 3, because it can be both a child of Button 1 or Button 2. For this to work fully, Button 1 and Button 2 should have `dynamic: true`.
4 |
--------------------------------------------------------------------------------
/packages/react-keytips/stories/Overflow/shared.types.ts:
--------------------------------------------------------------------------------
1 | import { type KeytipProps } from '@fluentui-contrib/react-keytips';
2 |
3 | export type MenuItemType = {
4 | id: string;
5 | name: string;
6 | icon?: JSX.Element;
7 | menuItems?: MenuItemType[];
8 | keytipProps: KeytipProps;
9 | disabled?: boolean;
10 | renderName?: boolean;
11 | };
12 |
--------------------------------------------------------------------------------
/packages/react-keytips/stories/Shortcuts.md:
--------------------------------------------------------------------------------
1 | Keytips with `Overflow` and `Menu` components offer special options:
2 |
3 | `hasMenu` - Indicates that the Keytip opens a submenu. If hasMenu is not provided, the Keytip will trigger `onExecute` directly instead of displaying a submenu.
4 |
5 | In this example, firing `T`, `Y` and `R` will show this functionality.
6 |
7 | ```tsx
8 | const subMenuRef = useKeytipRef({
9 | keySequences: ['y'],
10 | content: 'Y',
11 | hasMenu: true,
12 | onExecute,
13 | });
14 |
15 | const subMenuRefItem = useKeytipRef({
16 | keySequences: ['t'],
17 | content: 'T',
18 | onExecute,
19 | });
20 | ```
21 |
--------------------------------------------------------------------------------
/packages/react-keytips/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-keytips/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-keytips/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/react-resize-handle",
3 | "version": "0.7.1",
4 | "peerDependencies": {
5 | "@fluentui/react-components": ">=9.35.1 <10.0.0",
6 | "@types/react": ">=16.8.0 <19.0.0",
7 | "react": ">=16.8.0 <19.0.0"
8 | },
9 | "dependencies": {
10 | "@fluentui/react-utilities": "^9.16.0",
11 | "@swc/helpers": "~0.5.11"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/playwright/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Testing Page
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/playwright/index.tsx:
--------------------------------------------------------------------------------
1 | // Import styles, initialize component theme here.
2 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/public/demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/react-resize-handle/public/demo.gif
--------------------------------------------------------------------------------
/packages/react-resize-handle/src/index.ts:
--------------------------------------------------------------------------------
1 | export { useResizeHandle } from './hooks/useResizeHandle';
2 | export { EVENTS } from './types';
3 |
4 | export type { ResizeHandleUpdateEventData } from './types';
5 | export type { UseResizeHandleParams } from './hooks/useResizeHandle';
6 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/src/utils/clamp.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Clamps a value between a minimum and maximum range.
3 | *
4 | * @param value - The value to be clamped.
5 | * @param min - The minimum value of the range.
6 | * @param max - The maximum value of the range.
7 | * @returns The clamped value.
8 | */
9 | export function clamp(value: number, min: number, max: number) {
10 | return Math.max(Math.min(value, max), min);
11 | }
12 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/src/utils/index.ts:
--------------------------------------------------------------------------------
1 | export { clamp } from './clamp';
2 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/stories/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/react-resize-handle/stories/.gitkeep
--------------------------------------------------------------------------------
/packages/react-resize-handle/stories/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta } from '@storybook/react';
2 | import description from '../README.md';
3 |
4 | export { Default } from './Default.stories';
5 |
6 | const meta: Meta = {
7 | title: 'Packages/react-resize-handle',
8 | parameters: {
9 | docs: {
10 | description: {
11 | component: description,
12 | },
13 | },
14 | layout: 'fullscreen',
15 | },
16 | };
17 |
18 | export default meta;
19 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-resize-handle/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-shadow/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/react-shadow/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/react-shadow/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/react-shadow/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/react-shadow/README.md:
--------------------------------------------------------------------------------
1 | # @fluentui-contrib/react-shadow
2 |
3 | This package provides a React component that renders its children inside a shadow DOM.
4 |
5 | ## Installation
6 |
7 | ```bash
8 | yarn add @fluentui-contrib/react-shadow
9 | ```
10 |
11 | ## Usage
12 |
13 | ```tsx
14 | import * as React from 'react';
15 | import { root } from '@fluentui-contrib/react-shadow';
16 |
17 | export const App = () => (
18 |
19 | Shadow DOM
20 |
21 | );
22 | ```
23 |
--------------------------------------------------------------------------------
/packages/react-shadow/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/react-shadow/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/react-shadow",
3 | "version": "0.1.1",
4 | "description": "React components for Shadow DOM",
5 | "dependencies": {
6 | "@griffel/shadow-dom": "~0.2.0",
7 | "react-shadow": "^20.3.0",
8 | "@swc/helpers": "~0.5.11"
9 | },
10 | "peerDependencies": {
11 | "@fluentui/react-components": ">=9.25.1 <10.0.0",
12 | "@types/react": ">=16.8.0 <19.0.0",
13 | "react": ">=16.8.0 <19.0.0"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/react-shadow/src/index.ts:
--------------------------------------------------------------------------------
1 | export { createRoot, root } from './root';
2 |
--------------------------------------------------------------------------------
/packages/react-shadow/src/types.ts:
--------------------------------------------------------------------------------
1 | import type { Root } from 'react-shadow';
2 |
3 | export type CreateRootOptions = {
4 | insertionPoint?: CSSStyleSheet;
5 | };
6 | export type CreateRoot = (options?: CreateRootOptions) => Root;
7 | export type RootRenderFn = (props: {
8 | children: React.ReactNode;
9 | root: ShadowRoot;
10 | ssr: boolean;
11 | }) => React.ReactNode;
12 |
--------------------------------------------------------------------------------
/packages/react-shadow/stories/root/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta } from '@storybook/react';
2 | import description from '../../README.md';
3 |
4 | export { Default } from './Default.stories';
5 | export { Portals } from './Portals.stories';
6 | export { InsertionPoint } from './InsertionPoint.stories';
7 |
8 | const meta: Meta = {
9 | title: 'Packages/react-shadow',
10 | parameters: {
11 | docs: {
12 | description: {
13 | component: description,
14 | },
15 | },
16 | },
17 | };
18 |
19 | export default meta;
20 |
--------------------------------------------------------------------------------
/packages/react-shadow/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-shadow/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-shadow/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-themeless-provider/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/react-themeless-provider/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/react-themeless-provider/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/react-themeless-provider/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log - @fluentui-contrib/react-themeless-provider
2 |
3 | This log was last generated on Thu, 10 Apr 2025 14:11:17 GMT and should not be manually modified.
4 |
5 |
6 |
7 | ## 0.1.1
8 |
9 | Thu, 10 Apr 2025 14:11:17 GMT
10 |
11 | ### Patches
12 |
13 | - fix: normalize package dependencies (hochelmartin@gmail.com)
14 | - fix: bump @swc/helpers to monorepo version (hochelmartin@gmail.com)
15 |
16 | ## 0.1.0
17 |
18 | Fri, 05 Apr 2024 08:15:59 GMT
19 |
20 | ### Minor changes
21 |
22 | - feat: add ThemelessFluentProvider implementation (seanmonahan@microsoft.com)
23 |
--------------------------------------------------------------------------------
/packages/react-themeless-provider/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/react-themeless-provider/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/react-themeless-provider",
3 | "version": "0.1.1",
4 | "main": "./src/index.js",
5 | "typings": "./src/index.d.ts",
6 | "dependencies": {
7 | "@fluentui/react-jsx-runtime": "^9.0.29",
8 | "@griffel/react": "^1.5.14",
9 | "@swc/helpers": "~0.5.11"
10 | },
11 | "peerDependencies": {
12 | "@fluentui/react-components": ">=9.46.3 <10.0.0",
13 | "@fluentui/react-icons": ">=2.0.204 <3.0.0",
14 | "@fluentui/react-shared-contexts": ">=9.7.2 <10.0.0",
15 | "@types/react": ">=16.8.0 <19.0.0",
16 | "react": ">=16.8.0 <19.0.0"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-themeless-provider/src/components/ThemelessFluentProvider/index.ts:
--------------------------------------------------------------------------------
1 | export * from './ThemelessFluentProvider';
2 |
--------------------------------------------------------------------------------
/packages/react-themeless-provider/src/components/ThemelessFluentProvider/useThemelessFluentProviderStyles.styles.tsx:
--------------------------------------------------------------------------------
1 | import { mergeClasses } from '@fluentui/react-components';
2 | import type {
3 | FluentProviderSlots,
4 | FluentProviderState,
5 | SlotClassNames,
6 | } from '@fluentui/react-components';
7 |
8 | export const themelessFluentProviderClassNames: SlotClassNames =
9 | {
10 | root: 'fui-ThemelessFluentProvider',
11 | };
12 |
13 | export const useThemelessProviderStyles_unstable = (
14 | state: FluentProviderState
15 | ): FluentProviderState => {
16 | state.root.className = mergeClasses(
17 | themelessFluentProviderClassNames.root,
18 | state.root.className
19 | );
20 | return state;
21 | };
22 |
--------------------------------------------------------------------------------
/packages/react-themeless-provider/src/index.ts:
--------------------------------------------------------------------------------
1 | export { ThemelessFluentProvider } from './components/ThemelessFluentProvider';
2 | export { createCSSStyleSheetFromTheme } from './utils/createCSSStyleSheetFromTheme';
3 |
--------------------------------------------------------------------------------
/packages/react-themeless-provider/src/utils/createCSSStyleSheetFromTheme.ts:
--------------------------------------------------------------------------------
1 | import { createCSSRuleFromTheme } from '@fluentui/react-components';
2 | import type { PartialTheme } from '@fluentui/react-components';
3 |
4 | export const createCSSStyleSheetFromTheme = (
5 | rule: string,
6 | theme: PartialTheme | undefined
7 | ): CSSStyleSheet => {
8 | const cssRule = createCSSRuleFromTheme(rule, theme);
9 | const sheet = new CSSStyleSheet();
10 | sheet.insertRule(cssRule);
11 |
12 | return sheet;
13 | };
14 |
--------------------------------------------------------------------------------
/packages/react-themeless-provider/stories/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/react-themeless-provider/stories/.gitkeep
--------------------------------------------------------------------------------
/packages/react-themeless-provider/stories/ThemelessFluentProvider/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta } from '@storybook/react';
2 | import { ThemelessFluentProvider } from '@fluentui-contrib/react-themeless-provider';
3 | export { Default } from './Default.stories';
4 | import description from '../../README.md';
5 |
6 | const meta: Meta = {
7 | title: 'Packages/react-themeless-provider',
8 | component: ThemelessFluentProvider,
9 | parameters: {
10 | docs: {
11 | description: {
12 | component: description,
13 | },
14 | },
15 | },
16 | };
17 |
18 | export default meta;
19 |
--------------------------------------------------------------------------------
/packages/react-themeless-provider/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-themeless-provider/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-themeless-provider/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/README.md:
--------------------------------------------------------------------------------
1 | # @fluentui-contrib/react-tree-grid
2 |
3 | This package provides a set of styleless components to implement the `treegrid` navigation pattern.
4 |
5 | ## Installation
6 |
7 | ```bash
8 | yarn add @fluentui-contrib/react-tree-grid
9 | ```
10 |
11 | ## Usage
12 |
13 | Follow up on the [Storybook](https://microsoft.github.io/fluentui-contrib/react-tree-grid) for examples on how to use the components provided by this package.
14 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/react-tree-grid",
3 | "version": "0.2.1",
4 | "peerDependencies": {
5 | "@fluentui/react-components": ">=9.44.5 < 10.0.0",
6 | "@types/react": ">=16.8.0 <19.0.0",
7 | "react": ">=16.8.0 <19.0.0"
8 | },
9 | "dependencies": {
10 | "@swc/helpers": "~0.5.11",
11 | "@fluentui/react-jsx-runtime": "^9.0.29",
12 | "@fluentui/keyboard-keys": "~9.0.6",
13 | "@fluentui/react-tabster": "^9.17.2",
14 | "@fluentui/react-aria": "^9.13.5",
15 | "@fluentui/react-utilities": "^9.16.0"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/playwright/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Testing Page
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/playwright/index.tsx:
--------------------------------------------------------------------------------
1 | // Import styles, initialize component theme here.
2 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/src/components/TreeGrid/TreeGrid.types.ts:
--------------------------------------------------------------------------------
1 | import { ComponentProps, Slot } from '@fluentui/react-components';
2 |
3 | export type TreeGridSlots = {
4 | root: Slot<'div'>;
5 | };
6 |
7 | export type TreeGridProps = ComponentProps;
8 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/src/components/TreeGrid/index.ts:
--------------------------------------------------------------------------------
1 | export * from './TreeGrid';
2 | export * from './TreeGrid.types';
3 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/src/components/TreeGridCell/TreeGridCell.types.ts:
--------------------------------------------------------------------------------
1 | import type { ComponentProps, Slot } from '@fluentui/react-components';
2 |
3 | export type TreeGridCellSlots = {
4 | root: Slot<'div'>;
5 | };
6 | export type TreeGridCellProps = Omit<
7 | ComponentProps,
8 | 'header'
9 | > & {
10 | header?: boolean;
11 | };
12 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/src/components/TreeGridCell/index.ts:
--------------------------------------------------------------------------------
1 | export * from './TreeGridCell';
2 | export * from './TreeGridCell.types';
3 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/src/components/TreeGridInteraction/index.ts:
--------------------------------------------------------------------------------
1 | export * from './TreeGridInteraction';
2 | export * from './TreeGridInteraction.types';
3 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/src/components/TreeGridRow/index.ts:
--------------------------------------------------------------------------------
1 | export * from './TreeGridRow';
2 | export type * from './TreeGridRow.types';
3 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/src/components/TreeGridRow/useTreeGridRowStyles.styles.ts:
--------------------------------------------------------------------------------
1 | import {
2 | makeResetStyles,
3 | mergeClasses,
4 | createFocusOutlineStyle,
5 | } from '@fluentui/react-components';
6 |
7 | const useResetStyles = makeResetStyles({
8 | display: 'flex',
9 | position: 'relative',
10 | ...createFocusOutlineStyle(),
11 | });
12 |
13 | export const useTreeGridRowStyles = () =>
14 | mergeClasses('fui-TreeGridRow', useResetStyles());
15 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/src/components/TreeGridRowTrigger/index.ts:
--------------------------------------------------------------------------------
1 | export * from './TreeGridRowTrigger';
2 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/stories/a11y.md:
--------------------------------------------------------------------------------
1 | ## Accessibility
2 |
3 | Here are some accessibility edge cases scenarios we identified and users should keep in mind while using the `TreeGrid` components.
4 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-tree-grid/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/stylelint-plugin/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/stylelint-plugin/README.md:
--------------------------------------------------------------------------------
1 | # @fluentui-contrib/stylelint-plugin
2 |
3 | This stylelint plugin contains rules that are (first and foremost) applicable to Fluent UI. These rules
4 | can also be used with projects that do not use Fluent UI or [Griffel](https://griffel.js.org/), but support
5 | is not guaranteed.
6 |
7 | ## Install
8 |
9 | ```sh
10 | yarn add @fluentui-contrib/stylelint-plugin
11 |
12 | npm install @fluentui-contrib/stylelint-plugin
13 | ```
14 |
15 | ## Configuration
16 |
17 | ```js
18 | // .stylelintrc.js
19 |
20 | module.exports = {
21 | plugins: ['@fluentui-contrib/stylelint-plugin'],
22 | rules: {
23 | '@fluentui-contrib/combinator-depth': [0],
24 | },
25 | defaultSeverity: 'error',
26 | };
27 | ```
28 |
--------------------------------------------------------------------------------
/packages/stylelint-plugin/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/stylelint-plugin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/stylelint-plugin",
3 | "version": "0.2.2",
4 | "keywords": [
5 | "stylelint-plugin"
6 | ],
7 | "dependencies": {
8 | "@swc/helpers": "~0.5.11",
9 | "parsel-js": "^1.1.2"
10 | },
11 | "peerDependencies": {
12 | "stylelint": ">=14.0.0 <16.0.0"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/stylelint-plugin/src/create-rule.ts:
--------------------------------------------------------------------------------
1 | import type { Rule, RuleMessages, RuleBase } from 'stylelint';
2 | import { getDocUrl } from './get-doc-url';
3 | import { normalizeRuleName } from './normalize-rule-name';
4 |
5 | interface CreateRuleOptions {
6 | messages: RuleMessages;
7 | ruleFunction: RuleBase;
8 | ruleName: string;
9 | }
10 |
11 | export function createRule(options: CreateRuleOptions) {
12 | const { ruleFunction, ruleName, messages } = options;
13 | const rule: Rule = ruleFunction as Rule;
14 | rule.ruleName = normalizeRuleName(ruleName);
15 | rule.messages = messages;
16 | rule.meta = {
17 | url: getDocUrl(ruleName),
18 | fixable: false,
19 | deprecated: false,
20 | };
21 |
22 | return rule;
23 | }
24 |
--------------------------------------------------------------------------------
/packages/stylelint-plugin/src/get-doc-url.ts:
--------------------------------------------------------------------------------
1 | const root =
2 | 'https://github.com/microsoft/fluentui-contrib/blob/main/packages/stylelint-plugin/src/rules';
3 |
4 | export function getDocUrl(ruleName: string) {
5 | const ruleNameWithoutNamespace = ruleName
6 | .slice()
7 | .replace('@fluentui-contrib/', '');
8 | return `${root}/${ruleNameWithoutNamespace}/README.md`;
9 | }
10 |
--------------------------------------------------------------------------------
/packages/stylelint-plugin/src/index.ts:
--------------------------------------------------------------------------------
1 | import * as stylelint from 'stylelint';
2 | import combinatorDepth from './rules/combinator-depth/combinator-depth';
3 | import noFocusVisible from './rules/no-focus-visible/no-focus-visible';
4 |
5 | export default [
6 | stylelint.createPlugin(combinatorDepth.ruleName, combinatorDepth),
7 | stylelint.createPlugin(noFocusVisible.ruleName, noFocusVisible),
8 | ];
9 |
--------------------------------------------------------------------------------
/packages/stylelint-plugin/src/normalize-rule-name.ts:
--------------------------------------------------------------------------------
1 | export function normalizeRuleName(ruleName: string) {
2 | if (ruleName.startsWith('@fluentui-contrib/')) {
3 | return ruleName;
4 | }
5 |
6 | return `@fluentui-contrib/${ruleName}`;
7 | }
8 |
--------------------------------------------------------------------------------
/packages/stylelint-plugin/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/stylelint-plugin/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/stylelint-plugin/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/teams-components/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/teams-components/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/teams-components/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/teams-components/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/teams-components/README.md:
--------------------------------------------------------------------------------
1 | # teams-components
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Building
6 |
7 | Run `nx build teams-components` to build the library.
8 |
9 | ## Running unit tests
10 |
11 | Run `nx test teams-components` to execute the unit tests via [Jest](https://jestjs.io).
12 |
--------------------------------------------------------------------------------
/packages/teams-components/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/teams-components/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/teams-components",
3 | "version": "0.1.2",
4 | "dependencies": {
5 | "@swc/helpers": "~0.5.11"
6 | },
7 | "main": "./src/index.js",
8 | "typings": "./src/index.d.ts",
9 | "peerDependencies": {
10 | "@fluentui/react-components": ">=9.54.13 <10.0.0",
11 | "@types/react": ">=16.8.0 <19.0.0",
12 | "react": ">=16.8.0 <19.0.0"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/teams-components/src/components/Button/index.ts:
--------------------------------------------------------------------------------
1 | export * from './Button';
2 | export * from './validateProps';
3 |
--------------------------------------------------------------------------------
/packages/teams-components/src/components/MenuButton/MenuButton.test.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { render } from '@testing-library/react';
3 | import { MenuButton } from './MenuButton';
4 |
5 | describe('MenuButton', () => {
6 | it('should render', () => {
7 | render();
8 | });
9 | });
10 |
--------------------------------------------------------------------------------
/packages/teams-components/src/components/MenuButton/index.ts:
--------------------------------------------------------------------------------
1 | export * from './MenuButton';
2 |
--------------------------------------------------------------------------------
/packages/teams-components/src/components/ToggleButton/index.ts:
--------------------------------------------------------------------------------
1 | export * from './ToggleButton';
2 |
--------------------------------------------------------------------------------
/packages/teams-components/src/components/ToggleButton/validateProps.ts:
--------------------------------------------------------------------------------
1 | export const validateAriaPressed = (props: {
2 | 'aria-pressed'?: null | undefined;
3 | 'aria-label'?: string;
4 | 'aria-labelledby'?: string;
5 | }) => {
6 | if (
7 | 'aria-pressed' in props &&
8 | !(props['aria-label'] || props['aria-labelledby'])
9 | ) {
10 | throw new Error(
11 | '@fluentui-contrib/teams-components::ToggleButton with aria-pressed removed must have aria-label or aria-labelledby provided'
12 | );
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/packages/teams-components/src/index.ts:
--------------------------------------------------------------------------------
1 | export { MenuButton } from './components/MenuButton';
2 | export {
3 | ToggleButton,
4 | type ToggleButtonProps,
5 | } from './components/ToggleButton';
6 | export {
7 | makeStrictStyles,
8 | mergeStrictClasses,
9 | type StrictCssClass,
10 | } from './strictStyles';
11 | export { Button, type ButtonProps } from './components/Button/Button';
12 |
--------------------------------------------------------------------------------
/packages/teams-components/src/strictStyles/STRICT_SYMBOL.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Unique symbol that prevents users from creating instances of StrictCssClass.
3 | */
4 | export const STRICT_SYMBOL = Symbol('StrictCssClass');
5 |
--------------------------------------------------------------------------------
/packages/teams-components/src/strictStyles/createStrictClass.ts:
--------------------------------------------------------------------------------
1 | import { STRICT_SYMBOL } from './STRICT_SYMBOL';
2 | import type { StrictCssClass } from './types';
3 |
4 | export const createStrictClass = (className: string): StrictCssClass => {
5 | return {
6 | toString: () => className,
7 | DO_NOT_USE_OR_YOU_WILL_BE_FIRED: STRICT_SYMBOL,
8 | };
9 | };
10 |
--------------------------------------------------------------------------------
/packages/teams-components/src/strictStyles/index.ts:
--------------------------------------------------------------------------------
1 | export { makeStrictStyles } from './makeStrictStyles';
2 | export { mergeStrictClasses } from './mergeStrictClasses';
3 | export { validateStrictClasses } from './validateStrictClasses';
4 | export type { StrictCssClass, DefaultStrictStyles } from './types';
5 |
--------------------------------------------------------------------------------
/packages/teams-components/src/strictStyles/makeStrictStyles.test.ts:
--------------------------------------------------------------------------------
1 | import { makeStrictStyles } from './makeStrictStyles';
2 | import { renderHook } from '@testing-library/react';
3 |
4 | describe('makeStrictStyles', () => {
5 | it('should create strict styles', () => {
6 | const useStyles = makeStrictStyles({
7 | root: {
8 | marginInlineStart: '19px',
9 | },
10 | });
11 | const {
12 | result: { current: classes },
13 | } = renderHook(useStyles);
14 |
15 | expect(typeof classes.root).toBe('object');
16 | expect(classes.root.toString()).toEqual(expect.any(String));
17 | expect(classes.root.DO_NOT_USE_OR_YOU_WILL_BE_FIRED).toBeDefined();
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/teams-components/src/strictStyles/validateStrictClasses.ts:
--------------------------------------------------------------------------------
1 | import { STRICT_SYMBOL } from './STRICT_SYMBOL';
2 | import type { StrictCssClass } from './types';
3 |
4 | export const validateStrictClasses = (
5 | className?: StrictCssClass | false | undefined
6 | ) => {
7 | if (!className) {
8 | return;
9 | }
10 |
11 | if (className.DO_NOT_USE_OR_YOU_WILL_BE_FIRED !== STRICT_SYMBOL) {
12 | throw new Error(
13 | '@fluentui-contrib/teams-ui::This component only allows styles from makeStrictStyles'
14 | );
15 | }
16 | };
17 |
--------------------------------------------------------------------------------
/packages/teams-components/stories/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/teams-components/stories/.gitkeep
--------------------------------------------------------------------------------
/packages/teams-components/stories/Button/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta } from '@storybook/react';
2 | import { Button } from '@fluentui-contrib/teams-components';
3 | export { Default } from './Default.stories';
4 |
5 | const meta = {
6 | title: 'Packages/teams-components/Button',
7 | component: Button,
8 | } satisfies Meta;
9 |
10 | export default meta;
11 |
--------------------------------------------------------------------------------
/packages/teams-components/stories/MenuButton/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta } from '@storybook/react';
2 | import { MenuButton } from '@fluentui-contrib/teams-components';
3 | export { Default } from './Default.stories';
4 |
5 | const meta = {
6 | title: 'Packages/teams-components/MenuButton',
7 | component: MenuButton,
8 | } satisfies Meta;
9 |
10 | export default meta;
11 |
--------------------------------------------------------------------------------
/packages/teams-components/stories/ToggleButton/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta } from '@storybook/react';
2 | import { ToggleButton } from '@fluentui-contrib/teams-components';
3 | export { Default } from './Default.stories';
4 |
5 | const meta = {
6 | title: 'Packages/teams-components/ToggleButton',
7 | component: ToggleButton,
8 | } satisfies Meta;
9 |
10 | export default meta;
11 |
--------------------------------------------------------------------------------
/packages/teams-components/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/teams-components/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/teams-components/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/token-analyzer/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/token-analyzer/README.md:
--------------------------------------------------------------------------------
1 | # token-analyzer
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Building
6 |
7 | Run `nx build token-analyzer` to build the library.
8 |
9 | ## Running unit tests
10 |
11 | Run `nx test token-analyzer` to execute the unit tests via [Jest](https://jestjs.io).
12 |
--------------------------------------------------------------------------------
/packages/token-analyzer/eslint.config.cjs:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.json'],
7 | rules: {
8 | '@nx/dependency-checks': [
9 | 'error',
10 | {
11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'],
12 | },
13 | ],
14 | },
15 | languageOptions: {
16 | parser: require('jsonc-eslint-parser'),
17 | },
18 | },
19 | ];
20 |
--------------------------------------------------------------------------------
/packages/token-analyzer/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.js', '**/*.jsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | ];
16 |
--------------------------------------------------------------------------------
/packages/token-analyzer/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/token-analyzer",
3 | "version": "0.0.1",
4 | "main": "./src/index.js",
5 | "types": "./src/index.d.ts",
6 | "dependencies": {},
7 | "private": true
8 | }
9 |
--------------------------------------------------------------------------------
/packages/token-analyzer/src/index.ts:
--------------------------------------------------------------------------------
1 | export {};
2 |
--------------------------------------------------------------------------------
/packages/token-analyzer/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/token-analyzer/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/token-analyzer/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/variant-theme/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../babel.config.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/variant-theme/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from '@storybook/react-webpack5';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootConfig from '../../../.storybook/main';
5 |
6 | const config: StorybookConfig = {
7 | ...rootConfig,
8 | stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
9 | };
10 |
11 | export default config;
12 |
--------------------------------------------------------------------------------
/packages/variant-theme/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import type { Preview } from '@storybook/react';
2 |
3 | // eslint-disable-next-line @nx/enforce-module-boundaries
4 | import rootPreview from '../../../.storybook/preview';
5 |
6 | const preview: Preview = {
7 | ...rootPreview,
8 | };
9 |
10 | export default preview;
11 |
--------------------------------------------------------------------------------
/packages/variant-theme/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsc": {
3 | "target": "es2019",
4 | "parser": {
5 | "syntax": "typescript",
6 | "tsx": true,
7 | "decorators": false,
8 | "dynamicImport": false
9 | },
10 | "transform": {
11 | "react": {
12 | "runtime": "classic",
13 | "useSpread": true
14 | }
15 | },
16 | "keepClassNames": true,
17 | "externalHelpers": true,
18 | "loose": true
19 | },
20 | "sourceMaps": true,
21 | "exclude": [
22 | "jest.config.ts",
23 | ".*\\.spec.tsx?$",
24 | ".*\\.test.tsx?$",
25 | "./src/jest-setup.ts$",
26 | "./**/jest-setup.ts$",
27 | ".*.js$"
28 | ],
29 | "$schema": "https://json.schemastore.org/swcrc"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/variant-theme/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log - @fluentui-contrib/variant-theme
2 |
3 | This log was last generated on Thu, 10 Apr 2025 14:11:17 GMT and should not be manually modified.
4 |
5 |
6 |
7 | ## 0.0.4
8 |
9 | Thu, 10 Apr 2025 14:11:17 GMT
10 |
11 | ### Patches
12 |
13 | - fix: normalize package dependencies (hochelmartin@gmail.com)
14 | - fix: bump @swc/helpers to monorepo version (hochelmartin@gmail.com)
15 |
16 | ## 0.0.3
17 |
18 | Thu, 21 Nov 2024 13:13:06 GMT
19 |
20 | ### Patches
21 |
22 | - keep custom colors (rongqizhou@microsoft.com)
23 |
24 | ## 0.0.2
25 |
26 | Thu, 26 Sep 2024 08:04:30 GMT
27 |
28 | ### Patches
29 |
30 | - feat(variant-theme): prepare initial release (hochelmartin@gmail.com)
31 |
--------------------------------------------------------------------------------
/packages/variant-theme/README.md:
--------------------------------------------------------------------------------
1 | # @fluentui-contrib/variant-theme
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Building
6 |
7 | Run `nx build variant-theme` to build the library.
8 |
9 | ## Running unit tests
10 |
11 | Run `nx test variant-theme` to execute the unit tests via [Jest](https://jestjs.io).
12 |
--------------------------------------------------------------------------------
/packages/variant-theme/eslint.config.js:
--------------------------------------------------------------------------------
1 | const baseConfig = require('../../eslint.config.js');
2 |
3 | module.exports = [
4 | ...baseConfig,
5 | {
6 | files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7 | // Override or add rules here
8 | rules: {},
9 | },
10 | {
11 | files: ['**/*.ts', '**/*.tsx'],
12 | // Override or add rules here
13 | rules: {},
14 | },
15 | {
16 | files: ['**/*.js', '**/*.jsx'],
17 | // Override or add rules here
18 | rules: {},
19 | },
20 | ];
21 |
--------------------------------------------------------------------------------
/packages/variant-theme/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@fluentui-contrib/variant-theme",
3 | "version": "0.0.4",
4 | "dependencies": {
5 | "@swc/helpers": "~0.5.11",
6 | "@fluentui/scheme-utilities": "^8.3.57",
7 | "@fluentui/react-migration-v8-v9": "^9.6.22",
8 | "@fluentui/react": "^8.119.3"
9 | },
10 | "main": "./src/index.js",
11 | "typings": "./src/index.d.ts",
12 | "peerDependencies": {
13 | "@fluentui/react-components": ">=9.25.1 <10.0.0",
14 | "@types/react": ">=16.8.0 <19.0.0",
15 | "react": ">=16.8.0 <19.0.0"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/variant-theme/playwright/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Testing Page
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/variant-theme/playwright/index.tsx:
--------------------------------------------------------------------------------
1 | // Import styles, initialize component theme here.
2 |
--------------------------------------------------------------------------------
/packages/variant-theme/src/ThemeDesigner/colors/index.ts:
--------------------------------------------------------------------------------
1 | export * from './csswg';
2 | export * from './geometry';
3 | export * from './palettes';
4 | export * from './templates';
5 | export * from './types';
6 |
--------------------------------------------------------------------------------
/packages/variant-theme/src/ThemeDesigner/colors/templates.ts:
--------------------------------------------------------------------------------
1 | import { NamedPalette, NamedTheme } from './types';
2 |
3 | export const paletteTemplate = (id: string): NamedPalette & { id: string } => ({
4 | id,
5 | name: '',
6 | keyColor: [44.51, 39.05, 288.84],
7 | darkCp: 2 / 3,
8 | lightCp: 1 / 3,
9 | hueTorsion: 0,
10 | });
11 |
12 | export const themeTemplate = (id: string): NamedTheme & { id: string } => ({
13 | id,
14 | name: '',
15 | backgrounds: {},
16 | foregrounds: {},
17 | });
18 |
--------------------------------------------------------------------------------
/packages/variant-theme/src/ThemeDesigner/generated-api.ts:
--------------------------------------------------------------------------------
1 | export { hex_to_sRGB } from './colors/palettes';
2 | export { contrast } from './colors/csswg';
3 |
--------------------------------------------------------------------------------
/packages/variant-theme/src/ThemeDesigner/utils/brandColors.ts:
--------------------------------------------------------------------------------
1 | import type { BrandVariants } from '@fluentui/react-components';
2 |
3 | export const brandWeb: BrandVariants = {
4 | 10: `#061724`,
5 | 20: `#082338`,
6 | 30: `#0A2E4A`,
7 | 40: `#0C3B5E`,
8 | 50: `#0E4775`,
9 | 60: `#0F548C`,
10 | 70: `#115EA3`,
11 | 80: `#0F6CBD`,
12 | 90: `#2886DE`,
13 | 100: `#479EF5`,
14 | 110: `#62ABF5`,
15 | 120: `#77B7F7`,
16 | 130: `#96C6FA`,
17 | 140: `#B4D6FA`,
18 | 150: `#CFE4FA`,
19 | 160: `#EBF3FC`,
20 | };
21 |
--------------------------------------------------------------------------------
/packages/variant-theme/src/ThemeDesigner/utils/themeList.ts:
--------------------------------------------------------------------------------
1 | import { BrandVariants } from '@fluentui/react-components';
2 |
3 | export type ThemeList = Record;
4 |
5 | export const themeList: ThemeList = {
6 | CustomLight: {},
7 | CustomDark: {},
8 | };
9 |
10 | const lightThemes = Object.keys(themeList).map((currTheme) => {
11 | return currTheme + 'Light';
12 | });
13 | const darkThemes = Object.keys(themeList).map((currTheme) => {
14 | return currTheme + 'Dark';
15 | });
16 |
17 | const allThemes = [];
18 |
19 | for (let i = 0; i < lightThemes.length * 2; i += 2) {
20 | allThemes[i] = lightThemes[i / 2];
21 | allThemes[i + 1] = darkThemes[i / 2];
22 | }
23 |
--------------------------------------------------------------------------------
/packages/variant-theme/src/ThemeDesigner/utils/useDebounce.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable @typescript-eslint/no-explicit-any */
2 | import { useEffect, useState } from 'react';
3 |
4 | export function useDebounce(value: any, delay: number) {
5 | const [debouncedValue, setDebouncedValue] = useState(value);
6 | useEffect(() => {
7 | // eslint-disable-next-line no-restricted-globals
8 | const handler = document.defaultView?.setTimeout(() => {
9 | setDebouncedValue(value);
10 | }, delay);
11 | return () => {
12 | // eslint-disable-next-line no-restricted-globals
13 | clearTimeout(handler);
14 | };
15 | }, [value, delay]);
16 | return debouncedValue;
17 | }
18 |
--------------------------------------------------------------------------------
/packages/variant-theme/src/index.ts:
--------------------------------------------------------------------------------
1 | export { getVariantTheme } from './ThemeGenerator';
2 |
--------------------------------------------------------------------------------
/packages/variant-theme/stories/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/fluentui-contrib/e012ed2d0080f41d739e9e804c451357e584777e/packages/variant-theme/stories/.gitkeep
--------------------------------------------------------------------------------
/packages/variant-theme/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "files": [],
4 | "compilerOptions": {
5 | "jsx": "react"
6 | },
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | },
15 | {
16 | "path": "./.storybook/tsconfig.json"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/variant-theme/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true
6 | },
7 | "include": ["src/**/*.ts"],
8 | "exclude": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "files/**",
13 | "**/*.stories.ts",
14 | "**/*.stories.js",
15 | "**/*.stories.jsx",
16 | "**/*.stories.tsx"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/variant-theme/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "src/**/*.test.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fluentui-contrib",
3 | "$schema": "node_modules/nx/schemas/project-schema.json",
4 | "includedScripts": [],
5 | "targets": {
6 | "local-registry": {
7 | "executor": "@nx/js:verdaccio",
8 | "options": {
9 | "port": 4873,
10 | "config": ".verdaccio/config.yml",
11 | "storage": "tmp/local-registry/storage"
12 | }
13 | },
14 | "verify-integrity": {
15 | "command": "node ./tools/scripts/verify-repo-integrity.mjs"
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tools/scripts/preinstall.mjs:
--------------------------------------------------------------------------------
1 | main();
2 |
3 | function main() {
4 | // TODO add code if needed
5 | }
6 |
--------------------------------------------------------------------------------
/tools/tsconfig.tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "../dist/out-tsc/tools",
5 | "rootDir": ".",
6 | "module": "commonjs",
7 | "target": "es5",
8 | "types": ["node"],
9 | "importHelpers": false
10 | },
11 | "include": ["**/*.ts"]
12 | }
13 |
--------------------------------------------------------------------------------