How to use the @fluentui/react.Button.className function in @fluentui/react

To help you get started, we’ve selected a few @fluentui/react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / fluent-ui-react / docs / src / examples / components / Popup / Usage / PopupExampleCloseButton.shorthand.steps.ts View on Github external
import { Dropdown, Button } from '@fluentui/react'

const selectors = {
  toggleIndicator: `.${Dropdown.slotClassNames.toggleIndicator}`,
  item: (itemIndex: number) => `.${Dropdown.slotClassNames.itemsList} li:nth-child(${itemIndex})`,
  popupTrigger: `.${Button.className}`,
}

const config: ScreenerTestsConfig = {
  themes: ['teams', 'teamsDark', 'teamsHighContrast'],
  steps: [
    builder =>
      builder
        .click(selectors.popupTrigger)
        .click(selectors.toggleIndicator)
        .hover(selectors.item(2))
        .snapshot('Prepares to select item out of popup.')
        .click(selectors.item(2))
        .snapshot('Item should be selected.'),
  ],
}
github microsoft / fluent-ui-react / docs / src / prototypes / chatMessages / ThreadedMessages / classNames.ts View on Github external
import { Button, ChatMessage, ChatItem } from '@fluentui/react'

const classNames = {
  threadedMessage: {
    thread: `${ChatMessage.className}__thread`,
    threadBody: `${ChatMessage.className}__thread-body`,
    innerContent: `${ChatMessage.slotClassNames.content}-inner`,
    author: `${ChatMessage.slotClassNames.author}-inner`,
    timestamp: `${ChatMessage.slotClassNames.timestamp}-inner`,
  },
  threadReplies: {
    trigger: `${Button.className}__reply`,
    message: `${ChatMessage.className}__reply`,
    gutter: `${ChatItem.className}__reply__gutter`,
    chatItem: `${ChatItem.className}__reply`,
    chatItemMessage: `${ChatItem.slotClassNames.message}-reply`,
  },
  replyEditor: `${ChatMessage.className}__reply-editor`,
}

export default classNames
github microsoft / fluent-ui-react / docs / src / prototypes / chatMessages / ThreadedMessages / theme.tsx View on Github external
minWidth: '100%',
        boxShadow: 'none',
        border: 0,
        backgroundColor: siteVariables.colorScheme.brand.foreground,
        borderRadius: 'unset',
        marginBottom: 0,

        '&:focus': {
          backgroundColor: siteVariables.colorScheme.brand.foreground,
        },

        '&:hover': {
          backgroundColor: siteVariables.colorScheme.brand.foreground,
        },

        [`& .${Button.className} .${Icon.className}`]: {
          color: siteVariables.colorScheme.default.background,
        },
      }),
      header: ({ props: p, theme: { siteVariables } }) => ({
github microsoft / fluent-ui-react / docs / src / examples / components / MenuButton / Rtl / MenuButtonExample.rtl.steps.ts View on Github external
  steps: [builder => builder.click(`.${Button.className}`).snapshot('RTL: Shows menuButton')],
}
github microsoft / fluent-ui-react / docs / src / examples / components / Button / commonScreenerSteps.ts View on Github external
import { Button } from '@fluentui/react'

const button = `.${Button.className}`

const getScreenerSteps = (): ScreenerSteps => [
  builder => builder.hover(button).snapshot('Hovers the first button'),
  builder => builder.click(button).snapshot('Clicks the first button'),
  (builder, keys) => builder.keys(button, keys.tab).snapshot('Focuses on the second button'),
]

export default getScreenerSteps
github microsoft / fluent-ui-react / docs / src / examples / components / Tooltip / Rtl / TooltipExample.rtl.steps.ts View on Github external
  steps: [builder => builder.hover(`.${Button.className}`).snapshot('RTL: Shows tooltip')],
}
github microsoft / fluent-ui-react / docs / src / examples / components / Dialog / commonScreenerSteps.ts View on Github external
import { Button } from '@fluentui/react'

const button = `.${Button.className}`

const getScreenerSteps = (): ScreenerSteps => [
  builder => builder.click(button).snapshot('Clicks the trigger button'),
]

export default getScreenerSteps
github microsoft / fluent-ui-react / docs / src / examples / components / Popup / Types / PopupControlledExample.shorthand.steps.ts View on Github external
import { Button } from '@fluentui/react'

const selectors = {
  triggerButton: `.${Button.className}[title*="Open popup"]`,
  closeButton: `.${Button.className}[title*="Close"]`,
}

const config: ScreenerTestsConfig = {
  steps: [
    builder =>
      builder
        .click(selectors.triggerButton)
        .snapshot('Click on the trigger (opens popup)')
        .click(selectors.closeButton)
        .snapshot('Click on close button (closes popup)'),
  ],
}

export default config
github microsoft / fluent-ui-react / docs / src / examples / components / Tooltip / Usage / TooltipExampleTarget.shorthand.steps.ts View on Github external
    builder => builder.hover(`.${Button.className}`).snapshot('Custom target: Shows tooltip'),
  ],