Skip to content

Commit

Permalink
update FAST dependencies for vNext and export all base classes (#18716)
Browse files Browse the repository at this point in the history
* update latest versions

* update typings for context and definition, export base classes

* Change files
  • Loading branch information
chrisdholt committed Jul 2, 2021
1 parent b9ef05c commit c68ab8f
Show file tree
Hide file tree
Showing 70 changed files with 302 additions and 128 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "update typings for context and definition, export base classes",
"packageName": "@fluentui/web-components",
"email": "chhol@microsoft.com",
"dependentChangeType": "patch"
}
2 changes: 1 addition & 1 deletion packages/web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"dependencies": {
"@microsoft/fast-colors": "^5.1.0",
"@microsoft/fast-element": "^1.4.0",
"@microsoft/fast-foundation": "2.0.0-1",
"@microsoft/fast-foundation": "^2.0.0",
"lodash-es": "^4.17.20",
"tslib": "^1.13.0"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@microsoft/fast-element';
import { display, focusVisible, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
import { css, ElementStyles } from '@microsoft/fast-element';
import { AccordionItemOptions, display, ElementDefinitionContext, focusVisible, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
import { SystemColors } from '@microsoft/fast-web-utilities';
import {
accentFillRest,
Expand All @@ -16,7 +16,7 @@ import {
} from '../../design-tokens';
import { heightNumber } from '../../styles/size';

export const accordionItemStyles = (context, definition) =>
export const accordionItemStyles: (context: ElementDefinitionContext, definition: AccordionItemOptions) => ElementStyles = (context: ElementDefinitionContext, definition: AccordionItemOptions) =>
css`
${display('flex')} :host {
box-sizing: border-box;
Expand Down
2 changes: 2 additions & 0 deletions packages/web-components/src/accordion/accordion-item/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ export const fluentAccordionItem = AccordionItem.compose<AccordionItemOptions>({
* @public
*/
export const accordionItemStyles = styles;

export { AccordionItem };
6 changes: 3 additions & 3 deletions packages/web-components/src/accordion/accordion.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@microsoft/fast-element';
import { display } from '@microsoft/fast-foundation';
import { css, ElementStyles } from '@microsoft/fast-element';
import { display, ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
import {
bodyFont,
neutralForegroundRest,
Expand All @@ -9,7 +9,7 @@ import {
typeRampMinus1LineHeight,
} from '../design-tokens';

export const accordionStyles = (context, definition) =>
export const accordionStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles = (context: ElementDefinitionContext, definition: FoundationElementDefinition) =>
css`
${display('flex')} :host {
box-sizing: border-box;
Expand Down
6 changes: 6 additions & 0 deletions packages/web-components/src/accordion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ export const fluentAccordion = Accordion.compose({
* @public
*/
export const accordionStyles = styles;

/**
* Base class for Accordion
* @public
*/
export { Accordion };
5 changes: 3 additions & 2 deletions packages/web-components/src/anchor/anchor.styles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { css } from '@microsoft/fast-element';
import { css, ElementStyles } from '@microsoft/fast-element';
import { ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
import {
AccentButtonStyles,
baseButtonStyles,
Expand All @@ -9,7 +10,7 @@ import {
} from '../styles/';
import { appearanceBehavior } from '../utilities/behaviors';

export const anchorStyles = (context, definition) =>
export const anchorStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles = (context: ElementDefinitionContext, definition: FoundationElementDefinition) =>
css`
${baseButtonStyles(context, definition)}
`.withBehaviors(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { css } from '@microsoft/fast-element';
import { css, ElementStyles } from '@microsoft/fast-element';
import { ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';

export const anchoredRegionStyles = (context, definition) => css`
export const anchoredRegionStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles = (context: ElementDefinitionContext, definition: FoundationElementDefinition) => css`
:host {
contain: layout;
display: block;
Expand Down
6 changes: 6 additions & 0 deletions packages/web-components/src/anchored-region/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ export const fluentAnchoredRegion = AnchoredRegion.compose({
* @public
*/
export const anchoredRegionStyles = styles;

/**
* Base class for AnchoredRegion
* @public
*/
export { AnchoredRegion };
6 changes: 3 additions & 3 deletions packages/web-components/src/badge/badge.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@microsoft/fast-element';
import { display } from '@microsoft/fast-foundation';
import { css, ElementStyles } from '@microsoft/fast-element';
import { display, ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
import {
accentFillRest,
bodyFont,
Expand All @@ -12,7 +12,7 @@ import {
typeRampMinus1LineHeight,
} from '../design-tokens';

export const badgeStyles = (context, definition) =>
export const badgeStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles = (context: ElementDefinitionContext, definition: FoundationElementDefinition) =>
css`
${display('inline-block')} :host {
box-sizing: border-box;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@microsoft/fast-element';
import { display, focusVisible, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
import { css, ElementStyles } from '@microsoft/fast-element';
import { BreadcrumbItemOptions, display, ElementDefinitionContext, focusVisible, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
import { SystemColors } from '@microsoft/fast-web-utilities';
import {
accentForegroundActive,
Expand All @@ -14,7 +14,7 @@ import {
} from '../design-tokens';
import { heightNumber } from '../styles/index';

export const breadcrumbItemStyles = (context, definition) =>
export const breadcrumbItemStyles: (context: ElementDefinitionContext, definition: BreadcrumbItemOptions) => ElementStyles = (context: ElementDefinitionContext, definition: BreadcrumbItemOptions) =>
css`
${display('inline-flex')} :host {
background: transparent;
Expand Down
6 changes: 6 additions & 0 deletions packages/web-components/src/breadcrumb-item/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ export const fluentBreadcrumbItem = BreadcrumbItem.compose<BreadcrumbItemOptions
* @public
*/
export const breadcrumbItemStyles = styles;

/**
* Base class for BreadcrumbItem
* @public
*/
export { BreadcrumbItem };
6 changes: 3 additions & 3 deletions packages/web-components/src/breadcrumb/breadcrumb.styles.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { css } from '@microsoft/fast-element';
import { display } from '@microsoft/fast-foundation';
import { css, ElementStyles } from '@microsoft/fast-element';
import { display, ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
import { bodyFont, typeRampBaseFontSize, typeRampBaseLineHeight } from '../design-tokens';

export const breadcrumbStyles = (context, definition) => css`
export const breadcrumbStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles = (context: ElementDefinitionContext, definition: FoundationElementDefinition) => css`
${display('inline-block')} :host {
box-sizing: border-box;
font-family: ${bodyFont};
Expand Down
6 changes: 6 additions & 0 deletions packages/web-components/src/breadcrumb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ export const fluentBreadcrumb = Breadcrumb.compose({
* @public
*/
export const breadcrumbStyles = styles;

/**
* Base class for Breadcrumb
* @public
*/
export { Breadcrumb };
6 changes: 3 additions & 3 deletions packages/web-components/src/button/button.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@microsoft/fast-element';
import { disabledCursor, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
import { css, ElementStyles } from '@microsoft/fast-element';
import { disabledCursor, ElementDefinitionContext, forcedColorsStylesheetBehavior, FoundationElementDefinition } from '@microsoft/fast-foundation';
import { SystemColors } from '@microsoft/fast-web-utilities';
import {
AccentButtonStyles,
Expand All @@ -18,7 +18,7 @@ import {
neutralStrokeRest,
} from '../design-tokens';

export const buttonStyles = (context, definition) =>
export const buttonStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles = (context: ElementDefinitionContext, definition: FoundationElementDefinition) =>
css`
:host([disabled]),
:host([disabled]:hover),
Expand Down
6 changes: 3 additions & 3 deletions packages/web-components/src/card/card.styles.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { css } from '@microsoft/fast-element';
import { display, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
import { css, ElementStyles } from '@microsoft/fast-element';
import { display, ElementDefinitionContext, forcedColorsStylesheetBehavior, FoundationElementDefinition } from '@microsoft/fast-foundation';
import { SystemColors } from '@microsoft/fast-web-utilities';
import { elevation } from '../styles';
import { fillColor, layerCornerRadius } from '../design-tokens';

export const CardStyles = css`
export const cardStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles = (context: ElementDefinitionContext, definition: FoundationElementDefinition) => css`
${display('block')} :host {
--elevation: 4;
display: block;
Expand Down
6 changes: 3 additions & 3 deletions packages/web-components/src/card/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { parseColorHexRGB } from '@microsoft/fast-colors';
import { fillColor, neutralFillLayerRecipe, neutralPalette } from '../design-tokens';
import { Swatch, SwatchRGB } from '../color-vNext/swatch';
import { PaletteRGB } from '../color-vNext/palette';
import { CardStyles as styles } from './card.styles';
import { cardStyles as styles } from './card.styles';

/**
* @public
*/
export class Card extends FoundationCard {
/**
* Fill color for the card component. Sets context for the design system.
*
*
* Updates the neutral palette and sets the card to the source color. For tinting use neutral-palette-source instead.
* @public
* @remarks
Expand All @@ -39,7 +39,7 @@ export class Card extends FoundationCard {

/**
* Neutral palette source color for the card component. Sets context for the design system.
*
*
* This allows for tinting the card while maintaining the light or dark context. For a fixed color use card-fill-color instead.
* @public
* @remarks
Expand Down
6 changes: 3 additions & 3 deletions packages/web-components/src/checkbox/checkbox.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@microsoft/fast-element';
import { disabledCursor, display, focusVisible, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
import { css, ElementStyles } from '@microsoft/fast-element';
import { CheckboxOptions, disabledCursor, display, ElementDefinitionContext, focusVisible, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
import { SystemColors } from '@microsoft/fast-web-utilities';
import { heightNumber } from '../styles';
import {
Expand All @@ -21,7 +21,7 @@ import {
typeRampBaseLineHeight,
} from '../design-tokens';

export const checkboxStyles = (context, definition) =>
export const checkboxStyles: (context: ElementDefinitionContext, definition: CheckboxOptions) => ElementStyles = (context: ElementDefinitionContext, definition: CheckboxOptions) =>
css`
${display('inline-flex')} :host {
align-items: center;
Expand Down
6 changes: 3 additions & 3 deletions packages/web-components/src/combobox/combobox.styles.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { css } from '@microsoft/fast-element';
import { disabledCursor, focusVisible } from '@microsoft/fast-foundation';
import { css, ElementStyles } from '@microsoft/fast-element';
import { ComboboxOptions, disabledCursor, ElementDefinitionContext, focusVisible } from '@microsoft/fast-foundation';
import { selectFilledStyles, selectStyles } from '../select/select.styles';
import { appearanceBehavior } from '../utilities/behaviors';
import { strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight } from '../design-tokens';

export const comboboxStyles = (context, definition) =>
export const comboboxStyles: (context: ElementDefinitionContext, definition: ComboboxOptions) => ElementStyles = (context: ElementDefinitionContext, definition: ComboboxOptions) =>
css`
${selectStyles(context, definition)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { css } from '@microsoft/fast-element';
import { css, ElementStyles } from '@microsoft/fast-element';
import { SystemColors } from '@microsoft/fast-web-utilities';
import { focusVisible, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
import { ElementDefinitionContext, focusVisible, forcedColorsStylesheetBehavior, FoundationElementDefinition } from '@microsoft/fast-foundation';
import {
bodyFont,
controlCornerRadius,
Expand All @@ -12,7 +12,7 @@ import {
typeRampBaseLineHeight,
} from '../design-tokens';

export const dataGridCellStyles = (context, definition) =>
export const dataGridCellStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles = (context: ElementDefinitionContext, definition: FoundationElementDefinition) =>
css`
:host {
padding: calc(${designUnit} * 1px) calc(${designUnit} * 3px);
Expand Down
6 changes: 3 additions & 3 deletions packages/web-components/src/data-grid/data-grid-row.styles.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { css } from '@microsoft/fast-element';
import { forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
import { css, ElementStyles } from '@microsoft/fast-element';
import { ElementDefinitionContext, forcedColorsStylesheetBehavior, FoundationElementDefinition } from '@microsoft/fast-foundation';
import { neutralFillRest, neutralStrokeDividerRest, strokeWidth } from '../design-tokens';

export const dataGridRowStyles = (context, defintion) =>
export const dataGridRowStyles: (context: ElementDefinitionContext, defintion: FoundationElementDefinition) => ElementStyles = (context: ElementDefinitionContext, defintion: FoundationElementDefinition) =>
css`
:host {
display: grid;
Expand Down
5 changes: 3 additions & 2 deletions packages/web-components/src/data-grid/data-grid.styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { css } from '@microsoft/fast-element';
import { css, ElementStyles } from '@microsoft/fast-element';
import { ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';

export const dataGridStyles = (context, definition) => css`
export const dataGridStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles = (context: ElementDefinitionContext, definition: FoundationElementDefinition) => css`
:host {
display: flex;
position: relative;
Expand Down
6 changes: 6 additions & 0 deletions packages/web-components/src/data-grid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ export const fluentDataGrid = DataGrid.compose({
* @public
*/
export const dataGridStyles = gridStyles;

/**
* Data grid base class definitions
* @public
*/
export { DataGrid, DataGridCell, DataGridRow };
5 changes: 3 additions & 2 deletions packages/web-components/src/dialog/dialog.styles.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { css } from '@microsoft/fast-element';
import { css, ElementStyles } from '@microsoft/fast-element';
import { elevation } from '../styles';
import { fillColor, layerCornerRadius, strokeWidth } from '../design-tokens';
import { ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';

export const dialogStyles = (context, definition) => css`
export const dialogStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles = (context: ElementDefinitionContext, definition: FoundationElementDefinition) => css`
:host([hidden]) {
display: none;
}
Expand Down
6 changes: 6 additions & 0 deletions packages/web-components/src/dialog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ export const fluentDialog = Dialog.compose({
* @public
*/
export const dialogStyles = styles;

/**
* Base Dialog Class
* @public
*/
export { Dialog };
6 changes: 3 additions & 3 deletions packages/web-components/src/divider/divider.styles.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { css } from '@microsoft/fast-element';
import { display } from '@microsoft/fast-foundation';
import { css, ElementStyles } from '@microsoft/fast-element';
import { display, ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
import { designUnit, neutralStrokeDividerRest, strokeWidth } from '../design-tokens';

export const dividerStyles = (context, definition) =>
export const dividerStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles = (context: ElementDefinitionContext, definition: FoundationElementDefinition) =>
css`
${display('block')} :host {
box-sizing: content-box;
Expand Down
6 changes: 6 additions & 0 deletions packages/web-components/src/divider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ export const fluentDivider = Divider.compose({
* @public
*/
export const dividerStyles = styles;

/**
* Base class for Fluent Divider
* @public
*/
export { Divider };
6 changes: 3 additions & 3 deletions packages/web-components/src/flipper/flipper.styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@microsoft/fast-element';
import { disabledCursor, display, focusVisible, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
import { css, ElementStyles } from '@microsoft/fast-element';
import { disabledCursor, display, ElementDefinitionContext, FlipperOptions, focusVisible, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
import { SystemColors } from '@microsoft/fast-web-utilities';
import { heightNumber } from '../styles';
import {
Expand All @@ -15,7 +15,7 @@ import {
strokeWidth,
} from '../design-tokens';

export const flipperStyles = (context, definition) =>
export const flipperStyles: (context: ElementDefinitionContext, definition: FlipperOptions) => ElementStyles = (context: ElementDefinitionContext, definition: FlipperOptions) =>
css`
${display('inline-flex')} :host {
width: calc(${heightNumber} * 1px);
Expand Down
6 changes: 6 additions & 0 deletions packages/web-components/src/flipper/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ export const fluentFlipper = Flipper.compose<FlipperOptions>({
* @public
*/
export const flipperStyles = styles;

/**
* Base class for Flipper
* @public
*/
export { Flipper };
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@microsoft/fast-element';
import { display } from '@microsoft/fast-foundation';
import { css, ElementStyles } from '@microsoft/fast-element';
import { display, ElementDefinitionContext, HorizontalScrollOptions } from '@microsoft/fast-foundation';
import { DirectionalStyleSheetBehavior } from '../styles';

const ltrActionsStyles = css`
Expand Down Expand Up @@ -108,7 +108,7 @@ export const ActionsStyles = css`
* Styles handling the scroll container and content
* @public
*/
export const horizontalScrollStyles = (context, definition) => css`
export const horizontalScrollStyles: (context: ElementDefinitionContext, definition: HorizontalScrollOptions) => ElementStyles = (context: ElementDefinitionContext, definition: HorizontalScrollOptions) => css`
${display('block')} :host {
--scroll-align: center;
--scroll-item-spacing: 4px;
Expand Down
Loading

0 comments on commit c68ab8f

Please sign in to comment.