How to use the adaptivecards.TextWeight function in adaptivecards

To help you get started, we’ve selected a few adaptivecards 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 / BotFramework-Emulator / packages / custom-botframework-webchat / built / Attachment.js View on Github external
if (!attachment.content || !attachment.content.media || attachment.content.media.length === 0)
                return null;
            return (React.createElement(AdaptiveCardContainer_1.default, { className: "audio", nativeCard: CardBuilder.buildCommonCard(attachment.content), onCardAction: props.onCardAction }, getRichCardContentMedia('audio', attachment.content)));
        case "application/vnd.microsoft.card.signin":
            if (!attachment.content)
                return null;
            return (React.createElement(AdaptiveCardContainer_1.default, { className: "signin", nativeCard: CardBuilder.buildCommonCard(attachment.content), onCardAction: props.onCardAction }));
        case "application/vnd.microsoft.card.oauth":
            if (!attachment.content)
                return null;
            return (React.createElement(AdaptiveCardContainer_1.default, { className: "signin", nativeCard: CardBuilder.buildOAuthCard(attachment.content), onCardAction: props.onCardAction }));
        case "application/vnd.microsoft.card.receipt":
            if (!attachment.content)
                return null;
            const receiptCardBuilder = new CardBuilder.AdaptiveCardBuilder();
            receiptCardBuilder.addTextBlock(attachment.content.title, { size: adaptivecards_1.TextSize.Medium, weight: adaptivecards_1.TextWeight.Bolder });
            const columns = receiptCardBuilder.addColumnSet([75, 25]);
            attachment.content.facts && attachment.content.facts.map((fact, i) => {
                receiptCardBuilder.addTextBlock(fact.key, { size: adaptivecards_1.TextSize.Medium }, columns[0]);
                receiptCardBuilder.addTextBlock(fact.value, { size: adaptivecards_1.TextSize.Medium, horizontalAlignment: adaptivecards_1.HorizontalAlignment.Right }, columns[1]);
            });
            attachment.content.items && attachment.content.items.map((item, i) => {
                if (item.image) {
                    const columns2 = receiptCardBuilder.addColumnSet([15, 75, 10]);
                    receiptCardBuilder.addImage(item.image.url, columns2[0], item.image.tap);
                    receiptCardBuilder.addTextBlock(item.title, { size: adaptivecards_1.TextSize.Medium, weight: adaptivecards_1.TextWeight.Bolder, wrap: true }, columns2[1]);
                    receiptCardBuilder.addTextBlock(item.subtitle, { size: adaptivecards_1.TextSize.Medium, wrap: true }, columns2[1]);
                    receiptCardBuilder.addTextBlock(item.price, { horizontalAlignment: adaptivecards_1.HorizontalAlignment.Right }, columns2[2]);
                }
                else {
                    const columns3 = receiptCardBuilder.addColumnSet([75, 25]);
                    receiptCardBuilder.addTextBlock(item.title, { size: adaptivecards_1.TextSize.Medium, weight: adaptivecards_1.TextWeight.Bolder, wrap: true }, columns3[0]);
github microsoft / AdaptiveCards / source / nodejs / adaptivecards-designer / src / containers / notifications / toast-container.ts View on Github external
maxImageHeight: 100
            },
            factSet: {
                title: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Bolder,
                    wrap: true,
                    maxWidth: 150,
                },
                value: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Default,
                    wrap: true,
                },
                spacing: 10
            }
        });
    }
}
github microsoft / AdaptiveCards / source / nodejs / adaptivecards-designer / src / containers / webchat / webchat-container.ts View on Github external
actionsOrientation: Adaptive.Orientation.Horizontal,
                actionAlignment: Adaptive.ActionAlignment.Left
            },
            adaptiveCard: {
                allowCustomStyle: false
            },
            imageSet: {
                imageSize: Adaptive.Size.Medium,
                maxImageHeight: 100
            },
            factSet: {
                title: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Bolder,
                    wrap: true,
                    maxWidth: 150
                },
                value: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Default,
                    wrap: true
                },
                spacing: 10
            }
        });
    }
}
github microsoft / AdaptiveCards / source / nodejs / adaptivecards-designer / lib / containers / host-container.js View on Github external
actionsOrientation: Adaptive.Orientation.Horizontal,
                actionAlignment: Adaptive.ActionAlignment.Left
            },
            adaptiveCard: {
                allowCustomStyle: false
            },
            imageSet: {
                imageSize: Adaptive.Size.Medium,
                maxImageHeight: 100
            },
            factSet: {
                title: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Bolder,
                    wrap: true,
                    maxWidth: 150
                },
                value: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Default,
                    wrap: true
                },
                spacing: 10
            }
        });
    };
    Object.defineProperty(HostContainer.prototype, "cardHost", {
github microsoft / BotFramework-Emulator / packages / custom-botframework-webchat / built / CardBuilder.js View on Github external
addCommonHeaders(content) {
        this.addTextBlock(content.title, { size: adaptivecards_1.TextSize.Medium, weight: adaptivecards_1.TextWeight.Bolder });
        this.addTextBlock(content.subtitle, { isSubtle: true, wrap: true });
        this.addTextBlock(content.text, { wrap: true });
    }
    addCommon(content) {
github microsoft / AdaptiveCards / source / nodejs / adaptivecards-designer / src / containers / skype / skype-container.ts View on Github external
actionsOrientation: Adaptive.Orientation.Vertical,
                actionAlignment: Adaptive.ActionAlignment.Stretch
            },
            adaptiveCard: {
                allowCustomStyle: false
            },
            imageSet: {
                imageSize: Adaptive.Size.Medium,
                maxImageHeight: 100
            },
            factSet: {
                title: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Bolder,
                    wrap: true,
                    maxWidth: 150,
                },
                value: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Default,
                    wrap: true,
                },
                spacing: 5
            }
        });
    }
}
github microsoft / AdaptiveCards / source / nodejs / adaptivecards-designer / src / containers / timeline / timeline-container.ts View on Github external
actionsOrientation: Adaptive.Orientation.Horizontal,
                actionAlignment: Adaptive.ActionAlignment.Left
            },
            adaptiveCard: {
                allowCustomStyle: false
            },
            imageSet: {
                imageSize: Adaptive.Size.Medium,
                maxImageHeight: 100
            },
            factSet: {
                title: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Bolder,
                    wrap: false,
                    maxWidth: 150,
                },
                value: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Default,
                    wrap: true,
                },
                spacing: 10
            }
        });
    }
}
github microsoft / AdaptiveCards / source / nodejs / adaptivecards-designer / src / containers / cortana-container.ts View on Github external
actionsOrientation: Adaptive.Orientation.Horizontal,
                actionAlignment: Adaptive.ActionAlignment.Stretch
            },
            adaptiveCard: {
                allowCustomStyle: false
            },
            imageSet: {
                imageSize: Adaptive.Size.Small,
                maxImageHeight: 100
            },
            factSet: {
                title: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Bolder,
                    wrap: true
                },
                value: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Default,
                    wrap: true,
                },
                spacing: 12
            }
        });
    }
}
github microsoft / AdaptiveCards / source / nodejs / adaptivecards-designer / lib / containers / host-container.js View on Github external
maxImageHeight: 100
            },
            factSet: {
                title: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Bolder,
                    wrap: true,
                    maxWidth: 150
                },
                value: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Default,
                    wrap: true
                },
                spacing: 10
            }
        });
    };
    Object.defineProperty(HostContainer.prototype, "cardHost", {
github microsoft / AdaptiveCards / source / nodejs / adaptivecards-designer / src / containers / bf-image / bf-image-container.ts View on Github external
actionsOrientation: Adaptive.Orientation.Horizontal,
                actionAlignment: Adaptive.ActionAlignment.Left
            },
            adaptiveCard: {
                allowCustomStyle: false
            },
            imageSet: {
                imageSize: Adaptive.Size.Medium,
                maxImageHeight: 100
            },
            factSet: {
                title: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Bolder,
                    wrap: true,
                    maxWidth: 150
                },
                value: {
                    color: Adaptive.TextColor.Default,
                    size: Adaptive.TextSize.Default,
                    isSubtle: false,
                    weight: Adaptive.TextWeight.Default,
                    wrap: true
                },
                spacing: 10
            }
        });
    }
}