@fluentui/web-components 2.5.5 → 2.5.7
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 +46 -1
- package/CHANGELOG.md +20 -2
- package/dist/dts/combobox/combobox.stories.d.ts +5 -0
- package/dist/dts/custom-elements.d.ts +3 -35
- package/dist/dts/number-field/index.d.ts +1 -1
- package/dist/dts/number-field/number-field.styles.d.ts +1 -2
- package/dist/dts/search/index.d.ts +1 -1
- package/dist/dts/search/search.styles.d.ts +2 -3
- package/dist/dts/select/index.d.ts +1 -1
- package/dist/dts/select/select.styles.d.ts +11 -3
- package/dist/dts/styles/focus.d.ts +13 -0
- package/dist/dts/styles/index.d.ts +1 -0
- package/dist/dts/styles/patterns/button.styles.d.ts +12 -6
- package/dist/dts/styles/patterns/input.styles.d.ts +13 -5
- package/dist/dts/text-area/index.d.ts +2 -18
- package/dist/dts/text-area/text-area.stories.d.ts +1 -17
- package/dist/dts/text-area/text-area.styles.d.ts +1 -2
- package/dist/dts/text-field/index.d.ts +2 -18
- package/dist/dts/text-field/text-field.stories.d.ts +1 -17
- package/dist/dts/text-field/text-field.styles.d.ts +1 -2
- package/dist/esm/accordion/accordion-item/accordion-item.styles.js +8 -10
- package/dist/esm/anchor/anchor.styles.js +3 -10
- package/dist/esm/breadcrumb-item/breadcrumb-item.styles.js +6 -10
- package/dist/esm/button/button.styles.js +14 -39
- package/dist/esm/checkbox/checkbox.styles.js +4 -8
- package/dist/esm/combobox/combobox.stories.js +7 -2
- package/dist/esm/combobox/combobox.styles.js +22 -23
- package/dist/esm/data-grid/data-grid-cell.styles.js +6 -9
- package/dist/esm/flipper/flipper.styles.js +5 -6
- package/dist/esm/listbox/listbox.styles.js +3 -4
- package/dist/esm/listbox-option/listbox-option.styles.js +9 -6
- package/dist/esm/menu/menu.styles.js +1 -1
- package/dist/esm/menu-item/menu-item.styles.js +5 -9
- package/dist/esm/number-field/number-field.styles.js +5 -16
- package/dist/esm/progress/progress/progress.styles.js +0 -1
- package/dist/esm/progress/progress-ring/progress-ring.styles.js +0 -1
- package/dist/esm/radio/radio.styles.js +4 -9
- package/dist/esm/search/search.styles.js +8 -11
- package/dist/esm/select/select.stories.js +2 -2
- package/dist/esm/select/select.styles.js +37 -110
- package/dist/esm/styles/focus.js +21 -0
- package/dist/esm/styles/index.js +1 -0
- package/dist/esm/styles/patterns/button.styles.js +194 -161
- package/dist/esm/styles/patterns/input.styles.js +113 -102
- package/dist/esm/switch/switch.styles.js +5 -17
- package/dist/esm/tabs/tab/tab.styles.js +4 -6
- package/dist/esm/text-area/text-area.stories.js +2 -2
- package/dist/esm/text-area/text-area.styles.js +5 -11
- package/dist/esm/text-field/text-field.styles.js +5 -11
- package/dist/esm/toolbar/toolbar.styles.js +4 -3
- package/dist/esm/tree-item/tree-item.styles.js +4 -14
- package/dist/esm/tree-view/tree-view.styles.js +0 -4
- package/dist/fluent-web-components.api.json +179 -397
- package/dist/web-components.d.ts +54 -90
- package/dist/web-components.js +158 -132
- package/dist/web-components.min.js +137 -156
- package/docs/api-report.md +44 -99
- package/karma.conf.js +3 -8
- package/package.json +27 -40
|
@@ -4,72 +4,34 @@ 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,
|
|
7
|
+
import { bodyFont, controlCornerRadius, designUnit, disabledOpacity, fillColor, layerCornerRadius, neutralForegroundRest, strokeWidth, } from '../design-tokens';
|
|
8
8
|
import { typeRampBase } from '../styles/patterns/type-ramp';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
`.withBehaviors(forcedColorsStylesheetBehavior(css `
|
|
25
|
-
:host(:not([disabled]):not([open]):hover) {
|
|
26
|
-
background: transparent;
|
|
27
|
-
}
|
|
28
|
-
:host(:not([disabled]):not([open]):hover),
|
|
29
|
-
:host(:not([disabled]):not([open]):active) {
|
|
30
|
-
border-color: ${SystemColors.Highlight};
|
|
31
|
-
}
|
|
32
|
-
:host(:${focusVisible}) {
|
|
33
|
-
forced-color-adjust: none;
|
|
34
|
-
background: transparent;
|
|
35
|
-
border-color: ${SystemColors.Highlight};
|
|
36
|
-
box-shadow: 0 0 0 1px inset ${SystemColors.Highlight};
|
|
37
|
-
}
|
|
38
|
-
`));
|
|
39
|
-
export const selectStealthStyles = (context, definition) => css `
|
|
40
|
-
:host {
|
|
41
|
-
background: ${neutralFillStealthRest};
|
|
42
|
-
border-color: transparent;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:host(:not([disabled]):not([open]):hover) {
|
|
46
|
-
background: ${neutralFillStealthHover};
|
|
47
|
-
border-color: transparent;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
:host(:not([disabled]):not([open]):active) {
|
|
51
|
-
background: ${neutralFillStealthActive};
|
|
52
|
-
border-color: transparent;
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
55
|
-
export const selectStyles = (context, definition) => css `
|
|
56
|
-
${display('inline-flex')} :host {
|
|
57
|
-
background: padding-box linear-gradient(${neutralFillRest}, ${neutralFillRest}),
|
|
58
|
-
border-box ${neutralStrokeControlRest};
|
|
59
|
-
border: calc(${strokeWidth} * 1px) solid transparent;
|
|
9
|
+
import { focusTreatmentBase } from '../styles/focus';
|
|
10
|
+
import { inputFilledStyles, inputForcedColorStyles, NeutralButtonStyles, StealthButtonStyles } from '../styles';
|
|
11
|
+
const logicalControlSelector = '.control';
|
|
12
|
+
const interactivitySelector = ':not([disabled]):not([open])';
|
|
13
|
+
const nonInteractivitySelector = '[disabled]';
|
|
14
|
+
/**
|
|
15
|
+
* The base styles for a select and combobox, without `appearance` visual differences.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export const baseSelectStyles = (context, definition) => css `
|
|
20
|
+
${display('inline-flex')}
|
|
21
|
+
|
|
22
|
+
:host {
|
|
60
23
|
border-radius: calc(${controlCornerRadius} * 1px);
|
|
61
24
|
box-sizing: border-box;
|
|
62
25
|
color: ${neutralForegroundRest};
|
|
63
26
|
fill: currentcolor;
|
|
64
27
|
font-family: ${bodyFont};
|
|
65
|
-
height: calc(${heightNumber} * 1px);
|
|
66
28
|
position: relative;
|
|
67
29
|
user-select: none;
|
|
68
30
|
min-width: 250px;
|
|
69
31
|
vertical-align: top;
|
|
70
32
|
}
|
|
71
33
|
|
|
72
|
-
|
|
34
|
+
.listbox {
|
|
73
35
|
box-shadow: ${elevationShadowFlyout};
|
|
74
36
|
background: ${fillColor};
|
|
75
37
|
border-radius: calc(${layerCornerRadius} * 1px);
|
|
@@ -78,7 +40,7 @@ export const selectStyles = (context, definition) => css `
|
|
|
78
40
|
flex-direction: column;
|
|
79
41
|
left: 0;
|
|
80
42
|
max-height: calc(var(--max-height) - (${heightNumber} * 1px));
|
|
81
|
-
padding: calc((${designUnit} - ${strokeWidth} ) * 1px)
|
|
43
|
+
padding: calc((${designUnit} - ${strokeWidth} ) * 1px);
|
|
82
44
|
overflow-y: auto;
|
|
83
45
|
position: absolute;
|
|
84
46
|
width: 100%;
|
|
@@ -87,11 +49,14 @@ export const selectStyles = (context, definition) => css `
|
|
|
87
49
|
border: calc(${strokeWidth} * 1px) solid transparent;
|
|
88
50
|
}
|
|
89
51
|
|
|
90
|
-
|
|
52
|
+
.listbox[hidden] {
|
|
91
53
|
display: none;
|
|
92
54
|
}
|
|
93
55
|
|
|
94
|
-
|
|
56
|
+
.control {
|
|
57
|
+
border: calc(${strokeWidth} * 1px) solid transparent;
|
|
58
|
+
border-radius: calc(${controlCornerRadius} * 1px);
|
|
59
|
+
height: calc(${heightNumber} * 1px);
|
|
95
60
|
align-items: center;
|
|
96
61
|
box-sizing: border-box;
|
|
97
62
|
cursor: pointer;
|
|
@@ -102,29 +67,13 @@ export const selectStyles = (context, definition) => css `
|
|
|
102
67
|
width: 100%;
|
|
103
68
|
}
|
|
104
69
|
|
|
105
|
-
:host(:not([disabled]):not([open]):hover) {
|
|
106
|
-
background: padding-box linear-gradient(${neutralFillHover}, ${neutralFillHover}),
|
|
107
|
-
border-box ${neutralStrokeControlHover};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
:host(:not([disabled]):not([open]):active) {
|
|
111
|
-
background: padding-box linear-gradient(${neutralFillActive}, ${neutralFillActive}),
|
|
112
|
-
border-box ${neutralStrokeControlActive};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
70
|
:host(:${focusVisible}) {
|
|
116
|
-
|
|
117
|
-
outline: none;
|
|
118
|
-
box-shadow: 0 0 0 1px inset ${focusStrokeOuter};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
:host([disabled]) {
|
|
122
|
-
cursor: ${disabledCursor};
|
|
123
|
-
opacity: ${disabledOpacity};
|
|
71
|
+
${focusTreatmentBase}
|
|
124
72
|
}
|
|
125
73
|
|
|
126
74
|
:host([disabled]) .control {
|
|
127
75
|
cursor: ${disabledCursor};
|
|
76
|
+
opacity: ${disabledOpacity};
|
|
128
77
|
user-select: none;
|
|
129
78
|
}
|
|
130
79
|
|
|
@@ -175,38 +124,16 @@ export const selectStyles = (context, definition) => css `
|
|
|
175
124
|
::slotted([role='option']) {
|
|
176
125
|
flex: 0 0 auto;
|
|
177
126
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
border-color: ${SystemColors.Highlight};
|
|
192
|
-
box-shadow: 0 0 0 1px inset ${SystemColors.Highlight};
|
|
193
|
-
}
|
|
194
|
-
:host([open]) .listbox {
|
|
195
|
-
background: ${SystemColors.ButtonFace};
|
|
196
|
-
border-color: ${SystemColors.CanvasText};
|
|
197
|
-
}
|
|
198
|
-
.start, .end, .indicator, ::slotted(svg) {
|
|
199
|
-
fill: ${SystemColors.FieldText};
|
|
200
|
-
}
|
|
201
|
-
:host([disabled]) {
|
|
202
|
-
border-color: ${SystemColors.GrayText};
|
|
203
|
-
color: ${SystemColors.GrayText};
|
|
204
|
-
opacity: 1;
|
|
205
|
-
}
|
|
206
|
-
:host([disabled]) .start,
|
|
207
|
-
:host([disabled]) .end,
|
|
208
|
-
:host([disabled]) .indicator,
|
|
209
|
-
:host([disabled]) ::slotted(svg) {
|
|
210
|
-
fill: ${SystemColors.GrayText};
|
|
211
|
-
}
|
|
212
|
-
`));
|
|
127
|
+
`;
|
|
128
|
+
/**
|
|
129
|
+
* @internal
|
|
130
|
+
*/
|
|
131
|
+
export const baseSelectForcedColorStyles = (context, definition) => css `
|
|
132
|
+
:host([open]) .listbox {
|
|
133
|
+
background: ${SystemColors.ButtonFace};
|
|
134
|
+
border-color: ${SystemColors.CanvasText};
|
|
135
|
+
}
|
|
136
|
+
`;
|
|
137
|
+
export const selectStyles = (context, definition) => baseSelectStyles(context, definition)
|
|
138
|
+
.withBehaviors(appearanceBehavior('outline', NeutralButtonStyles(context, definition, interactivitySelector, nonInteractivitySelector)), appearanceBehavior('filled', inputFilledStyles(context, definition, logicalControlSelector, interactivitySelector)
|
|
139
|
+
.withBehaviors(forcedColorsStylesheetBehavior(inputForcedColorStyles(context, definition, logicalControlSelector, interactivitySelector)))), appearanceBehavior('stealth', StealthButtonStyles(context, definition, interactivitySelector, nonInteractivitySelector)), forcedColorsStylesheetBehavior(baseSelectForcedColorStyles(context, definition)));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { cssPartial } from '@microsoft/fast-element';
|
|
2
|
+
import { focusStrokeOuter, focusStrokeWidth, strokeWidth } from '../design-tokens';
|
|
3
|
+
/**
|
|
4
|
+
* Partial CSS for the focus treatment for most typical sized components like Button, Menu Item, etc.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export const focusTreatmentBase = cssPartial `
|
|
9
|
+
outline: calc(${focusStrokeWidth} * 1px) solid ${focusStrokeOuter};
|
|
10
|
+
outline-offset: calc(${focusStrokeWidth} * -1px);
|
|
11
|
+
`;
|
|
12
|
+
/**
|
|
13
|
+
* Partial CSS for the focus treatment for tighter components with spacing constraints, like Checkbox
|
|
14
|
+
* and Radio, or plain text like Hypertext appearance Anchor or Breadcrumb Item.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export const focusTreatmentTight = cssPartial `
|
|
19
|
+
outline: calc(${focusStrokeWidth} * 1px) solid ${focusStrokeOuter};
|
|
20
|
+
outline-offset: calc(${strokeWidth} * 1px);
|
|
21
|
+
`;
|