How to use the @microsoft/fast-web-utilities.classNames function in @microsoft/fast-web-utilities

To help you get started, we’ve selected a few @microsoft/fast-web-utilities 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 / fast-dna / packages / fast-components-react-base / src / tabs / tabs.tsx View on Github external
protected generateTabClassNames(): TabManagedClasses {
        const { tab, tab__active }: TabsClassNameContract = this.props.managedClasses;

        return {
            managedClasses: {
                tab: classNames(tab),
                tab__active: classNames(tab__active),
            },
        };
    }
github microsoft / fast-dna / packages / fast-components-react-base / src / dialog / dialog.tsx View on Github external
public render(): React.ReactElement {
        const {
            dialog_positioningRegion,
            dialog_contentRegion,
        }: DialogClassNameContract = this.props.managedClasses;

        return (
            <div aria-hidden="{!this.props.visible}">
                <div>
                    {this.renderModalOverlay()}
                    <div aria-label="{this.props.label}" aria-labelledby="{this.props.labelledBy}" aria-describedby="{this.props.describedBy}" style="{{" tabindex="{-1}" role="dialog">
                        {this.props.children}
                    </div>
                </div></div>
github microsoft / fast-dna / packages / fast-components-react-base / src / checkbox / checkbox.tsx View on Github external
private renderLabel(): React.ReactNode {
        const { checkbox_label }: CheckboxClassNameContract = this.props.managedClasses;

        if (typeof this.props.label === "function") {
            return this.props.label(classNames(checkbox_label));
        }
    }
github microsoft / fast-dna / packages / fast-components-react-base / src / listbox-item / listbox-item.tsx View on Github external
protected generateClassNames(): string {
        const {
            listboxItem,
            listboxItem__disabled,
            listboxItem__selected,
        }: ListboxItemClassNameContract = this.props.managedClasses;

        return super.generateClassNames(
            classNames(
                listboxItem,
                [listboxItem__disabled, this.props.disabled],
                [listboxItem__selected, this.isItemSelected()]
            )
        );
    }
github microsoft / fast-dna / packages / fast-tooling-react / src / form / custom-controls / control.text-align.tsx View on Github external
private renderInput(direction: string): React.ReactNode {
        if (this.props.options &amp;&amp; Array.isArray(this.props.options)) {
            const option: string = this.props.options.find((item: string) =&gt; {
                return item === direction;
            });

            if (typeof option !== "undefined") {
                return (
                    <span>
                        <input disabled="{this.props.disabled}" checked="{this.isChecked(direction)}" aria-label="{`${direction}" name="{this.props.dataLocation}" value="{direction}" type="{&quot;radio&quot;}" id="{this.props.dataLocation}">
                    </span>
                );
            }
        }
github microsoft / fast-dna / packages / fast-tooling-react / src / form / controls / control.array.tsx View on Github external
(text: string, index: number): React.ReactNode =&gt; {
                const invalidError: React.ReactNode = this.renderValidationError(index);

                return (
                    
                        
                            {text}
                        
                        {!!this.props.displayValidationInline ? invalidError : null}
                    
                );
github microsoft / fast-dna / packages / fast-components-react-msft / src / progress / progress.tsx View on Github external
private renderCircularBackground(): JSX.Element {
        return this.renderCircle(
            classNames(this.props.managedClasses.progress_indicator)
        );
    }
github microsoft / fast-dna / packages / fast-components-react-msft / src / action-toggle / action-toggle.tsx View on Github external
protected generateClassNames(): string {
        const {
            actionToggle,
            actionToggle__disabled,
            actionToggle__selected,
            actionToggle__hasGlyphAndContent,
        }: ActionToggleClassNameContract = this.props.managedClasses;

        return super.generateClassNames(
            classNames(
                actionToggle,
                this.props.managedClasses[`actionToggle__${this.props.appearance}`],
                [actionToggle__disabled, this.props.disabled],
                [actionToggle__selected, this.state.selected],
                [actionToggle__hasGlyphAndContent, this.hasGlyphAndContent()]
            )
        );
    }
github microsoft / fast-dna / packages / fast-components-react-msft / src / flipper / flipper.tsx View on Github external
protected generateClassNames(): string {
        const {
            flipper,
            flipper__next,
            flipper__previous,
        }: FlipperClassNameContract = this.props.managedClasses;
        const isNext: boolean = this.props.direction !== FlipperDirection.previous;

        return super.generateClassNames(
            classNames(flipper, [flipper__previous, !isNext], [flipper__next, isNext])
        );
    }