@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
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { DesignToken, disabledCursor, focusVisible, } from '@microsoft/fast-foundation';
|
|
3
3
|
import { SystemColors } from '@microsoft/fast-web-utilities';
|
|
4
|
-
import { accentFillRest,
|
|
4
|
+
import { accentFillRest, controlCornerRadius, disabledOpacity, focusStrokeWidth, neutralFillInputFocus, neutralFillInputHover, neutralFillInputRecipe, neutralFillInputRest, neutralFillSecondaryHover, neutralFillSecondaryRecipe, neutralFillSecondaryRest, neutralForegroundHintRecipe, neutralForegroundRest, neutralStrokeInputHover, neutralStrokeInputRest, neutralStrokeRest, strokeWidth, } from '../../design-tokens';
|
|
5
|
+
import { typeRampBase } from '../patterns/type-ramp';
|
|
5
6
|
import { heightNumber } from '../size';
|
|
6
7
|
const placeholderRest = DesignToken.create('input-placeholder-rest').withDefault((target) => {
|
|
7
8
|
const baseRecipe = neutralFillInputRecipe.getValueFor(target);
|
|
@@ -28,9 +29,7 @@ const filledPlaceholderHover = DesignToken.create('input-filled-placeholder-hove
|
|
|
28
29
|
*/
|
|
29
30
|
export const inputStyles = (context, definition, rootSelector) => css `
|
|
30
31
|
:host {
|
|
31
|
-
|
|
32
|
-
font-size: ${typeRampBaseFontSize};
|
|
33
|
-
line-height: ${typeRampBaseLineHeight};
|
|
32
|
+
${typeRampBase}
|
|
34
33
|
color: ${neutralForegroundRest};
|
|
35
34
|
fill: currentcolor;
|
|
36
35
|
outline: none;
|
|
@@ -67,8 +66,7 @@ export const inputStyles = (context, definition, rootSelector) => css `
|
|
|
67
66
|
display: block;
|
|
68
67
|
color: ${neutralForegroundRest};
|
|
69
68
|
cursor: pointer;
|
|
70
|
-
|
|
71
|
-
line-height: ${typeRampBaseLineHeight};
|
|
69
|
+
${typeRampBase}
|
|
72
70
|
margin-bottom: 4px;
|
|
73
71
|
}
|
|
74
72
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { cssPartial } from '@microsoft/fast-element';
|
|
2
|
+
import { bodyFont, typeRampBaseFontSize, typeRampBaseFontVariations, typeRampBaseLineHeight, typeRampMinus1FontSize, typeRampMinus1FontVariations, typeRampMinus1LineHeight, typeRampMinus2FontSize, typeRampMinus2FontVariations, typeRampMinus2LineHeight, typeRampPlus1FontSize, typeRampPlus1FontVariations, typeRampPlus1LineHeight, typeRampPlus2FontSize, typeRampPlus2FontVariations, typeRampPlus2LineHeight, typeRampPlus3FontSize, typeRampPlus3FontVariations, typeRampPlus3LineHeight, typeRampPlus4FontSize, typeRampPlus4FontVariations, typeRampPlus4LineHeight, typeRampPlus5FontSize, typeRampPlus5FontVariations, typeRampPlus5LineHeight, typeRampPlus6FontSize, typeRampPlus6FontVariations, typeRampPlus6LineHeight, } from '../../design-tokens';
|
|
3
|
+
/** @public */
|
|
4
|
+
export const typeRampBase = cssPartial `
|
|
5
|
+
font-family: ${bodyFont};
|
|
6
|
+
font-size: ${typeRampBaseFontSize};
|
|
7
|
+
line-height: ${typeRampBaseLineHeight};
|
|
8
|
+
font-weight: initial;
|
|
9
|
+
font-variation-settings: ${typeRampBaseFontVariations};
|
|
10
|
+
`;
|
|
11
|
+
/** @public */
|
|
12
|
+
export const typeRampMinus1 = cssPartial `
|
|
13
|
+
font-family: ${bodyFont};
|
|
14
|
+
font-size: ${typeRampMinus1FontSize};
|
|
15
|
+
line-height: ${typeRampMinus1LineHeight};
|
|
16
|
+
font-weight: initial;
|
|
17
|
+
font-variation-settings: ${typeRampMinus1FontVariations};
|
|
18
|
+
`;
|
|
19
|
+
/** @public */
|
|
20
|
+
export const typeRampMinus2 = cssPartial `
|
|
21
|
+
font-family: ${bodyFont};
|
|
22
|
+
font-size: ${typeRampMinus2FontSize};
|
|
23
|
+
line-height: ${typeRampMinus2LineHeight};
|
|
24
|
+
font-weight: initial;
|
|
25
|
+
font-variation-settings: ${typeRampMinus2FontVariations};
|
|
26
|
+
`;
|
|
27
|
+
/** @public */
|
|
28
|
+
export const typeRampPlus1 = cssPartial `
|
|
29
|
+
font-family: ${bodyFont};
|
|
30
|
+
font-size: ${typeRampPlus1FontSize};
|
|
31
|
+
line-height: ${typeRampPlus1LineHeight};
|
|
32
|
+
font-weight: initial;
|
|
33
|
+
font-variation-settings: ${typeRampPlus1FontVariations};
|
|
34
|
+
`;
|
|
35
|
+
/** @public */
|
|
36
|
+
export const typeRampPlus2 = cssPartial `
|
|
37
|
+
font-family: ${bodyFont};
|
|
38
|
+
font-size: ${typeRampPlus2FontSize};
|
|
39
|
+
line-height: ${typeRampPlus2LineHeight};
|
|
40
|
+
font-weight: initial;
|
|
41
|
+
font-variation-settings: ${typeRampPlus2FontVariations};
|
|
42
|
+
`;
|
|
43
|
+
/** @public */
|
|
44
|
+
export const typeRampPlus3 = cssPartial `
|
|
45
|
+
font-family: ${bodyFont};
|
|
46
|
+
font-size: ${typeRampPlus3FontSize};
|
|
47
|
+
line-height: ${typeRampPlus3LineHeight};
|
|
48
|
+
font-weight: initial;
|
|
49
|
+
font-variation-settings: ${typeRampPlus3FontVariations};
|
|
50
|
+
`;
|
|
51
|
+
/** @public */
|
|
52
|
+
export const typeRampPlus4 = cssPartial `
|
|
53
|
+
font-family: ${bodyFont};
|
|
54
|
+
font-size: ${typeRampPlus4FontSize};
|
|
55
|
+
line-height: ${typeRampPlus4LineHeight};
|
|
56
|
+
font-weight: initial;
|
|
57
|
+
font-variation-settings: ${typeRampPlus4FontVariations};
|
|
58
|
+
`;
|
|
59
|
+
/** @public */
|
|
60
|
+
export const typeRampPlus5 = cssPartial `
|
|
61
|
+
font-family: ${bodyFont};
|
|
62
|
+
font-size: ${typeRampPlus5FontSize};
|
|
63
|
+
line-height: ${typeRampPlus5LineHeight};
|
|
64
|
+
font-weight: initial;
|
|
65
|
+
font-variation-settings: ${typeRampPlus5FontVariations};
|
|
66
|
+
`;
|
|
67
|
+
/** @public */
|
|
68
|
+
export const typeRampPlus6 = cssPartial `
|
|
69
|
+
font-family: ${bodyFont};
|
|
70
|
+
font-size: ${typeRampPlus6FontSize};
|
|
71
|
+
line-height: ${typeRampPlus6LineHeight};
|
|
72
|
+
font-weight: initial;
|
|
73
|
+
font-variation-settings: ${typeRampPlus6FontVariations};
|
|
74
|
+
`;
|
|
@@ -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 { DirectionalStyleSheetBehavior, heightNumber } from '../styles';
|
|
5
|
-
import { accentFillActive, accentFillHover, accentFillRest, bodyFont, designUnit, disabledOpacity, fillColor, focusStrokeOuter, foregroundOnAccentActive, foregroundOnAccentHover, foregroundOnAccentRest, neutralFillInputAltActive, neutralFillInputAltFocus, neutralFillInputAltHover, neutralFillInputAltRest, neutralForegroundRest, neutralStrokeStrongActive, neutralStrokeStrongHover, neutralStrokeStrongRest, strokeWidth,
|
|
5
|
+
import { accentFillActive, accentFillHover, accentFillRest, bodyFont, designUnit, disabledOpacity, fillColor, focusStrokeOuter, foregroundOnAccentActive, foregroundOnAccentHover, 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 switchStyles = (context, definition) => css `
|
|
7
8
|
:host([hidden]) {
|
|
8
9
|
display: none;
|
|
@@ -86,8 +87,7 @@ export const switchStyles = (context, definition) => css `
|
|
|
86
87
|
.status-message {
|
|
87
88
|
color: ${neutralForegroundRest};
|
|
88
89
|
cursor: pointer;
|
|
89
|
-
|
|
90
|
-
line-height: ${typeRampBaseLineHeight};
|
|
90
|
+
${typeRampBase}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
.label__hidden {
|
|
@@ -97,8 +97,7 @@ export const switchStyles = (context, definition) => css `
|
|
|
97
97
|
|
|
98
98
|
.label {
|
|
99
99
|
color: ${neutralForegroundRest};
|
|
100
|
-
|
|
101
|
-
line-height: ${typeRampBaseLineHeight};
|
|
100
|
+
${typeRampBase}
|
|
102
101
|
margin-inline-end: calc(${designUnit} * 2px + 2px);
|
|
103
102
|
cursor: pointer;
|
|
104
103
|
}
|
|
@@ -2,14 +2,12 @@ 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 '../../styles';
|
|
5
|
-
import {
|
|
5
|
+
import { controlCornerRadius, density, designUnit, focusStrokeOuter, focusStrokeWidth, neutralForegroundRest, strokeWidth, } from '../../design-tokens';
|
|
6
|
+
import { typeRampBase } from '../../styles/patterns/type-ramp';
|
|
6
7
|
export const tabStyles = (context, definition) => css `
|
|
7
8
|
${display('inline-flex')} :host {
|
|
8
9
|
box-sizing: border-box;
|
|
9
|
-
|
|
10
|
-
font-size: ${typeRampBaseFontSize};
|
|
11
|
-
font-weight: 400;
|
|
12
|
-
line-height: ${typeRampBaseLineHeight};
|
|
10
|
+
${typeRampBase}
|
|
13
11
|
height: calc((${heightNumber} + (${designUnit} * 2)) * 1px);
|
|
14
12
|
padding: 0 calc((6 + (${designUnit} * 2 * ${density})) * 1px);
|
|
15
13
|
color: ${neutralForegroundRest};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { display } from '@microsoft/fast-foundation';
|
|
3
|
-
import {
|
|
3
|
+
import { density, designUnit } from '../../design-tokens';
|
|
4
|
+
import { typeRampBase } from '../../styles/patterns/type-ramp';
|
|
4
5
|
export const tabPanelStyles = (context, definition) => css `
|
|
5
6
|
${display('block')} :host {
|
|
6
7
|
box-sizing: border-box;
|
|
7
|
-
|
|
8
|
-
font-size: ${typeRampBaseFontSize};
|
|
9
|
-
font-weight: 400;
|
|
10
|
-
line-height: ${typeRampBaseLineHeight};
|
|
8
|
+
${typeRampBase}
|
|
11
9
|
padding: 0 calc((6 + (${designUnit} * 2 * ${density})) * 1px);
|
|
12
10
|
}
|
|
13
11
|
`;
|
|
@@ -1,14 +1,13 @@
|
|
|
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 { accentFillRest,
|
|
4
|
+
import { accentFillRest, controlCornerRadius, focusStrokeWidth, neutralForegroundRest, } from '../design-tokens';
|
|
5
5
|
import { heightNumber } from '../styles';
|
|
6
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
6
7
|
export const tabsStyles = (context, definition) => css `
|
|
7
8
|
${display('grid')} :host {
|
|
8
9
|
box-sizing: border-box;
|
|
9
|
-
|
|
10
|
-
font-size: ${typeRampBaseFontSize};
|
|
11
|
-
line-height: ${typeRampBaseLineHeight};
|
|
10
|
+
${typeRampBase}
|
|
12
11
|
color: ${neutralForegroundRest};
|
|
13
12
|
grid-template-columns: auto 1fr auto;
|
|
14
13
|
grid-template-rows: auto 1fr;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
|
|
3
3
|
import { elevationShadowTooltip } from '../styles/index';
|
|
4
|
-
import {
|
|
4
|
+
import { controlCornerRadius, fillColor, neutralForegroundRest, neutralStrokeLayerRest, strokeWidth, } from '../design-tokens';
|
|
5
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
5
6
|
export const tooltipStyles = (context, definition) => css `
|
|
6
7
|
:host {
|
|
7
8
|
position: relative;
|
|
@@ -21,9 +22,7 @@ export const tooltipStyles = (context, definition) => css `
|
|
|
21
22
|
padding: 4px 12px;
|
|
22
23
|
height: fit-content;
|
|
23
24
|
width: fit-content;
|
|
24
|
-
|
|
25
|
-
font-size: ${typeRampBaseFontSize};
|
|
26
|
-
line-height: ${typeRampBaseLineHeight};
|
|
25
|
+
${typeRampBase}
|
|
27
26
|
white-space: nowrap;
|
|
28
27
|
box-shadow: ${elevationShadowTooltip};
|
|
29
28
|
}
|
|
@@ -2,7 +2,8 @@ import { css, cssPartial } from '@microsoft/fast-element';
|
|
|
2
2
|
import { DesignToken, 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 { accentFillRest, baseHeightMultiplier, bodyFont, controlCornerRadius, density, designUnit, disabledOpacity, focusStrokeOuter, focusStrokeWidth, neutralFillSecondaryRecipe, neutralFillSecondaryRest, neutralFillStealthActive, neutralFillStealthHover, neutralFillStealthRecipe, neutralFillStealthRest, neutralForegroundRest, strokeWidth,
|
|
5
|
+
import { accentFillRest, baseHeightMultiplier, bodyFont, controlCornerRadius, density, designUnit, disabledOpacity, focusStrokeOuter, focusStrokeWidth, neutralFillSecondaryRecipe, neutralFillSecondaryRest, neutralFillStealthActive, neutralFillStealthHover, neutralFillStealthRecipe, neutralFillStealthRest, neutralForegroundRest, strokeWidth, } from '../design-tokens';
|
|
6
|
+
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
6
7
|
const ltr = css `
|
|
7
8
|
.expand-collapse-button svg {
|
|
8
9
|
transform: rotate(0deg);
|
|
@@ -99,9 +100,7 @@ export const treeItemStyles = (context, definition) => css `
|
|
|
99
100
|
width: 100%;
|
|
100
101
|
height: calc(${heightNumber} * 1px);
|
|
101
102
|
margin-inline-start: calc(${designUnit} * 2px + 8px);
|
|
102
|
-
|
|
103
|
-
line-height: ${typeRampBaseLineHeight};
|
|
104
|
-
font-weight: 400;
|
|
103
|
+
${typeRampBase}
|
|
105
104
|
}
|
|
106
105
|
|
|
107
106
|
.items {
|