Code Monkey home page Code Monkey logo

microsoft-teams-ui-component-library's Introduction

@fluentui/react-teams

npm version

API Documentation

This library of React components implements many of the designs released in the Microsoft Teams UI Kit. With these components, your Teams app can offer accessible, high-quality experiences that align with Microsoft Teams.

Installation

This library expects a few peer dependencies; if your project doesn’t have them at these versions, you’ll need to add or upgrade them:

  • react@^16.8.0
  • react-dom@^16.8.0
  • @fluentui/react-northstar@^0.54.0

Next, simply add as a dependency to your project:

yarn add @fluentui/react-teams

or

npm i --save @fluentui/react-teams

Use TypeScript without any for these components’ props

Since the components require fairly specific, structured props, development is far easier in projects that use TypeScript. Avoid typing props passed to these components as any in order to ensure your content’s types are checked.

The API’s promises are communicated in the docs, which are derived directly from the type declarations. This library uses semver to indicate breaking changes in the API, so props that pass a type check will still work for all releases of this library with the same major version.

Getting started

Always use the provider

For these components to work properly, they need their provider.

import {Provider as RTProvider, Board } from "@fluentui/react-teams";

export default (props) => {
  
  const boardProps = getBoardProps(props)
  
  return <RTProvider themeName="teamsTheme" lang="en-US">
    <Board {...boardProps} />
  </RTProvider>
  
}

The provider accepts a themeName, which can be teamsTheme for the default (light) Teams theme, teamsDarkTheme, or teamsHighContrastTheme.

Content

Each component’s content props accept data that can be serialized to JSON. This means that instead of nesting components with fairly atomic props, components in this library don’t accept children and take props with fairly specific structures.

Consider modeling your use case after examples provided in this library’s Storybook or by examining the componnt’s TypeScript types.

Interactions

Components with interactivity accept an onInteraction handler, which calls your function any time a user triggers an event you can respond to. The handler is called with a payload (also designed to be serialized to JSON) like this:

{
  "event": "click",
  "target": "toolbar",
  "subject": ["item1", "item2"],
  "action": "delete"
}

This payload differs depending on the component and the kinds of interactions it supports; consider checking the type of onInteraction on the component you want to use in the API docs.

Localization

Developers can override all text with their own wording by providing a TTranslations object to the translations prop on the HVCThemeProvider component. US English is already built-in.

Any component props which become rendered text in the UI are defined as a TTextObject, which lets you configure what to display in supported locales.

API Docs

You can read more about each component’s specific props and their types in the API docs in the docs folder. The index for the entire project is docs/react-teams.md.

The best place to start for each component is its I{Component}Props, where Component is the component name, e.g. the main API docs for Board is IBoardProps.

Improving this library

First, clone this repository. Then install dependencies with yarn:

yarn

To start Storybook, run the start script:

yarn start

…then point your browser to:

http://localhost:3000

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

microsoft-teams-ui-component-library's People

Contributors

akatrukhin avatar asnow003 avatar automation avatar heath-hamilton avatar microsoft-github-operations[bot] avatar microsoftopensource avatar ronwang01 avatar thure avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

microsoft-teams-ui-component-library's Issues

Table sorting design increment

Table should support the aligned sorting design specified in this Figma file: Table

Sortable columns need to specify a type, which determines the copy to display for ascending/descending:

  • Alphabetic type: "A-Z" descending, "Z-A" ascending
  • DateTime type: "Newest first" descending, "Oldest first" ascending

Accessibility issue in App Studio UI tools tab

Expected behavior (Edge)
image
Google Chrome with the same screen size.
image

All these buttons/links (go to docs, install to Teams) are not visible in the Chrome browser on Windows. There is no scrollbar as well. Users should Zoom out in order to be able to install a sample app.

The icons are not showing

image

image

I'm using the list grid and the icons are not showing for me.

I'm also using the latest packages mentioned in the GitHub MD description.

Forms and Pickers don't seem to be working

Documentation says there should be picker and form components:
https://dev-int.teams.microsoft.com/storybook/main/index.html?path=/story/ui-templates-forms--kitchen-sink
https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/design/design-teams-app-basic-ui-components#picker
https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/design/design-teams-app-ui-templates#form

Are these not available in the SDK? If so, it should probably be noted in the documentation.

If they are available, could you post a quick example?

Much thanks!

SVG Avatar clip paths are occluding scollbars making scrolling impossible on web pages.

Reproduction

Use react teams provider to create your website. In my case, my app root looks like this:

ReactDOM.render(
    <React.StrictMode>
        <RTProvider themeName={TeamsTheme.Default} lang="en-US">
            <StoreProvider store={store}>
                <AppInsightsErrorBoundary
                    onError={() => <h1>I believe something went wrong</h1>}
                    appInsights={reactPlugin}>
                    <AppInsightsContext.Provider value={reactPlugin}>
                        <App />
                    </AppInsightsContext.Provider>
                </AppInsightsErrorBoundary>
            </StoreProvider>
        </RTProvider>
    </React.StrictMode>,
    document.getElementById('root')
);

Then use overflow:auto in your App to enable scrolling. Reduce size of the browser window to see the scrollbars.

Expected Behavior

When you click on the scrollbars, you should be able to drag things to scroll.

Actual Behavior

When you click on the scrollbars, nothing happens. If you try to scroll with a touch pad, it scrolls. If you try to scroll with a touch surface, it scrolls.

I'm using Chrome. This also happens in Teams task modules.

Root cause

If you look at what's blocking the click, it is this:

From https://github.com/OfficeDev/microsoft-teams-ui-component-library/blob/main/src/lib/withTheme.tsx

SVGs don't have top and left attributes. These definitions are covering up the scollbars. Setting pointer-events: none fixes it.

  <svg
    viewBox="0 0 1 1"
    style={{ position: "absolute", left: "-9999px", top: "-9999px" }}
    role="none"
  >
    <defs>
      <clipPath
        id="avatar-clip-path--hex--large"
        clipPathUnits="objectBoundingBox"
      >
        <path d="M0.781177 0.107772L0.989252 0.461033C1.00358 0.485327 1.00358 0.514647 0.989252 0.538941L0.781177 0.892202C0.765728 0.918452 0.735978 0.934783 0.703609 0.934783H0.296347C0.264007 0.934783 0.234257 0.918452 0.218808 0.892202L0.0107039 0.538941C-0.00356796 0.514647 -0.00356796 0.485327 0.0107039 0.461033L0.218808 0.107772C0.234257 0.0815495 0.264007 0.065218 0.296347 0.065218H0.703609C0.735978 0.065218 0.765728 0.0815495 0.781177 0.107772" />
      </clipPath>
      <clipPath
        id="avatar-clip-path--hex--medium"
        clipPathUnits="objectBoundingBox"
      >
        <path d="M0.781177 0.0990553L0.989252 0.460166C1.00358 0.485 1.00358 0.514972 0.989252 0.539805L0.781177 0.900916C0.765728 0.92775 0.735978 0.944444 0.703609 0.944444H0.296347C0.264007 0.944444 0.234257 0.92775 0.218808 0.900916L0.0107039 0.539805C-0.00356796 0.514972 -0.00356796 0.485 0.0107039 0.460166L0.218808 0.0990553C0.234257 0.0722498 0.264007 0.0555553 0.296347 0.0555553H0.703609C0.735978 0.0555553 0.765728 0.0722498 0.781177 0.0990553" />
      </clipPath>
      <clipPath
        id="avatar-clip-path--hex--small"
        clipPathUnits="objectBoundingBox"
      >
        <path d="M0.781177 0.10532L0.989252 0.460789C1.00358 0.485234 1.00358 0.514738 0.989252 0.539184L0.781177 0.894652C0.765728 0.921066 0.735978 0.9375 0.703609 0.9375H0.296347C0.264007 0.9375 0.234257 0.921066 0.218808 0.894652L0.0107039 0.539184C-0.00356796 0.514738 -0.00356796 0.485234 0.0107039 0.460789L0.218808 0.10532C0.234257 0.0789336 0.264007 0.0625 0.296347 0.0625H0.703609C0.735978 0.0625 0.765728 0.0789336 0.781177 0.10532Z" />
      </clipPath>
    </defs>
  </svg>

whitespace when implementing widgets in dashboards

Reproduction

I have implemented a widget with 3 tabs, as it appears in the storybook examples (https://dev-int.teams.microsoft.com/storybook/main/index.html?path=/story/ui-templates-dashboards--with-data-vizualization)

Although I have followed the guideline of the library, when implementing my example, I see a large white space under my widget, do you have any idea what it might be?

Here my dependencies:

"dependencies": {
"@fluentui/keyboard-key": "^0.3.4",
"@fluentui/react-northstar": "^0.54.0",
"@fluentui/react-teams": "5.3.0",
"@microsoft/teams-js": "^1.6.0",
"@microsoft/teamsfx": "^0.2.0",
"@types/jest": "^27.0.2",
"@types/lodash": "^4.14.176",
"@types/node": "^16.11.1",
"@types/react": "^16.8.0",
"@types/react-dom": "^16.8.0",
"@types/react-router-dom": "^5.3.1",
"axios": "^0.21.1",
"classnames": "^2.3.1",
"msteams-react-base-component": "^3.1.0",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-media-hook": "^0.4.9",
"react-router-dom": "^5.1.2",
"react-scripts": "^4.0.3",
"typescript": "^4.4.4"
},

Expected Behavior

image

Actual Behavior

image

Need deployment guide to host in azure

Hi team,
Can anyone help me out here to deploy the app and host it in Azure?
Do we have any supporting documentation or guide on how can we deploy it to Azure and make it work as a playground version?

Current package ships only ES6 module format, consider including Common-JS as well

This package currently only ships a /lib/index.js that is in the ES6 module format (e.g. using language keywords like export). This is fine for browsers, but it creates an issue for unit testing in Jest especially out of the box using create-react-app --typescript which I think could be fairly argued is the way that the majority of React developers are using to bootstrap their new projects these days.

All the other @fluentui/react-xxx libs ship with multiple module support by shipping both commonjs and es in the box under dist and then using files, main and module in their package.json definitions to guide importers to the correct ones. This then provides the best overall experience for the developer who might be using a toolchain that requires one or the other.

I would like to suggest this library follow suit and at least build and ship common-js and es modules in the package.

Adding more Northstar Icons or being able to inject Custom Icons.

I'm playing around with the library but I'm quickly limited by the Icon Component. It would be great to have some more other standard icons on it.

  switch (icon) {
    case "Add":
      iconElement = <AddIcon outline />;
      break;
    // Example the calendar Icon  
    case "Calendar":
      iconElement = <CalendarIcon outline />;
      break;

Or just to be able to inject an icon component in the config of a list or the board. Something like:

rows: {
     r4: {
       c1: "Whatever",
       actions: {
         edit: { title: "Edit", icon: "Edit" },
         duplicate: { title: "Duplicate", icon: <DuplicateIcon outline /> }
       },
     },
   },

Filter option not working on List Component

Reproduction

When using a List component with the indicated colummns key in the filter prop. Clicking the filter results in 3 different errors.

Where im clicking:
image

My props:
image

Errors:
1.

Uncaught TypeError: Cannot read property 'pendingProps' of undefined
    at hasAutofocusProp (VM8 0.chunk.js:99355)
    at Object.hasAutofocusFilter [as acceptNode] (VM8 0.chunk.js:99359)
    at VM8 0.chunk.js:99381
    at invokePassiveEffectCreate (VM8 0.chunk.js:390184)
    at HTMLUnknownElement.callCallback (VM8 0.chunk.js:370798)
    at Object.invokeGuardedCallbackDev (VM8 0.chunk.js:370847)
    at invokeGuardedCallback (VM8 0.chunk.js:370907)
    at flushPassiveEffectsImpl (VM8 0.chunk.js:390266)
    at unstable_runWithPriority (VM8 0.chunk.js:438037)
    at runWithPriority$1 (VM8 0.chunk.js:378204)
    at flushPassiveEffects (VM8 0.chunk.js:390143)
    at performSyncWorkOnRoot (VM8 0.chunk.js:388983)
    at VM8 0.chunk.js:378258
    at unstable_runWithPriority (VM8 0.chunk.js:438037)
    at runWithPriority$1 (VM8 0.chunk.js:378204)
    at flushSyncCallbackQueueImpl (VM8 0.chunk.js:378253)
    at flushSyncCallbackQueue (VM8 0.chunk.js:378241)
    at discreteUpdates$1 (VM8 0.chunk.js:389135)
    at discreteUpdates (VM8 0.chunk.js:370608)
    at dispatchDiscreteEvent (VM8 0.chunk.js:372790)

2.

0.chunk.js:394422 The above error occurred in the <Popper> component:

    at Popper (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:99478:23)
    at Transition (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:412865:30)
    at Animation (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:54465:100)
    at PortalInner (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:71368:67)
    at Popup (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:70426:100)
    at ToolbarFilter (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:111485:22)
    at div
    at Box (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:40671:27)
    at div
    at Box (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:40671:27)
    at div
    at RendererProvider (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:265025:7)
    at Provider (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:52745:15)
    at Provider (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:71496:26)
    at ToolbarTheme (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:111854:24)
    at ProviderConsumer (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:71662:24)
    at Toolbar (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:111153:28)
    at List (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:110112:66)
    at div
    at BlockUi (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:364178:5)
    at div
    at Teste (https://2245bdb4cc42.ngrok.io/static/js/main.chunk.js:1268:82)
    at GuardedRoute (https://2245bdb4cc42.ngrok.io/static/js/main.chunk.js:344:24)
    at Switch (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:410764:29)
    at div
    at RendererProvider (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:265025:7)
    at Provider (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:52745:15)
    at Provider (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:71496:26)
    at Router (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:410197:30)
    at ConnectedRouter (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:211929:7)
    at ConnectedRouterWithContext (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:212034:25)
    at Connect(ConnectedRouterWithContext) (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:406765:75)
    at App (https://2245bdb4cc42.ngrok.io/static/js/main.chunk.js:199:22)
    at Provider (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:406478:20)
    at div
    at RendererProvider (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:265025:7)
    at Provider (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:52745:15)
    at Provider (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:71496:26)
    at HVCThemeProvider (https://2245bdb4cc42.ngrok.io/static/js/0.chunk.js:112427:21)

3.

Uncaught TypeError: Cannot read property 'pendingProps' of undefined
    at hasAutofocusProp (VM8 0.chunk.js:99355)
    at Object.hasAutofocusFilter [as acceptNode] (VM8 0.chunk.js:99359)
    at VM8 0.chunk.js:99381
    at invokePassiveEffectCreate (VM8 0.chunk.js:390184)
    at HTMLUnknownElement.callCallback (VM8 0.chunk.js:370798)
    at Object.invokeGuardedCallbackDev (VM8 0.chunk.js:370847)
    at invokeGuardedCallback (VM8 0.chunk.js:370907)
    at flushPassiveEffectsImpl (VM8 0.chunk.js:390266)
    at unstable_runWithPriority (VM8 0.chunk.js:438037)
    at runWithPriority$1 (VM8 0.chunk.js:378204)
    at flushPassiveEffects (VM8 0.chunk.js:390143)
    at performSyncWorkOnRoot (VM8 0.chunk.js:388983)
    at VM8 0.chunk.js:378258
    at unstable_runWithPriority (VM8 0.chunk.js:438037)
    at runWithPriority$1 (VM8 0.chunk.js:378204)
    at flushSyncCallbackQueueImpl (VM8 0.chunk.js:378253)
    at flushSyncCallbackQueue (VM8 0.chunk.js:378241)
    at discreteUpdates$1 (VM8 0.chunk.js:389135)
    at discreteUpdates (VM8 0.chunk.js:370608)
    at dispatchDiscreteEvent (VM8 0.chunk.js:372790)

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.

Component naming

Currently components with names like Toolbar exist in both Fluent UI and as a "high-value" component for Teams.

Will developers benefit from working with different names, or should naming overlap intentionally?

Furthermore, what are our conventions around component names that are more than one word, i.e. how will we disambiguate between a part of a high-value component and an unrelated first-class high-value component, e.g. between "task board" and a hypothetical component called "board", given patterns like Table (an HVC) and TableRow (a special component of Table) are accepted?

Doughnut/Pie charts tooltip shows 100 in scientific notation (1.0e+2)

Hi,
if you have one donought or pie chart with one entry (= 100%) the tooltip shows the scientific (exponential) notation instead of 100%

Reproduction

Create a Chart with one dataset and one entry.

  <Chart
    type={EChartTypes.Doughnut}
    title='testcard'
    data={{
      labels: ['test'],
      datasets: [{
        label: 'test',
        data: [1]
      }]
    }}
  />

Expected Behavior

Tooltip should show 100% (1)

Actual Behavior

Tooltip shows 1e+2% (1)

image

List component Data Refresh

Reproduction/Problem

I'm trying to implement my own pagination system with the existing List component. My idea was to able to change the page and be able to fill the data from the database so I don't overload the client-side.
However, I'm now facing a problem... whenever I have an item on a page selected and change to the next page or update data variable.
Ex: If on page 1 or dataset 1 I selected 10 elements if I change to the next page/ dataset and it only has 9 elements I get an error.

This seems to be the table trying to fill that index that no longer exists. My question now is can I clean the selected elements in any way to avoid this problem? I don't seem to find any way to programmatically unselect these list checkboxes.

Actual Behavior

The error message:
1.Cannot read property 'actions' of undefined.
2. Sometimes just an empty blank reloaded tab inside teams

This error appears every time I try to manually change the data by updating the row variable I pass to the list. Also passing an empty array/empty data after having selected data previously shows the same issue...

Icons are not visible

Hello,
I am integrating the library in a new react project. Unfortunately, I am not able to see the Icons associated to the components. This issue is related with #59.

Reproduction

I am using these packages:
image

The results looks like this
image

import React, { Component, Suspense } from 'react';
import { Route, Switch, NavLink, useHistory } from "react-router-dom";
import { useEffect, useState } from "react";
import * as microsoftTeams from "@microsoft/teams-js";
import { Provider } from "@fluentui/react-teams";
import { themeNames } from "@fluentui/react-teams";
import ChildComponent from "./components/ChildComponent"

const initTeamsTheme = (theme: string | undefined) : themeNames => {
  switch (theme) {
    case "dark":
      return themeNames.Dark;
    case "contrast":
      return themeNames.HighContrast;
    default:
      return themeNames.Default;
  }
}

function App() {
  const [appContext, setAppContext] = useState<microsoftTeams.Context>();
  const [appAppearance, setAppAppearance] = useState<themeNames>(
    themeNames.Default
  );

  useEffect(() => {
    microsoftTeams.getContext((context) => {
      setAppContext(context);
      setAppAppearance(initTeamsTheme(context.theme));

      microsoftTeams.appInitialization.notifySuccess();
    });

    microsoftTeams.registerOnThemeChangeHandler((theme) => {
      setAppAppearance(initTeamsTheme(theme));
    });
  }, []);

  return (
    <Provider themeName={appAppearance} lang="en-US">
      <Switch>
        <Route exact path="/" component={MyStuff} />
      </Switch>
    </Provider>
  );
}

/*
class App extends Component<{}, {
  appContext?: microsoftTeams.Context,
  appAppearance: themeNames
}> {
  constructor(props: any) {
    super(props);
    this.state = {
      appAppearance: themeNames.Default,
    };
  }

  componentDidMount = (): void => {
    microsoftTeams.getContext((context) => {
      this.setState({
        appContext: context,
        appAppearance: initTeamsTheme(context.theme)
      });
      microsoftTeams.appInitialization.notifySuccess();
    });

    microsoftTeams.registerOnThemeChangeHandler((theme) => {
      this.setState({
        appAppearance: initTeamsTheme(theme)
      })
    });
  };

  render() {
    const { appAppearance } = this.state;
    return (
      <Provider themeName={appAppearance} lang="en-US">
          <Switch>
              <Route path={["/"]} exact component={MyStuff} />  
              <Route path={["/create"]} exact component={() => <React.Fragment>Wizard</React.Fragment>} />
              <Route component={() => <React.Fragment>NotFound</React.Fragment>} />
          </Switch>
      </Provider>
    );
  }
}
*/

export default App;
import React from 'react';
import { Toolbar } from '@fluentui/react-teams';

const ChildComponent: React.FunctionComponent = () => {
    const toolbarConfig = {
        actionGroups: {},
        filters: [
          {
            id: "i1",
            title: "Edible flowers",
            items: [
              { id: "i1i1", title: "Dianthus" },
              { id: "i1i2", title: "Mentha" },
              { id: "i1i3", title: "Passiflora" },
            ],
          },
          { id: "i2", title: "Podded vegetables" },
        ],
        filtersSingleSelect: true,
        find: true,
      };
  return (
    <React.Fragment>
        <Toolbar {...toolbarConfig}   />
    </React.Fragment>
  )
};

export default ChildComponent;

Not sure if I am missing a reference or some initialization. I was not able to find the steps in the documentation or the sample project.

Thank you for your help,
Patrick

In production, HVCs don't receive a theme from consumer's Fluent UI

When this package is consumed, and a developer uses e.g.:

import {Provider, teamsDarkTheme} from '@fluentui/react-northstar'
import {List} from '@fluentui/teams'

export default () => (
  <Provider theme={teamsDarkTheme}>
    <List \>
  </Provider>
)

The local theme applied for List receives {fontSizes: {}} instead of the expected dark theme. This only occurs when a consumer uses the built & packaged HVC library.

For now, the package applies the default theme if a proper global theme isn't received by the local theme, however this package should work with whatever theme the consumer supplies through the provider.

The List component and Table the columns not hiding.

image
image
My List config looks exactly the same as one from the example but for me, it's not working as expected.

const listConfig: any = {
  columns: {
    c1: {
      title: "Member name",
      sortable: "alphabetic",
      minWidth: 100,
      hideable: false
    },
    c2: {
      title: "Location",
      hideable: true,
      minWidth: 100,
      sortable: "alphabetic",
    },
    c3: {
      title: "Role",
      minWidth: 100,
      hideable: true,
      hidePriority: 1,
      sortable: "alphabetic",
    },
  },
  rows: {
    r4: {
      c1: "Babak Shammas (no delete)",
      c2: "Seattle, WA",
      c3: "Senior analyst",
      actions: {
        share: { title: "Share", icon: "ShareGeneric" },
        manage: { title: "Edit", icon: "Edit" },
      },
    },
    r1: {
      c1: "Aadi Kapoor",
      c2: "Seattle, WA",
      c3: "Security associate",
      actions: {
        share: { title: "Share", icon: "ShareGeneric" },
        manage: { title: "Edit", icon: "Edit" },
        delete: { title: "Delete", icon: "TrashCan", multi: true },
      },
    },
    r2: {
      c1: "Aaron Buxton",
      c2: "Seattle, WA",
      c3:
        "Security engineer: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras in ultricies mi. Sed aliquet odio et magna maximus, et aliquam ipsum faucibus. Sed pulvinar vel nibh eget scelerisque. Vestibulum ornare id felis ut feugiat. Ut vulputate ante non odio condimentum, eget dignissim erat tincidunt. Etiam sodales lobortis viverra. Sed gravida nisi at nisi ornare, non maximus nisi elementum.",
      actions: {
        share: { title: "Share", icon: "ShareGeneric" },
        manage: { title: "Edit", icon: "Edit" },
        delete: { title: "Delete", icon: "TrashCan", multi: true },
      },
    },
    r3: {
      c1: "Alvin Tao (no actions)",
      c2: "Seattle, WA",
      c3: "Marketing analyst",
    },
    r5: {
      c1: "Beth Davies",
      c2: "Seattle, WA",
      c3: "Senior engineer",
      actions: {
        share: { title: "Share", icon: "ShareGeneric" },
        manage: { title: "Edit", icon: "Edit" },
        delete: { title: "Delete", icon: "TrashCan", multi: true },
      },
    },
  },
  onInteraction: (e) => {
      console.log("onInteraction" ,e);
  }
};

Icons increment

All icons should use the stroke variation.

Some icons are intentionally incorrect because the correct icon is missing from @fluentui/react-northstar-icons. Once the correct icons become available, they should be used.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.