@fluentui/web-components 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +11 -2
- package/dist/dts/design-tokens.d.ts +20 -0
- package/dist/dts/styles/patterns/index.d.ts +1 -0
- package/dist/dts/styles/patterns/type-ramp.d.ts +18 -0
- package/dist/dts/utilities/type-ramp.d.ts +12 -0
- package/dist/esm/accordion/accordion-item/accordion-item.styles.js +4 -5
- package/dist/esm/accordion/accordion.styles.js +3 -4
- package/dist/esm/badge/badge.styles.js +3 -4
- package/dist/esm/breadcrumb/breadcrumb.styles.js +2 -4
- package/dist/esm/breadcrumb-item/breadcrumb-item.styles.js +3 -4
- package/dist/esm/calendar/calendar.styles.js +3 -4
- package/dist/esm/checkbox/checkbox.styles.js +3 -4
- package/dist/esm/combobox/combobox.styles.js +3 -3
- package/dist/esm/data-grid/data-grid-cell.styles.js +3 -5
- package/dist/esm/design-tokens.js +38 -1
- package/dist/esm/listbox-option/listbox-option.styles.js +3 -4
- package/dist/esm/menu-item/menu-item.styles.js +3 -4
- package/dist/esm/radio/radio.styles.js +3 -4
- package/dist/esm/search/search.styles.js +3 -4
- package/dist/esm/select/select.styles.js +3 -4
- package/dist/esm/slider-label/slider-label.styles.js +3 -2
- package/dist/esm/styles/patterns/button.styles.js +3 -4
- package/dist/esm/styles/patterns/index.js +1 -0
- package/dist/esm/styles/patterns/input.styles.js +4 -6
- package/dist/esm/styles/patterns/type-ramp.js +74 -0
- package/dist/esm/switch/switch.styles.js +4 -5
- package/dist/esm/tabs/tab/tab.styles.js +3 -5
- package/dist/esm/tabs/tab-panel/tab-panel.styles.js +3 -5
- package/dist/esm/tabs/tabs.styles.js +3 -4
- package/dist/esm/tooltip/tooltip.styles.js +3 -4
- package/dist/esm/tree-item/tree-item.styles.js +3 -4
- package/dist/esm/utilities/type-ramp.js +12 -0
- package/dist/fluent-web-components.api.json +534 -0
- package/dist/web-components.d.ts +57 -0
- package/dist/web-components.js +191 -28
- package/dist/web-components.min.js +211 -139
- package/docs/api-report.md +57 -0
- package/package.json +1 -1
- package/public/SegoeUI-VF.ttf +0 -0
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "@fluentui/web-components",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 06 May 2022 07:36:21 GMT",
|
|
6
|
+
"tag": "@fluentui/web-components_v2.5.0",
|
|
7
|
+
"version": "2.5.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "47367562+bheston@users.noreply.github.com",
|
|
12
|
+
"package": "@fluentui/web-components",
|
|
13
|
+
"commit": "b60bcd3b01d2927a03660523eea42b42f507e85b",
|
|
14
|
+
"comment": "Added support for Segoe UI Variable font with variant configurations Added type ramp helpers to conveniently and consistently apply all necessary font attributes."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Thu, 28 Apr 2022 07:39:56 GMT",
|
|
6
21
|
"tag": "@fluentui/web-components_v2.4.0",
|
|
7
22
|
"version": "2.4.0",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
# Change Log - @fluentui/web-components
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 06 May 2022 07:36:21 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [2.5.0](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v2.5.0)
|
|
8
|
+
|
|
9
|
+
Fri, 06 May 2022 07:36:21 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v2.4.0..@fluentui/web-components_v2.5.0)
|
|
11
|
+
|
|
12
|
+
### Minor changes
|
|
13
|
+
|
|
14
|
+
- Added support for Segoe UI Variable font with variant configurations Added type ramp helpers to conveniently and consistently apply all necessary font attributes. ([PR #22079](https://github.com/microsoft/fluentui/pull/22079) by 47367562+bheston@users.noreply.github.com)
|
|
15
|
+
|
|
7
16
|
## [2.4.0](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v2.4.0)
|
|
8
17
|
|
|
9
|
-
Thu, 28 Apr 2022 07:
|
|
18
|
+
Thu, 28 Apr 2022 07:39:56 GMT
|
|
10
19
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v2.3.1..@fluentui/web-components_v2.4.0)
|
|
11
20
|
|
|
12
21
|
### Minor changes
|
|
@@ -38,42 +38,62 @@ export declare const focusStrokeWidth: import("@microsoft/fast-foundation").CSSD
|
|
|
38
38
|
/** @public */
|
|
39
39
|
export declare const bodyFont: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
40
40
|
/** @public */
|
|
41
|
+
export declare const fontWeight: import("@microsoft/fast-foundation").CSSDesignToken<number>;
|
|
42
|
+
/** @public */
|
|
41
43
|
export declare const typeRampBaseFontSize: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
42
44
|
/** @public */
|
|
43
45
|
export declare const typeRampBaseLineHeight: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
44
46
|
/** @public */
|
|
47
|
+
export declare const typeRampBaseFontVariations: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
48
|
+
/** @public */
|
|
45
49
|
export declare const typeRampMinus1FontSize: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
46
50
|
/** @public */
|
|
47
51
|
export declare const typeRampMinus1LineHeight: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
48
52
|
/** @public */
|
|
53
|
+
export declare const typeRampMinus1FontVariations: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
54
|
+
/** @public */
|
|
49
55
|
export declare const typeRampMinus2FontSize: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
50
56
|
/** @public */
|
|
51
57
|
export declare const typeRampMinus2LineHeight: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
52
58
|
/** @public */
|
|
59
|
+
export declare const typeRampMinus2FontVariations: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
60
|
+
/** @public */
|
|
53
61
|
export declare const typeRampPlus1FontSize: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
54
62
|
/** @public */
|
|
55
63
|
export declare const typeRampPlus1LineHeight: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
56
64
|
/** @public */
|
|
65
|
+
export declare const typeRampPlus1FontVariations: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
66
|
+
/** @public */
|
|
57
67
|
export declare const typeRampPlus2FontSize: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
58
68
|
/** @public */
|
|
59
69
|
export declare const typeRampPlus2LineHeight: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
60
70
|
/** @public */
|
|
71
|
+
export declare const typeRampPlus2FontVariations: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
72
|
+
/** @public */
|
|
61
73
|
export declare const typeRampPlus3FontSize: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
62
74
|
/** @public */
|
|
63
75
|
export declare const typeRampPlus3LineHeight: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
64
76
|
/** @public */
|
|
77
|
+
export declare const typeRampPlus3FontVariations: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
78
|
+
/** @public */
|
|
65
79
|
export declare const typeRampPlus4FontSize: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
66
80
|
/** @public */
|
|
67
81
|
export declare const typeRampPlus4LineHeight: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
68
82
|
/** @public */
|
|
83
|
+
export declare const typeRampPlus4FontVariations: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
84
|
+
/** @public */
|
|
69
85
|
export declare const typeRampPlus5FontSize: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
70
86
|
/** @public */
|
|
71
87
|
export declare const typeRampPlus5LineHeight: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
72
88
|
/** @public */
|
|
89
|
+
export declare const typeRampPlus5FontVariations: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
90
|
+
/** @public */
|
|
73
91
|
export declare const typeRampPlus6FontSize: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
74
92
|
/** @public */
|
|
75
93
|
export declare const typeRampPlus6LineHeight: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
76
94
|
/** @public */
|
|
95
|
+
export declare const typeRampPlus6FontVariations: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
96
|
+
/** @public */
|
|
77
97
|
export declare const baseLayerLuminance: import("@microsoft/fast-foundation").CSSDesignToken<number>;
|
|
78
98
|
/** @public */
|
|
79
99
|
export declare const accentFillRestDelta: DesignToken<number>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** @public */
|
|
2
|
+
export declare const typeRampBase: import("@microsoft/fast-element").CSSDirective;
|
|
3
|
+
/** @public */
|
|
4
|
+
export declare const typeRampMinus1: import("@microsoft/fast-element").CSSDirective;
|
|
5
|
+
/** @public */
|
|
6
|
+
export declare const typeRampMinus2: import("@microsoft/fast-element").CSSDirective;
|
|
7
|
+
/** @public */
|
|
8
|
+
export declare const typeRampPlus1: import("@microsoft/fast-element").CSSDirective;
|
|
9
|
+
/** @public */
|
|
10
|
+
export declare const typeRampPlus2: import("@microsoft/fast-element").CSSDirective;
|
|
11
|
+
/** @public */
|
|
12
|
+
export declare const typeRampPlus3: import("@microsoft/fast-element").CSSDirective;
|
|
13
|
+
/** @public */
|
|
14
|
+
export declare const typeRampPlus4: import("@microsoft/fast-element").CSSDirective;
|
|
15
|
+
/** @public */
|
|
16
|
+
export declare const typeRampPlus5: import("@microsoft/fast-element").CSSDirective;
|
|
17
|
+
/** @public */
|
|
18
|
+
export declare const typeRampPlus6: import("@microsoft/fast-element").CSSDirective;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @public */
|
|
2
|
+
export declare const StandardFontWeight: {
|
|
3
|
+
readonly Thin: 100;
|
|
4
|
+
readonly ExtraLight: 200;
|
|
5
|
+
readonly Light: 300;
|
|
6
|
+
readonly Normal: 400;
|
|
7
|
+
readonly Medium: 500;
|
|
8
|
+
readonly SemiBold: 600;
|
|
9
|
+
readonly Bold: 700;
|
|
10
|
+
readonly ExtraBold: 800;
|
|
11
|
+
readonly Black: 900;
|
|
12
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { DesignToken, display, focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
|
|
3
3
|
import { SystemColors } from '@microsoft/fast-web-utilities';
|
|
4
|
-
import {
|
|
4
|
+
import { controlCornerRadius, designUnit, focusStrokeOuter, focusStrokeWidth, layerCornerRadius, neutralFillLayerAltRest, neutralFillLayerRecipe, neutralFillLayerRest, neutralFillStealthRecipe, neutralForegroundRest, neutralStrokeLayerRest, strokeWidth, } from '../../design-tokens';
|
|
5
|
+
import { typeRampBase } from '../../styles/patterns/type-ramp';
|
|
5
6
|
import { heightNumber } from '../../styles/size';
|
|
6
7
|
const neutralFillStealthRestOnNeutralFillLayerRest = DesignToken.create('neutral-fill-stealth-rest-on-neutral-fill-layer-rest').withDefault((target) => {
|
|
7
8
|
const baseRecipe = neutralFillLayerRecipe.getValueFor(target);
|
|
@@ -21,10 +22,8 @@ const neutralFillStealthActiveOnNeutralFillLayerRest = DesignToken.create('neutr
|
|
|
21
22
|
export const accordionItemStyles = (context, definition) => css `
|
|
22
23
|
${display('flex')} :host {
|
|
23
24
|
box-sizing: border-box;
|
|
24
|
-
|
|
25
|
+
${typeRampBase};
|
|
25
26
|
flex-direction: column;
|
|
26
|
-
font-size: ${typeRampBaseFontSize};
|
|
27
|
-
line-height: ${typeRampBaseLineHeight};
|
|
28
27
|
background: ${neutralFillLayerRest};
|
|
29
28
|
color: ${neutralForegroundRest};
|
|
30
29
|
border: calc(${strokeWidth} * 1px) solid ${neutralStrokeLayerRest};
|
|
@@ -56,7 +55,7 @@ export const accordionItemStyles = (context, definition) => css `
|
|
|
56
55
|
text-align: left;
|
|
57
56
|
color: inherit;
|
|
58
57
|
cursor: pointer;
|
|
59
|
-
font
|
|
58
|
+
font: inherit;
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
.button::before {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { display } from '@microsoft/fast-foundation';
|
|
3
|
-
import {
|
|
3
|
+
import { designUnit, neutralForegroundRest } from '../design-tokens';
|
|
4
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
4
5
|
export const accordionStyles = (context, definition) => css `
|
|
5
6
|
${display('flex')} :host {
|
|
6
7
|
box-sizing: border-box;
|
|
7
8
|
flex-direction: column;
|
|
8
|
-
|
|
9
|
-
font-size: ${typeRampBaseFontSize};
|
|
10
|
-
line-height: ${typeRampBaseLineHeight};
|
|
9
|
+
${typeRampBase}
|
|
11
10
|
color: ${neutralForegroundRest};
|
|
12
11
|
gap: calc(${designUnit} * 1px);
|
|
13
12
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { display } from '@microsoft/fast-foundation';
|
|
3
|
-
import { accentFillRest,
|
|
3
|
+
import { accentFillRest, controlCornerRadius, designUnit, foregroundOnAccentRest, neutralFillSecondaryRest, neutralForegroundRest, strokeWidth, typeRampMinus1LineHeight, } from '../design-tokens';
|
|
4
|
+
import { typeRampMinus1 } from '../styles/patterns/type-ramp';
|
|
4
5
|
export const badgeStyles = (context, definition) => css `
|
|
5
6
|
${display('inline-block')} :host {
|
|
6
7
|
box-sizing: border-box;
|
|
7
|
-
|
|
8
|
-
font-size: ${typeRampMinus1FontSize};
|
|
9
|
-
line-height: ${typeRampMinus1LineHeight};
|
|
8
|
+
${typeRampMinus1};
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
.control {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { display } from '@microsoft/fast-foundation';
|
|
3
|
-
import {
|
|
3
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
4
4
|
export const breadcrumbStyles = (context, definition) => css `
|
|
5
5
|
${display('inline-block')} :host {
|
|
6
6
|
box-sizing: border-box;
|
|
7
|
-
|
|
8
|
-
font-size: ${typeRampBaseFontSize};
|
|
9
|
-
line-height: ${typeRampBaseLineHeight};
|
|
7
|
+
${typeRampBase};
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
.list {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { display, focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
|
|
3
3
|
import { SystemColors } from '@microsoft/fast-web-utilities';
|
|
4
|
-
import {
|
|
4
|
+
import { controlCornerRadius, focusStrokeOuter, focusStrokeWidth, neutralForegroundActive, neutralForegroundHover, neutralForegroundRest, strokeWidth, } from '../design-tokens';
|
|
5
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
5
6
|
import { heightNumber } from '../styles/index';
|
|
6
7
|
export const breadcrumbItemStyles = (context, definition) => css `
|
|
7
8
|
${display('inline-flex')} :host {
|
|
@@ -9,9 +10,7 @@ export const breadcrumbItemStyles = (context, definition) => css `
|
|
|
9
10
|
color: ${neutralForegroundRest};
|
|
10
11
|
fill: currentcolor;
|
|
11
12
|
box-sizing: border-box;
|
|
12
|
-
|
|
13
|
-
font-size: ${typeRampBaseFontSize};
|
|
14
|
-
line-height: ${typeRampBaseLineHeight};
|
|
13
|
+
${typeRampBase};
|
|
15
14
|
min-width: calc(${heightNumber} * 1px);
|
|
16
15
|
border-radius: calc(${controlCornerRadius} * 1px);
|
|
17
16
|
outline: none;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { css } from "@microsoft/fast-element";
|
|
2
2
|
import { display, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
|
|
3
3
|
import { SystemColors } from '@microsoft/fast-web-utilities';
|
|
4
|
-
import { accentFillRest, baseHeightMultiplier,
|
|
4
|
+
import { accentFillRest, baseHeightMultiplier, controlCornerRadius, density, designUnit, fillColor, foregroundOnAccentRest, neutralForegroundHint, neutralForegroundRest, strokeWidth, } from '../design-tokens';
|
|
5
5
|
import { DirectionalStyleSheetBehavior } from '../styles';
|
|
6
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
6
7
|
/**
|
|
7
8
|
* LTR styles for calendar
|
|
8
9
|
* @internal
|
|
@@ -29,9 +30,7 @@ export const calendarStyles = (context, definition) => css `
|
|
|
29
30
|
${display("inline-block")} :host {
|
|
30
31
|
--calendar-cell-size: calc((${baseHeightMultiplier} + 2 + ${density}) * ${designUnit} * 1px);
|
|
31
32
|
--calendar-gap: 2px;
|
|
32
|
-
|
|
33
|
-
font-size: ${typeRampBaseFontSize};
|
|
34
|
-
line-height: ${typeRampBaseLineHeight};
|
|
33
|
+
${typeRampBase}
|
|
35
34
|
color: ${neutralForegroundRest};
|
|
36
35
|
}
|
|
37
36
|
|
|
@@ -2,7 +2,8 @@ import { css } from '@microsoft/fast-element';
|
|
|
2
2
|
import { disabledCursor, display, focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
|
|
3
3
|
import { SystemColors } from '@microsoft/fast-web-utilities';
|
|
4
4
|
import { heightNumber } from '../styles';
|
|
5
|
-
import { accentFillActive, accentFillHover, accentFillRest,
|
|
5
|
+
import { accentFillActive, accentFillHover, accentFillRest, controlCornerRadius, designUnit, disabledOpacity, fillColor, focusStrokeOuter, foregroundOnAccentRest, neutralFillInputAltActive, neutralFillInputAltFocus, neutralFillInputAltHover, neutralFillInputAltRest, neutralForegroundRest, neutralStrokeStrongActive, neutralStrokeStrongHover, neutralStrokeStrongRest, strokeWidth, } from '../design-tokens';
|
|
6
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
6
7
|
export const checkboxStyles = (context, definition) => css `
|
|
7
8
|
${display('inline-flex')} :host {
|
|
8
9
|
align-items: center;
|
|
@@ -32,14 +33,12 @@ export const checkboxStyles = (context, definition) => css `
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
.label {
|
|
35
|
-
|
|
36
|
+
${typeRampBase}
|
|
36
37
|
color: ${neutralForegroundRest};
|
|
37
38
|
${
|
|
38
39
|
/* Need to discuss with Brian how HorizontalSpacingNumber can work. https://github.com/microsoft/fast/issues/2766 */ ''} padding-inline-start: calc(${designUnit} * 2px + 2px);
|
|
39
40
|
margin-inline-end: calc(${designUnit} * 2px + 2px);
|
|
40
41
|
cursor: pointer;
|
|
41
|
-
font-size: ${typeRampBaseFontSize};
|
|
42
|
-
line-height: ${typeRampBaseLineHeight};
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
slot[name='checked-indicator'],
|
|
@@ -2,7 +2,8 @@ import { css } from '@microsoft/fast-element';
|
|
|
2
2
|
import { disabledCursor, focusVisible } from '@microsoft/fast-foundation';
|
|
3
3
|
import { selectFilledStyles, selectStyles } from '../select/select.styles';
|
|
4
4
|
import { appearanceBehavior } from '../utilities/behaviors';
|
|
5
|
-
import { strokeWidth
|
|
5
|
+
import { strokeWidth } from '../design-tokens';
|
|
6
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
6
7
|
export const comboboxStyles = (context, definition) => css `
|
|
7
8
|
${selectStyles(context, definition)}
|
|
8
9
|
|
|
@@ -25,8 +26,7 @@ export const comboboxStyles = (context, definition) => css `
|
|
|
25
26
|
background: transparent;
|
|
26
27
|
border: none;
|
|
27
28
|
color: inherit;
|
|
28
|
-
|
|
29
|
-
line-height: ${typeRampBaseLineHeight};
|
|
29
|
+
${typeRampBase}
|
|
30
30
|
height: calc(100% - ${strokeWidth} * 1px));
|
|
31
31
|
margin: auto 0;
|
|
32
32
|
width: 100%;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { SystemColors } from '@microsoft/fast-web-utilities';
|
|
3
3
|
import { focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
|
|
4
|
-
import {
|
|
4
|
+
import { controlCornerRadius, designUnit, focusStrokeOuter, focusStrokeWidth, neutralForegroundRest, } from '../design-tokens';
|
|
5
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
5
6
|
export const dataGridCellStyles = (context, definition) => css `
|
|
6
7
|
:host {
|
|
7
8
|
padding: calc(${designUnit} * 1px) calc(${designUnit} * 3px);
|
|
8
9
|
color: ${neutralForegroundRest};
|
|
9
10
|
box-sizing: border-box;
|
|
10
|
-
|
|
11
|
-
font-size: ${typeRampBaseFontSize};
|
|
12
|
-
line-height: ${typeRampBaseLineHeight};
|
|
13
|
-
font-weight: 400;
|
|
11
|
+
${typeRampBase}
|
|
14
12
|
border: transparent calc(${focusStrokeWidth} * 1px) solid;
|
|
15
13
|
overflow: hidden;
|
|
16
14
|
outline: none;
|
|
@@ -17,6 +17,7 @@ import { neutralLayer4 as neutralLayer4Algorithm } from './color/recipes/neutral
|
|
|
17
17
|
import { accentBase, middleGrey } from './color/utilities/color-constants';
|
|
18
18
|
import { StandardLuminance } from './color/utilities/base-layer-luminance';
|
|
19
19
|
import { directionByIsDark } from './color/utilities/direction-by-is-dark';
|
|
20
|
+
import { StandardFontWeight } from './utilities/type-ramp';
|
|
20
21
|
const { create } = DesignToken;
|
|
21
22
|
function createNonCss(name) {
|
|
22
23
|
return DesignToken.create({ name, cssCustomPropertyName: null });
|
|
@@ -46,43 +47,79 @@ export const strokeWidth = create('stroke-width').withDefault(1);
|
|
|
46
47
|
export const focusStrokeWidth = create('focus-stroke-width').withDefault(2);
|
|
47
48
|
// Typography values
|
|
48
49
|
/** @public */
|
|
49
|
-
export const bodyFont = create('body-font').withDefault('Segoe UI, sans-serif');
|
|
50
|
+
export const bodyFont = create('body-font').withDefault('"Segoe UI Variable", "Segoe UI", sans-serif');
|
|
51
|
+
/** @public */
|
|
52
|
+
export const fontWeight = create('font-weight').withDefault(StandardFontWeight.Normal);
|
|
53
|
+
function fontVariations(sizeToken) {
|
|
54
|
+
return (element) => {
|
|
55
|
+
const size = sizeToken.getValueFor(element);
|
|
56
|
+
const weight = fontWeight.getValueFor(element);
|
|
57
|
+
if (size.endsWith('px')) {
|
|
58
|
+
const px = Number.parseFloat(size.replace('px', ''));
|
|
59
|
+
if (px <= 12) {
|
|
60
|
+
return `"wght" ${weight}, "opsz" 8`;
|
|
61
|
+
}
|
|
62
|
+
else if (px > 24) {
|
|
63
|
+
return `"wght" ${weight}, "opsz" 36`;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return `"wght" ${weight}, "opsz" 10.5`;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
50
69
|
/** @public */
|
|
51
70
|
export const typeRampBaseFontSize = create('type-ramp-base-font-size').withDefault('14px');
|
|
52
71
|
/** @public */
|
|
53
72
|
export const typeRampBaseLineHeight = create('type-ramp-base-line-height').withDefault('20px');
|
|
54
73
|
/** @public */
|
|
74
|
+
export const typeRampBaseFontVariations = create('type-ramp-base-font-variations').withDefault(fontVariations(typeRampBaseFontSize));
|
|
75
|
+
/** @public */
|
|
55
76
|
export const typeRampMinus1FontSize = create('type-ramp-minus-1-font-size').withDefault('12px');
|
|
56
77
|
/** @public */
|
|
57
78
|
export const typeRampMinus1LineHeight = create('type-ramp-minus-1-line-height').withDefault('16px');
|
|
58
79
|
/** @public */
|
|
80
|
+
export const typeRampMinus1FontVariations = create('type-ramp-minus-1-font-variations').withDefault(fontVariations(typeRampMinus1FontSize));
|
|
81
|
+
/** @public */
|
|
59
82
|
export const typeRampMinus2FontSize = create('type-ramp-minus-2-font-size').withDefault('10px');
|
|
60
83
|
/** @public */
|
|
61
84
|
export const typeRampMinus2LineHeight = create('type-ramp-minus-2-line-height').withDefault('14px');
|
|
62
85
|
/** @public */
|
|
86
|
+
export const typeRampMinus2FontVariations = create('type-ramp-minus-2-font-variations').withDefault(fontVariations(typeRampMinus2FontSize));
|
|
87
|
+
/** @public */
|
|
63
88
|
export const typeRampPlus1FontSize = create('type-ramp-plus-1-font-size').withDefault('16px');
|
|
64
89
|
/** @public */
|
|
65
90
|
export const typeRampPlus1LineHeight = create('type-ramp-plus-1-line-height').withDefault('22px');
|
|
66
91
|
/** @public */
|
|
92
|
+
export const typeRampPlus1FontVariations = create('type-ramp-plus-1-font-variations').withDefault(fontVariations(typeRampPlus1FontSize));
|
|
93
|
+
/** @public */
|
|
67
94
|
export const typeRampPlus2FontSize = create('type-ramp-plus-2-font-size').withDefault('20px');
|
|
68
95
|
/** @public */
|
|
69
96
|
export const typeRampPlus2LineHeight = create('type-ramp-plus-2-line-height').withDefault('26px');
|
|
70
97
|
/** @public */
|
|
98
|
+
export const typeRampPlus2FontVariations = create('type-ramp-plus-2-font-variations').withDefault(fontVariations(typeRampPlus2FontSize));
|
|
99
|
+
/** @public */
|
|
71
100
|
export const typeRampPlus3FontSize = create('type-ramp-plus-3-font-size').withDefault('24px');
|
|
72
101
|
/** @public */
|
|
73
102
|
export const typeRampPlus3LineHeight = create('type-ramp-plus-3-line-height').withDefault('32px');
|
|
74
103
|
/** @public */
|
|
104
|
+
export const typeRampPlus3FontVariations = create('type-ramp-plus-3-font-variations').withDefault(fontVariations(typeRampPlus3FontSize));
|
|
105
|
+
/** @public */
|
|
75
106
|
export const typeRampPlus4FontSize = create('type-ramp-plus-4-font-size').withDefault('28px');
|
|
76
107
|
/** @public */
|
|
77
108
|
export const typeRampPlus4LineHeight = create('type-ramp-plus-4-line-height').withDefault('36px');
|
|
78
109
|
/** @public */
|
|
110
|
+
export const typeRampPlus4FontVariations = create('type-ramp-plus-4-font-variations').withDefault(fontVariations(typeRampPlus4FontSize));
|
|
111
|
+
/** @public */
|
|
79
112
|
export const typeRampPlus5FontSize = create('type-ramp-plus-5-font-size').withDefault('32px');
|
|
80
113
|
/** @public */
|
|
81
114
|
export const typeRampPlus5LineHeight = create('type-ramp-plus-5-line-height').withDefault('40px');
|
|
82
115
|
/** @public */
|
|
116
|
+
export const typeRampPlus5FontVariations = create('type-ramp-plus-5-font-variations').withDefault(fontVariations(typeRampPlus5FontSize));
|
|
117
|
+
/** @public */
|
|
83
118
|
export const typeRampPlus6FontSize = create('type-ramp-plus-6-font-size').withDefault('40px');
|
|
84
119
|
/** @public */
|
|
85
120
|
export const typeRampPlus6LineHeight = create('type-ramp-plus-6-line-height').withDefault('52px');
|
|
121
|
+
/** @public */
|
|
122
|
+
export const typeRampPlus6FontVariations = create('type-ramp-plus-6-font-variations').withDefault(fontVariations(typeRampPlus6FontSize));
|
|
86
123
|
// Color recipe values
|
|
87
124
|
/** @public */
|
|
88
125
|
export const baseLayerLuminance = create('base-layer-luminance').withDefault(StandardLuminance.LightMode);
|
|
@@ -2,11 +2,12 @@ import { css } from '@microsoft/fast-element';
|
|
|
2
2
|
import { disabledCursor, display, focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
|
|
3
3
|
import { SystemColors } from '@microsoft/fast-web-utilities';
|
|
4
4
|
import { heightNumber } from '../styles/size';
|
|
5
|
-
import { accentFillRest,
|
|
5
|
+
import { accentFillRest, controlCornerRadius, designUnit, disabledOpacity, focusStrokeOuter, focusStrokeWidth, neutralFillSecondaryActive, neutralFillSecondaryHover, neutralFillSecondaryRest, neutralFillStealthActive, neutralFillStealthFocus, neutralFillStealthHover, neutralFillStealthRest, neutralForegroundRest, } from '../design-tokens';
|
|
6
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
6
7
|
export const optionStyles = (context, definition) => css `
|
|
7
8
|
${display('inline-flex')} :host {
|
|
8
9
|
position: relative;
|
|
9
|
-
|
|
10
|
+
${typeRampBase}
|
|
10
11
|
background: ${neutralFillStealthRest};
|
|
11
12
|
border-radius: calc(${controlCornerRadius} * 1px);
|
|
12
13
|
border: calc(${focusStrokeWidth} * 1px) solid transparent;
|
|
@@ -14,9 +15,7 @@ export const optionStyles = (context, definition) => css `
|
|
|
14
15
|
color: ${neutralForegroundRest};
|
|
15
16
|
cursor: pointer;
|
|
16
17
|
fill: currentcolor;
|
|
17
|
-
font-size: ${typeRampBaseFontSize};
|
|
18
18
|
height: calc(${heightNumber} * 1px);
|
|
19
|
-
line-height: ${typeRampBaseLineHeight};
|
|
20
19
|
outline: none;
|
|
21
20
|
overflow: hidden;
|
|
22
21
|
align-items: center;
|
|
@@ -2,12 +2,13 @@ import { css } from '@microsoft/fast-element';
|
|
|
2
2
|
import { disabledCursor, display, focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
|
|
3
3
|
import { SystemColors } from '@microsoft/fast-web-utilities';
|
|
4
4
|
import { DirectionalStyleSheetBehavior, heightNumber } from '../styles/index';
|
|
5
|
-
import {
|
|
5
|
+
import { controlCornerRadius, disabledOpacity, focusStrokeOuter, focusStrokeWidth, neutralFillStealthActive, neutralFillStealthHover, neutralForegroundHint, neutralForegroundRest, strokeWidth, } from '../design-tokens';
|
|
6
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
6
7
|
export const menuItemStyles = (context, definition) => css `
|
|
7
8
|
${display('grid')} :host {
|
|
8
9
|
contain: layout;
|
|
9
10
|
overflow: visible;
|
|
10
|
-
|
|
11
|
+
${typeRampBase}
|
|
11
12
|
outline: none;
|
|
12
13
|
box-sizing: border-box;
|
|
13
14
|
height: calc(${heightNumber} * 1px);
|
|
@@ -20,8 +21,6 @@ export const menuItemStyles = (context, definition) => css `
|
|
|
20
21
|
color: ${neutralForegroundRest};
|
|
21
22
|
fill: currentcolor;
|
|
22
23
|
cursor: pointer;
|
|
23
|
-
font-size: ${typeRampBaseFontSize};
|
|
24
|
-
line-height: ${typeRampBaseLineHeight};
|
|
25
24
|
border-radius: calc(${controlCornerRadius} * 1px);
|
|
26
25
|
border: calc(${strokeWidth} * 1px) solid transparent;
|
|
27
26
|
}
|
|
@@ -2,7 +2,8 @@ import { css } from '@microsoft/fast-element';
|
|
|
2
2
|
import { SystemColors } from '@microsoft/fast-web-utilities';
|
|
3
3
|
import { disabledCursor, display, focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
|
|
4
4
|
import { heightNumber } from '../styles';
|
|
5
|
-
import { accentFillActive, accentFillHover, accentFillRest,
|
|
5
|
+
import { accentFillActive, accentFillHover, accentFillRest, designUnit, disabledOpacity, fillColor, focusStrokeOuter, foregroundOnAccentRest, neutralFillInputAltActive, neutralFillInputAltFocus, neutralFillInputAltHover, neutralFillInputAltRest, neutralForegroundRest, neutralStrokeStrongActive, neutralStrokeStrongHover, neutralStrokeStrongRest, strokeWidth, } from '../design-tokens';
|
|
6
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
6
7
|
export const radioStyles = (context, definition) => css `
|
|
7
8
|
${display('inline-flex')} :host {
|
|
8
9
|
--input-size: calc((${heightNumber} / 2) + ${designUnit});
|
|
@@ -36,14 +37,12 @@ export const radioStyles = (context, definition) => css `
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
.label {
|
|
39
|
-
|
|
40
|
+
${typeRampBase}
|
|
40
41
|
color: ${neutralForegroundRest};
|
|
41
42
|
${
|
|
42
43
|
/* Need to discuss with Brian how HorizontalSpacingNumber can work. https://github.com/microsoft/fast/issues/2766 */ ''} padding-inline-start: calc(${designUnit} * 2px + 2px);
|
|
43
44
|
margin-inline-end: calc(${designUnit} * 2px + 2px);
|
|
44
45
|
cursor: pointer;
|
|
45
|
-
font-size: ${typeRampBaseFontSize};
|
|
46
|
-
line-height: ${typeRampBaseLineHeight};
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
.control,
|
|
@@ -2,7 +2,8 @@ import { css } from '@microsoft/fast-element';
|
|
|
2
2
|
import { Button, DesignToken, display, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
|
|
3
3
|
import { heightNumber, inputFilledForcedColorStyles, inputFilledStyles, inputForcedColorStyles, inputStateStyles, inputStyles, } from '../styles';
|
|
4
4
|
import { appearanceBehavior } from '../utilities/behaviors';
|
|
5
|
-
import {
|
|
5
|
+
import { controlCornerRadius, density, designUnit, neutralFillInputRecipe, neutralFillStealthRecipe, neutralForegroundRest } from '../design-tokens';
|
|
6
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
6
7
|
const clearButtonHover = DesignToken.create("clear-button-hover").withDefault((target) => {
|
|
7
8
|
const buttonRecipe = neutralFillStealthRecipe.getValueFor(target);
|
|
8
9
|
const inputRecipe = neutralFillInputRecipe.getValueFor(target);
|
|
@@ -51,10 +52,8 @@ export const searchStyles = (context, definition) => css `
|
|
|
51
52
|
border: none;
|
|
52
53
|
border-radius: calc(${controlCornerRadius} * 1px);
|
|
53
54
|
min-width: calc(${heightNumber} * 1px);
|
|
54
|
-
|
|
55
|
-
line-height: ${typeRampBaseLineHeight};
|
|
55
|
+
${typeRampBase}
|
|
56
56
|
outline: none;
|
|
57
|
-
font-family: ${bodyFont};
|
|
58
57
|
padding: 0 calc((10 + (${designUnit} * 2 * ${density})) * 1px);
|
|
59
58
|
}
|
|
60
59
|
.clear-button:hover {
|
|
@@ -4,7 +4,8 @@ import { SystemColors } from '@microsoft/fast-web-utilities';
|
|
|
4
4
|
import { elevationShadowFlyout } from '../styles/elevation';
|
|
5
5
|
import { heightNumber } from '../styles/size';
|
|
6
6
|
import { appearanceBehavior } from '../utilities/behaviors';
|
|
7
|
-
import { bodyFont, controlCornerRadius, designUnit, disabledOpacity, fillColor, focusStrokeOuter, layerCornerRadius, neutralFillActive, neutralFillHover, neutralFillRest, neutralFillSecondaryActive, neutralFillSecondaryHover, neutralFillSecondaryRest, neutralFillStealthActive, neutralFillStealthHover, neutralFillStealthRest, neutralForegroundRest, neutralStrokeControlActive, neutralStrokeControlHover, neutralStrokeControlRest, strokeWidth,
|
|
7
|
+
import { bodyFont, controlCornerRadius, designUnit, disabledOpacity, fillColor, focusStrokeOuter, layerCornerRadius, neutralFillActive, neutralFillHover, neutralFillRest, neutralFillSecondaryActive, neutralFillSecondaryHover, neutralFillSecondaryRest, neutralFillStealthActive, neutralFillStealthHover, neutralFillStealthRest, neutralForegroundRest, neutralStrokeControlActive, neutralStrokeControlHover, neutralStrokeControlRest, strokeWidth, } from '../design-tokens';
|
|
8
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
8
9
|
export const selectFilledStyles = (context, definition) => css `
|
|
9
10
|
:host {
|
|
10
11
|
background: ${neutralFillSecondaryRest};
|
|
@@ -95,10 +96,8 @@ export const selectStyles = (context, definition) => css `
|
|
|
95
96
|
box-sizing: border-box;
|
|
96
97
|
cursor: pointer;
|
|
97
98
|
display: flex;
|
|
98
|
-
|
|
99
|
-
font-family: inherit;
|
|
99
|
+
${typeRampBase}
|
|
100
100
|
min-height: 100%;
|
|
101
|
-
line-height: ${typeRampBaseLineHeight};
|
|
102
101
|
padding: 0 calc(${designUnit} * 2.25px);
|
|
103
102
|
width: 100%;
|
|
104
103
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { SystemColors } from '@microsoft/fast-web-utilities';
|
|
3
3
|
import { display, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
|
|
4
|
-
import {
|
|
4
|
+
import { designUnit, disabledOpacity, neutralStrokeStrongRest, strokeWidth } from '../design-tokens';
|
|
5
|
+
import { typeRampMinus1 } from '../styles/patterns/type-ramp';
|
|
5
6
|
export const sliderLabelStyles = (context, definition) => css `
|
|
6
7
|
${display('block')} :host {
|
|
7
|
-
|
|
8
|
+
${typeRampMinus1}
|
|
8
9
|
}
|
|
9
10
|
.root {
|
|
10
11
|
position: absolute;
|
|
@@ -2,7 +2,8 @@ import { css } from '@microsoft/fast-element';
|
|
|
2
2
|
import { SystemColors } from '@microsoft/fast-web-utilities';
|
|
3
3
|
import { display, focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
|
|
4
4
|
import { heightNumber } from '../size';
|
|
5
|
-
import { accentFillActive, accentFillHover, accentFillRest, accentForegroundActive, accentForegroundHover, accentForegroundRest, accentStrokeControlActive, accentStrokeControlHover, accentStrokeControlRest,
|
|
5
|
+
import { accentFillActive, accentFillHover, accentFillRest, accentForegroundActive, accentForegroundHover, accentForegroundRest, accentStrokeControlActive, accentStrokeControlHover, accentStrokeControlRest, controlCornerRadius, density, designUnit, focusStrokeInner, focusStrokeOuter, focusStrokeWidth, foregroundOnAccentActive, foregroundOnAccentHover, foregroundOnAccentRest, neutralFillActive, neutralFillHover, neutralFillRest, neutralFillStealthActive, neutralFillStealthHover, neutralFillStealthRest, neutralForegroundRest, neutralStrokeActive, neutralStrokeControlActive, neutralStrokeControlHover, neutralStrokeControlRest, neutralStrokeHover, neutralStrokeRest, strokeWidth, } from '../../design-tokens';
|
|
6
|
+
import { typeRampBase } from '../../styles/patterns/type-ramp';
|
|
6
7
|
/**
|
|
7
8
|
* @internal
|
|
8
9
|
*/
|
|
@@ -10,10 +11,8 @@ export const baseButtonStyles = (context, definition, interactivitySelector = ''
|
|
|
10
11
|
${display('inline-flex')} :host {
|
|
11
12
|
position: relative;
|
|
12
13
|
box-sizing: border-box;
|
|
13
|
-
font-family: ${bodyFont};
|
|
14
14
|
outline: none;
|
|
15
|
-
|
|
16
|
-
line-height: ${typeRampBaseLineHeight};
|
|
15
|
+
${typeRampBase}
|
|
17
16
|
height: calc(${heightNumber} * 1px);
|
|
18
17
|
min-width: calc(${heightNumber} * 1px);
|
|
19
18
|
color: ${neutralForegroundRest};
|