Skip to content

Commit 8d04a6f

Browse files
authored
Encapsulate fast components (#29)
* Encapsulate fast-components * Upgrade dependencies * Increase server timeout * Update snapshots
1 parent 0bcaa16 commit 8d04a6f

31 files changed

+314
-209
lines changed

packages/components/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const config: PlaywrightTestConfig = {
77
webServer: {
88
command: 'yarn run start:ci',
99
url: 'http://localhost:6006/iframe.html?id=accordion--default',
10-
timeout: 120 * 1000,
10+
timeout: 5 * 60 * 1000,
1111
// It is safe to reuse the server for stories testing
1212
reuseExistingServer: true
1313
},

packages/components/src/accordion-item/accordion-item.styles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Copyright (c) Microsoft Corporation.
33
// Distributed under the terms of the Modified BSD License.
44

5-
import { accentFillFocus } from '@microsoft/fast-components';
65
import { css, ElementStyles } from '@microsoft/fast-element';
76
import {
87
AccordionItemOptions,
@@ -13,6 +12,7 @@ import {
1312
} from '@microsoft/fast-foundation';
1413
import { SystemColors } from '@microsoft/fast-web-utilities';
1514
import {
15+
accentFillFocus,
1616
bodyFont,
1717
controlCornerRadius,
1818
density,
@@ -23,7 +23,7 @@ import {
2323
strokeWidth,
2424
typeRampMinus1FontSize,
2525
typeRampMinus1LineHeight
26-
} from '@microsoft/fast-components';
26+
} from '../design-token';
2727
import { heightNumber } from '../styles/size';
2828

2929
/**

packages/components/src/avatar/avatar.styles.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
// Copyright (c) Microsoft Corporation.
33
// Distributed under the terms of the Modified BSD License.
44

5+
import { css, ElementStyles } from '@microsoft/fast-element';
6+
import {
7+
AvatarOptions,
8+
Badge,
9+
display,
10+
FoundationElementTemplate
11+
} from '@microsoft/fast-foundation';
512
import {
613
accentFillRest,
714
baseHeightMultiplier,
@@ -12,14 +19,7 @@ import {
1219
foregroundOnAccentRest,
1320
neutralForegroundRest,
1421
typeRampBaseFontSize
15-
} from '@microsoft/fast-components';
16-
import { css, ElementStyles } from '@microsoft/fast-element';
17-
import {
18-
AvatarOptions,
19-
Badge,
20-
display,
21-
FoundationElementTemplate
22-
} from '@microsoft/fast-foundation';
22+
} from '../design-token';
2323

2424
const rtl: FoundationElementTemplate<ElementStyles, AvatarOptions> = (
2525
context,

packages/components/src/avatar/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from '@microsoft/fast-foundation';
1010
import { avatarStyles as styles } from './avatar.styles';
1111

12-
export { Avatar } from '@microsoft/fast-components';
12+
export { Avatar, imgTemplate } from '@microsoft/fast-components';
1313
export { styles as avatarStyles };
1414

1515
/**

packages/components/src/badge/badge.styles.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import { css, ElementStyles } from '@microsoft/fast-element';
55
import { display, FoundationElementTemplate } from '@microsoft/fast-foundation';
66
import {
7-
accentForegroundRest,
87
bodyFont,
98
controlCornerRadius,
109
designUnit,
@@ -13,7 +12,7 @@ import {
1312
strokeWidth,
1413
typeRampMinus1FontSize,
1514
typeRampMinus1LineHeight
16-
} from '@microsoft/fast-components';
15+
} from '../design-token';
1716
import { heightNumber } from '../styles/index';
1817

1918
/**

packages/components/src/breadcrumb-item/breadcrumb-item.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
strokeWidth,
2323
typeRampBaseFontSize,
2424
typeRampBaseLineHeight
25-
} from '@microsoft/fast-components';
25+
} from '../design-token';
2626
import { heightNumber } from '../styles/index';
2727

2828
/**

packages/components/src/button/button.styles.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
// Copyright (c) Microsoft Corporation.
33
// Distributed under the terms of the Modified BSD License.
44

5+
import { css, ElementStyles } from '@microsoft/fast-element';
6+
import {
7+
ButtonOptions,
8+
disabledCursor,
9+
display,
10+
ElementDefinitionContext,
11+
focusVisible,
12+
forcedColorsStylesheetBehavior,
13+
PropertyStyleSheetBehavior
14+
} from '@microsoft/fast-foundation';
15+
import { SystemColors } from '@microsoft/fast-web-utilities';
516
import {
617
accentFillActive,
718
accentFillFocus,
@@ -15,6 +26,10 @@ import {
1526
density,
1627
designUnit,
1728
disabledOpacity,
29+
errorFillActive,
30+
errorFillFocus,
31+
errorFillHover,
32+
errorFillRest,
1833
focusStrokeWidth,
1934
foregroundOnAccentActive,
2035
foregroundOnAccentHover,
@@ -30,23 +45,6 @@ import {
3045
strokeWidth,
3146
typeRampBaseFontSize,
3247
typeRampBaseLineHeight
33-
} from '@microsoft/fast-components';
34-
import { css, ElementStyles } from '@microsoft/fast-element';
35-
import {
36-
ButtonOptions,
37-
disabledCursor,
38-
display,
39-
ElementDefinitionContext,
40-
focusVisible,
41-
forcedColorsStylesheetBehavior,
42-
PropertyStyleSheetBehavior
43-
} from '@microsoft/fast-foundation';
44-
import { SystemColors } from '@microsoft/fast-web-utilities';
45-
import {
46-
errorFillActive,
47-
errorFillFocus,
48-
errorFillHover,
49-
errorFillRest
5048
} from '../design-token';
5149
import { heightNumber } from '../styles';
5250

packages/components/src/card/card.stories.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
// Copyright (c) Jupyter Development Team.
22
// Distributed under the terms of the Modified BSD License.
33

4-
import {
5-
neutralForegroundRest,
6-
typeRampBaseFontSize
7-
} from '@microsoft/fast-components';
4+
import { neutralForegroundRest, typeRampBaseFontSize } from '../design-token';
85
import { setTheme } from '../utilities/storybook';
96

107
export default {

packages/components/src/checkbox/checkbox.styles.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
// Copyright (c) Microsoft Corporation.
33
// Distributed under the terms of the Modified BSD License.
44

5+
import { css, ElementStyles } from '@microsoft/fast-element';
6+
import {
7+
CheckboxOptions,
8+
disabledCursor,
9+
display,
10+
focusVisible,
11+
forcedColorsStylesheetBehavior,
12+
FoundationElementTemplate
13+
} from '@microsoft/fast-foundation';
14+
import { SystemColors } from '@microsoft/fast-web-utilities';
515
import {
616
accentFillActive,
717
accentFillFocus,
@@ -25,17 +35,7 @@ import {
2535
strokeWidth,
2636
typeRampBaseFontSize,
2737
typeRampBaseLineHeight
28-
} from '@microsoft/fast-components';
29-
import { css, ElementStyles } from '@microsoft/fast-element';
30-
import {
31-
CheckboxOptions,
32-
disabledCursor,
33-
display,
34-
focusVisible,
35-
forcedColorsStylesheetBehavior,
36-
FoundationElementTemplate
37-
} from '@microsoft/fast-foundation';
38-
import { SystemColors } from '@microsoft/fast-web-utilities';
38+
} from '../design-token';
3939
import { heightNumber } from '../styles/index';
4040

4141
/**

packages/components/src/colors.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ import {
1010
SwatchRGB
1111
} from '@microsoft/fast-components';
1212

13+
export {
14+
InteractiveSwatchSet,
15+
isDark,
16+
Palette,
17+
PaletteRGB,
18+
Recipe,
19+
StandardLuminance,
20+
Swatch,
21+
SwatchRGB
22+
} from '@microsoft/fast-components';
23+
1324
/*
1425
* The error palette is built using the same color algorithm as the accent palette
1526
* But by copying the algorithm from @microsoft/fast-components at commit 03d711f222bd816834a5e1d60256d3e083b27c27

0 commit comments

Comments
 (0)