@fluentui/web-components 3.0.0-beta.30 → 3.0.0-beta.32
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.md +28 -2
- package/dist/dts/anchor-button/anchor-button.d.ts +39 -4
- package/dist/dts/anchor-button/anchor-button.options.d.ts +0 -1
- package/dist/dts/badge/badge.d.ts +30 -0
- package/dist/dts/button/button.d.ts +25 -1
- package/dist/dts/button/button.options.d.ts +0 -1
- package/dist/dts/checkbox/checkbox.d.ts +13 -1
- package/dist/dts/compound-button/compound-button.options.d.ts +0 -5
- package/dist/dts/counter-badge/counter-badge.d.ts +36 -0
- package/dist/dts/divider/divider.d.ts +18 -0
- package/dist/dts/image/image.d.ts +36 -0
- package/dist/dts/label/label.d.ts +24 -0
- package/dist/dts/link/link.d.ts +12 -0
- package/dist/dts/menu-button/menu-button.options.d.ts +0 -1
- package/dist/dts/progress-bar/progress-bar.d.ts +18 -0
- package/dist/dts/spinner/spinner.d.ts +13 -1
- package/dist/dts/styles/states/index.d.ts +175 -0
- package/dist/dts/text-input/text-input.d.ts +12 -0
- package/dist/dts/toggle-button/toggle-button.options.d.ts +0 -1
- package/dist/esm/anchor-button/anchor-button.js +76 -8
- package/dist/esm/anchor-button/anchor-button.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.styles.js +8 -1
- package/dist/esm/anchor-button/anchor-button.styles.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.template.js +2 -2
- package/dist/esm/anchor-button/anchor-button.template.js.map +1 -1
- package/dist/esm/badge/badge.js +59 -0
- package/dist/esm/badge/badge.js.map +1 -1
- package/dist/esm/badge/badge.styles.js +6 -5
- package/dist/esm/badge/badge.styles.js.map +1 -1
- package/dist/esm/button/button.js +48 -0
- package/dist/esm/button/button.js.map +1 -1
- package/dist/esm/button/button.options.js +0 -1
- package/dist/esm/button/button.options.js.map +1 -1
- package/dist/esm/button/button.styles.js +40 -49
- package/dist/esm/button/button.styles.js.map +1 -1
- package/dist/esm/checkbox/checkbox.js +26 -0
- package/dist/esm/checkbox/checkbox.js.map +1 -1
- package/dist/esm/checkbox/checkbox.styles.js +6 -5
- package/dist/esm/checkbox/checkbox.styles.js.map +1 -1
- package/dist/esm/compound-button/compound-button.styles.js +14 -15
- package/dist/esm/compound-button/compound-button.styles.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.js +67 -0
- package/dist/esm/counter-badge/counter-badge.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.styles.js +12 -6
- package/dist/esm/counter-badge/counter-badge.styles.js.map +1 -1
- package/dist/esm/divider/divider.js +47 -2
- package/dist/esm/divider/divider.js.map +1 -1
- package/dist/esm/divider/divider.styles.js +31 -30
- package/dist/esm/divider/divider.styles.js.map +1 -1
- package/dist/esm/image/image.js +68 -0
- package/dist/esm/image/image.js.map +1 -1
- package/dist/esm/image/image.styles.js +10 -9
- package/dist/esm/image/image.styles.js.map +1 -1
- package/dist/esm/label/label.js +41 -0
- package/dist/esm/label/label.js.map +1 -1
- package/dist/esm/label/label.styles.js +7 -6
- package/dist/esm/label/label.styles.js.map +1 -1
- package/dist/esm/link/link.js +22 -0
- package/dist/esm/link/link.js.map +1 -1
- package/dist/esm/link/link.styles.js +11 -4
- package/dist/esm/link/link.styles.js.map +1 -1
- package/dist/esm/link/link.template.js +2 -2
- package/dist/esm/link/link.template.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.js +40 -0
- package/dist/esm/progress-bar/progress-bar.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.styles.js +7 -6
- package/dist/esm/progress-bar/progress-bar.styles.js.map +1 -1
- package/dist/esm/spinner/spinner.js +27 -0
- package/dist/esm/spinner/spinner.js.map +1 -1
- package/dist/esm/spinner/spinner.styles.js +9 -8
- package/dist/esm/spinner/spinner.styles.js.map +1 -1
- package/dist/esm/styles/partials/badge.partials.js +43 -42
- package/dist/esm/styles/partials/badge.partials.js.map +1 -1
- package/dist/esm/styles/states/index.js +177 -0
- package/dist/esm/styles/states/index.js.map +1 -0
- package/dist/esm/text-input/text-input.js +27 -0
- package/dist/esm/text-input/text-input.js.map +1 -1
- package/dist/esm/text-input/text-input.styles.js +23 -22
- package/dist/esm/text-input/text-input.styles.js.map +1 -1
- package/dist/esm/toggle-button/toggle-button.js +2 -1
- package/dist/esm/toggle-button/toggle-button.js.map +1 -1
- package/dist/esm/toggle-button/toggle-button.styles.js +24 -23
- package/dist/esm/toggle-button/toggle-button.styles.js.map +1 -1
- package/dist/web-components.d.ts +276 -16
- package/dist/web-components.js +649 -94
- package/dist/web-components.min.js +341 -340
- package/package.json +3 -2
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
/**
|
|
3
|
+
* Selector for the `filled-lighter` state.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export const filledLighterState = css.partial `:is([state--filled-lighter], :state(filled-lighter))`;
|
|
7
|
+
/**
|
|
8
|
+
* Selector for the `filled-darker` state.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export const filledDarkerState = css.partial `:is([state--filled-darker], :state(filled-darker))`;
|
|
12
|
+
/**
|
|
13
|
+
* Selector for the `ghost` state.
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export const ghostState = css.partial `:is([state--ghost], :state(ghost))`;
|
|
17
|
+
/**
|
|
18
|
+
* Selector for the `inverted` state.
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export const invertedState = css.partial `:is([state--inverted], :state(inverted))`;
|
|
22
|
+
/**
|
|
23
|
+
* Selector for the `primary` state.
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export const primaryState = css.partial `:is([state--primary], :state(primary))`;
|
|
27
|
+
/**
|
|
28
|
+
* Selector for the `outline` state.
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export const outlineState = css.partial `:is([state--outline], :state(outline))`;
|
|
32
|
+
/**
|
|
33
|
+
* Selector for the `strong` state.
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export const strongState = css.partial `:is([state--strong], :state(strong))`;
|
|
37
|
+
/**
|
|
38
|
+
* Selector for the `subtle` state.
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export const subtleState = css.partial `:is([state--subtle], :state(subtle))`;
|
|
42
|
+
/**
|
|
43
|
+
* Selector for the `tint` state.
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
export const tintState = css.partial `:is([state--tint], :state(tint))`;
|
|
47
|
+
/**
|
|
48
|
+
* Selector for the `underline` state.
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
export const underlineState = css.partial `:is([state--underline], :state(underline))`;
|
|
52
|
+
/**
|
|
53
|
+
* Selector for the `transparent` state.
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
export const transparentState = css.partial `:is([state--transparent], :state(transparent))`;
|
|
57
|
+
/**
|
|
58
|
+
* Selector for the `circular` state.
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
export const circularState = css.partial `:is([state--circular], :state(circular))`;
|
|
62
|
+
/**
|
|
63
|
+
* Selector for the `rounded` state.
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
export const roundedState = css.partial `:is([state--rounded], :state(rounded))`;
|
|
67
|
+
/**
|
|
68
|
+
* Selector for the `square` state.
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
export const squareState = css.partial `:is([state--square], :state(square))`;
|
|
72
|
+
/**
|
|
73
|
+
* Selector for the `tiny` state.
|
|
74
|
+
* @public
|
|
75
|
+
*/
|
|
76
|
+
export const tinyState = css.partial `:is([state--tiny], :state(tiny))`;
|
|
77
|
+
/**
|
|
78
|
+
* Selector for the `extra-small` state.
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
export const extraSmallState = css.partial `:is([state--extra-small], :state(extra-small))`;
|
|
82
|
+
/**
|
|
83
|
+
* Selector for the `small` state.
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
86
|
+
export const smallState = css.partial `:is([state--small], :state(small))`;
|
|
87
|
+
/**
|
|
88
|
+
* Selector for the `large` state.
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
export const largeState = css.partial `:is([state--large], :state(large))`;
|
|
92
|
+
/**
|
|
93
|
+
* Selector for the `extra-large` state.
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
export const extraLargeState = css.partial `:is([state--extra-large], :state(extra-large))`;
|
|
97
|
+
/**
|
|
98
|
+
* Selector for the `huge` state.
|
|
99
|
+
* @public
|
|
100
|
+
*/
|
|
101
|
+
export const hugeState = css.partial `:is([state--huge], :state(huge))`;
|
|
102
|
+
/**
|
|
103
|
+
* Selector for the `alignment` start state.
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
export const alignStartState = css.partial `:is([state--align-start], :state(align-start))`;
|
|
107
|
+
/**
|
|
108
|
+
* Selector for the `alignment` end state.
|
|
109
|
+
* @public
|
|
110
|
+
*/
|
|
111
|
+
export const alignEndState = css.partial `:is([state--align-end], :state(align-end))`;
|
|
112
|
+
/**
|
|
113
|
+
* Selector for the `inset` state.
|
|
114
|
+
* @public
|
|
115
|
+
*/
|
|
116
|
+
export const insetState = css.partial `:is([state--inset], :state(inset))`;
|
|
117
|
+
/**
|
|
118
|
+
* Selector for the `iconOnly` state.
|
|
119
|
+
* @public
|
|
120
|
+
*/
|
|
121
|
+
export const iconOnlyState = css.partial `:is([state--icon], :state(icon))`;
|
|
122
|
+
/**
|
|
123
|
+
* Selector for the `pressed` state.
|
|
124
|
+
* @public
|
|
125
|
+
*/
|
|
126
|
+
export const pressedState = css.partial `:is([state--pressed], :state(pressed))`;
|
|
127
|
+
/**
|
|
128
|
+
* Selector for the `brand` state.
|
|
129
|
+
* @public
|
|
130
|
+
*/
|
|
131
|
+
export const brandState = css.partial `:is([state--brand], :state(brand))`;
|
|
132
|
+
/**
|
|
133
|
+
* Selector for the `error` state.
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
export const errorState = css.partial `:is([state--error], :state(error))`;
|
|
137
|
+
/**
|
|
138
|
+
* Selector for the `danger` state.
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
export const dangerState = css.partial `:is([state--danger], :state(danger))`;
|
|
142
|
+
/**
|
|
143
|
+
* Selector for the `important` state.
|
|
144
|
+
* @public
|
|
145
|
+
*/
|
|
146
|
+
export const importantState = css.partial `:is([state--important], :state(important))`;
|
|
147
|
+
/**
|
|
148
|
+
* Selector for the `informative` state.
|
|
149
|
+
* @public
|
|
150
|
+
*/
|
|
151
|
+
export const informativeState = css.partial `:is([state--informative], :state(informative))`;
|
|
152
|
+
/**
|
|
153
|
+
* Selector for the `severe` state.
|
|
154
|
+
* @public
|
|
155
|
+
*/
|
|
156
|
+
export const severeState = css.partial `:is([state--severe], :state(severe))`;
|
|
157
|
+
/**
|
|
158
|
+
* Selector for the `success` state.
|
|
159
|
+
* @public
|
|
160
|
+
*/
|
|
161
|
+
export const successState = css.partial `:is([state--success], :state(success))`;
|
|
162
|
+
/**
|
|
163
|
+
* Selector for the `warning` state.
|
|
164
|
+
* @public
|
|
165
|
+
*/
|
|
166
|
+
export const warningState = css.partial `:is([state--warning], :state(warning))`;
|
|
167
|
+
/**
|
|
168
|
+
* Selector for the `vertical` state.
|
|
169
|
+
* @public
|
|
170
|
+
*/
|
|
171
|
+
export const verticalState = css.partial `:is([state--vertical], :state(vertical))`;
|
|
172
|
+
/**
|
|
173
|
+
* Selector for the `horizontal` state.
|
|
174
|
+
* @public
|
|
175
|
+
*/
|
|
176
|
+
export const horizontalState = css.partial `:is([state--horizontal], :state(horizontal))`;
|
|
177
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/styles/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AAA,oCAAoC,CAAC;AAE1E;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAA,sCAAsC,CAAC;AAE7E;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC,OAAO,CAAA,4CAA4C,CAAC;AAEtF;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAAA,gDAAgD,CAAC;AAE5F;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAA,sCAAsC,CAAC;AAE7E;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC,OAAO,CAAA,wCAAwC,CAAC;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC,OAAO,CAAA,wCAAwC,CAAC;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAA,0CAA0C,CAAC;AAEnF;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC,OAAO,CAAA,8CAA8C,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { attr, FASTElement, nullableNumberConverter, Observable, observable } from '@microsoft/fast-element';
|
|
3
3
|
import { StartEnd } from '../patterns/start-end.js';
|
|
4
4
|
import { applyMixins } from '../utils/apply-mixins.js';
|
|
5
|
+
import { toggleState } from '../utils/element-internals.js';
|
|
5
6
|
import { ImplicitSubmissionBlockingTypes, TextInputType } from './text-input.options.js';
|
|
6
7
|
/**
|
|
7
8
|
* A Text Input Custom HTML Element.
|
|
@@ -45,6 +46,32 @@ export class TextInput extends FASTElement {
|
|
|
45
46
|
*/
|
|
46
47
|
this.elementInternals = this.attachInternals();
|
|
47
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Handles changes to appearance attribute custom states
|
|
51
|
+
* @param prev - the previous state
|
|
52
|
+
* @param next - the next state
|
|
53
|
+
*/
|
|
54
|
+
appearanceChanged(prev, next) {
|
|
55
|
+
if (prev) {
|
|
56
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
57
|
+
}
|
|
58
|
+
if (next) {
|
|
59
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Handles changes to `control-size` attribute custom states
|
|
64
|
+
* @param prev - the previous state
|
|
65
|
+
* @param next - the next state
|
|
66
|
+
*/
|
|
67
|
+
controlSizeChanged(prev, next) {
|
|
68
|
+
if (prev) {
|
|
69
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
70
|
+
}
|
|
71
|
+
if (next) {
|
|
72
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
48
75
|
/**
|
|
49
76
|
* Updates the control label visibility based on the presence of default slotted content.
|
|
50
77
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-input.js","sourceRoot":"","sources":["../../../src/text-input/text-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC7G,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"text-input.js","sourceRoot":"","sources":["../../../src/text-input/text-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC7G,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAA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AAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE;SAClC;KACF,CAAC;6CAC0B;AAU5B;IADC,IAAI;uCAC2C;AAsBhD;IADC,UAAU;+CAC4B;AAoTzC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { borderRadiusMedium, colorCompoundBrandStroke, colorCompoundBrandStrokePressed, colorNeutralBackground1, colorNeutralBackground3, colorNeutralBackgroundInverted, colorNeutralForeground1, colorNeutralForeground3, colorNeutralForeground4, colorNeutralForegroundDisabled, colorNeutralForegroundInverted, colorNeutralStroke1, colorNeutralStroke1Hover, colorNeutralStroke1Pressed, colorNeutralStrokeAccessible, colorNeutralStrokeAccessibleHover, colorNeutralStrokeAccessiblePressed, colorNeutralStrokeDisabled, colorPaletteRedBorder2, colorTransparentBackground, colorTransparentStroke, colorTransparentStrokeInteractive, curveAccelerateMid, curveDecelerateMid, durationNormal, durationUltraFast, fontFamilyBase, fontSizeBase200, fontSizeBase300, fontSizeBase400, fontSizeBase500, fontSizeBase600, fontWeightRegular, lineHeightBase200, lineHeightBase300, lineHeightBase400, shadow2, spacingHorizontalM, spacingHorizontalMNudge, spacingHorizontalS, spacingHorizontalSNudge, spacingHorizontalXS, spacingHorizontalXXS, spacingVerticalXS, strokeWidthThin, } from '../theme/design-tokens.js';
|
|
3
3
|
import { display } from '../utils/display.js';
|
|
4
|
+
import { filledDarkerState, filledLighterState, largeState, outlineState, smallState, underlineState, } from '../styles/states/index.js';
|
|
4
5
|
/**
|
|
5
6
|
* Styles for the TextInput component.
|
|
6
7
|
*
|
|
@@ -120,7 +121,7 @@ export const styles = css `
|
|
|
120
121
|
:host(:focus-within:active) .root:after {
|
|
121
122
|
border-bottom-color: ${colorCompoundBrandStrokePressed};
|
|
122
123
|
}
|
|
123
|
-
:host(
|
|
124
|
+
:host(${outlineState}:focus-within) .root {
|
|
124
125
|
border: ${strokeWidthThin} solid ${colorNeutralStroke1};
|
|
125
126
|
}
|
|
126
127
|
:host(:focus-within) .control {
|
|
@@ -139,70 +140,70 @@ export const styles = css `
|
|
|
139
140
|
color: ${colorNeutralForegroundInverted};
|
|
140
141
|
background-color: ${colorNeutralBackgroundInverted};
|
|
141
142
|
}
|
|
142
|
-
:host(
|
|
143
|
+
:host(${smallState}) .control {
|
|
143
144
|
font-size: ${fontSizeBase200};
|
|
144
145
|
font-weight: ${fontWeightRegular};
|
|
145
146
|
line-height: ${lineHeightBase200};
|
|
146
147
|
}
|
|
147
|
-
:host(
|
|
148
|
+
:host(${smallState}) .root {
|
|
148
149
|
height: 24px;
|
|
149
150
|
gap: ${spacingHorizontalXXS};
|
|
150
151
|
padding: 0 ${spacingHorizontalSNudge};
|
|
151
152
|
}
|
|
152
|
-
:host(
|
|
153
|
-
:host(
|
|
153
|
+
:host(${smallState}) ::slotted([slot='start']),
|
|
154
|
+
:host(${smallState}) ::slotted([slot='end']) {
|
|
154
155
|
font-size: ${fontSizeBase400};
|
|
155
156
|
}
|
|
156
|
-
:host(
|
|
157
|
+
:host(${largeState}) .control {
|
|
157
158
|
font-size: ${fontSizeBase400};
|
|
158
159
|
font-weight: ${fontWeightRegular};
|
|
159
160
|
line-height: ${lineHeightBase400};
|
|
160
161
|
}
|
|
161
|
-
:host(
|
|
162
|
+
:host(${largeState}) .root {
|
|
162
163
|
height: 40px;
|
|
163
164
|
gap: ${spacingHorizontalS};
|
|
164
165
|
padding: 0 ${spacingHorizontalM};
|
|
165
166
|
}
|
|
166
|
-
:host(
|
|
167
|
-
:host(
|
|
167
|
+
:host(${largeState}) ::slotted([slot='start']),
|
|
168
|
+
:host(${largeState}) ::slotted([slot='end']) {
|
|
168
169
|
font-size: ${fontSizeBase600};
|
|
169
170
|
}
|
|
170
|
-
:host(
|
|
171
|
+
:host(${underlineState}) .root {
|
|
171
172
|
background: ${colorTransparentBackground};
|
|
172
173
|
border: 0;
|
|
173
174
|
border-radius: 0;
|
|
174
175
|
border-bottom: ${strokeWidthThin} solid ${colorNeutralStrokeAccessible};
|
|
175
176
|
}
|
|
176
|
-
:host(
|
|
177
|
+
:host(${underlineState}:hover) .root {
|
|
177
178
|
border-bottom-color: ${colorNeutralStrokeAccessibleHover};
|
|
178
179
|
}
|
|
179
|
-
:host(
|
|
180
|
+
:host(${underlineState}:active) .root {
|
|
180
181
|
border-bottom-color: ${colorNeutralStrokeAccessiblePressed};
|
|
181
182
|
}
|
|
182
|
-
:host(
|
|
183
|
+
:host(${underlineState}:focus-within) .root {
|
|
183
184
|
border: 0;
|
|
184
185
|
border-bottom-color: ${colorNeutralStrokeAccessiblePressed};
|
|
185
186
|
}
|
|
186
|
-
:host([
|
|
187
|
+
:host(${underlineState}[disabled]) .root {
|
|
187
188
|
border-bottom-color: ${colorNeutralStrokeDisabled};
|
|
188
189
|
}
|
|
189
|
-
:host(
|
|
190
|
-
:host(
|
|
190
|
+
:host(${filledLighterState}) .root,
|
|
191
|
+
:host(${filledDarkerState}) .root {
|
|
191
192
|
border: ${strokeWidthThin} solid ${colorTransparentStroke};
|
|
192
193
|
box-shadow: ${shadow2};
|
|
193
194
|
}
|
|
194
|
-
:host(
|
|
195
|
+
:host(${filledLighterState}) .root {
|
|
195
196
|
background: ${colorNeutralBackground1};
|
|
196
197
|
}
|
|
197
|
-
:host(
|
|
198
|
+
:host(${filledDarkerState}) .root {
|
|
198
199
|
background: ${colorNeutralBackground3};
|
|
199
200
|
}
|
|
200
|
-
:host(
|
|
201
|
-
:host(
|
|
201
|
+
:host(${filledLighterState}:hover) .root,
|
|
202
|
+
:host(${filledDarkerState}:hover) .root {
|
|
202
203
|
border-color: ${colorTransparentStrokeInteractive};
|
|
203
204
|
}
|
|
204
|
-
:host(
|
|
205
|
-
:host(
|
|
205
|
+
:host(${filledLighterState}:active) .root,
|
|
206
|
+
:host(${filledDarkerState}:active) .root {
|
|
206
207
|
border-color: ${colorTransparentStrokeInteractive};
|
|
207
208
|
background: ${colorNeutralBackground3};
|
|
208
209
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-input.styles.js","sourceRoot":"","sources":["../../../src/text-input/text-input.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,+BAA+B,EAC/B,uBAAuB,EACvB,uBAAuB,EACvB,8BAA8B,EAC9B,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,8BAA8B,EAC9B,8BAA8B,EAC9B,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC5B,iCAAiC,EACjC,mCAAmC,EACnC,0BAA0B,EAC1B,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,iCAAiC,EACjC,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,EACP,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"text-input.styles.js","sourceRoot":"","sources":["../../../src/text-input/text-input.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,+BAA+B,EAC/B,uBAAuB,EACvB,uBAAuB,EACvB,8BAA8B,EAC9B,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,8BAA8B,EAC9B,8BAA8B,EAC9B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aAOvB,uBAAuB;iBACnB,eAAe;;;qBAGX,oBAAoB;;;oBAGrB,oBAAoB;WAC7B,mBAAmB;;;oBAGV,wBAAwB;2BACjB,iCAAiC;;;oBAGxC,0BAA0B;;;;;;;;;2BASnB,cAAc;wBACjB,kBAAkB;;;2BAGf,+BAA+B;;UAEhD,YAAY;cACR,eAAe,UAAU,mBAAmB;;;aAG7C,uBAAuB;;;kBAGlB,0BAA0B;cAC9B,eAAe,UAAU,0BAA0B;;;;;aAKpD,8BAA8B;;;aAG9B,8BAA8B;wBACnB,8BAA8B;;UAE5C,UAAU;iBACH,eAAe;mBACb,iBAAiB;mBACjB,iBAAiB;;UAE1B,UAAU;;WAET,oBAAoB;iBACd,uBAAuB;;UAE9B,UAAU;UACV,UAAU;iBACH,eAAe;;UAEtB,UAAU;iBACH,eAAe;mBACb,iBAAiB;mBACjB,iBAAiB;;UAE1B,UAAU;;WAET,kBAAkB;iBACZ,kBAAkB;;UAEzB,UAAU;UACV,UAAU;iBACH,eAAe;;UAEtB,cAAc;kBACN,0BAA0B;;;qBAGvB,eAAe,UAAU,4BAA4B;;UAEhE,cAAc;2BACG,iCAAiC;;UAElD,cAAc;2BACG,mCAAmC;;UAEpD,cAAc;;2BAEG,mCAAmC;;UAEpD,cAAc;2BACG,0BAA0B;;UAE3C,kBAAkB;UAClB,iBAAiB;cACb,eAAe,UAAU,sBAAsB;kBAC3C,OAAO;;UAEf,kBAAkB;kBACV,uBAAuB;;UAE/B,iBAAiB;kBACT,uBAAuB;;UAE/B,kBAAkB;UAClB,iBAAiB;oBACP,iCAAiC;;UAE3C,kBAAkB;UAClB,iBAAiB;oBACP,iCAAiC;kBACnC,uBAAuB;;CAExC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { attr } from '@microsoft/fast-element';
|
|
3
3
|
import { Button } from '../button/button.js';
|
|
4
|
+
import { toggleState } from '../utils/element-internals.js';
|
|
4
5
|
/**
|
|
5
6
|
* The base class used for constructing a `<fluent-toggle-button>` custom element.
|
|
6
7
|
*
|
|
@@ -46,7 +47,7 @@ export class ToggleButton extends Button {
|
|
|
46
47
|
if (this.$fastController.isConnected) {
|
|
47
48
|
const ariaPressed = `${this.mixed ? 'mixed' : !!this.pressed}`;
|
|
48
49
|
this.elementInternals.ariaPressed = ariaPressed;
|
|
49
|
-
this.
|
|
50
|
+
toggleState(this.elementInternals, 'pressed', !!this.pressed || !!this.mixed);
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-button.js","sourceRoot":"","sources":["../../../src/toggle-button/toggle-button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"toggle-button.js","sourceRoot":"","sources":["../../../src/toggle-button/toggle-button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAM;IAWtC;;;;OAIG;IACO,cAAc;QACtB,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAYD;;;;;;OAMG;IACO,YAAY;QACpB,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACO,KAAK;QACb,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;IAC/B,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACK,eAAe;QACrB,IAAI,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE;YACpC,MAAM,WAAW,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAC/D,IAAI,CAAC,gBAAgB,CAAC,WAAW,GAAG,WAAW,CAAC;YAChD,WAAW,CAAC,IAAI,CAAC,gBAAgB,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC/E;IACH,CAAC;CACF;AA1DC;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;6CACD;AAmBzB;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;2CACH"}
|
|
@@ -2,6 +2,7 @@ import { css } from '@microsoft/fast-element';
|
|
|
2
2
|
import { styles as ButtonStyles } from '../button/button.styles.js';
|
|
3
3
|
import { colorBrandBackgroundHover, colorBrandBackgroundPressed, colorBrandBackgroundSelected, colorNeutralBackground1Hover, colorNeutralBackground1Pressed, colorNeutralBackground1Selected, colorNeutralForeground1, colorNeutralForeground2BrandHover, colorNeutralForeground2BrandPressed, colorNeutralForeground2BrandSelected, colorNeutralForeground2Hover, colorNeutralForeground2Pressed, colorNeutralForeground2Selected, colorNeutralForegroundOnBrand, colorNeutralStroke1, colorNeutralStroke1Hover, colorNeutralStroke1Pressed, colorSubtleBackgroundHover, colorSubtleBackgroundPressed, colorSubtleBackgroundSelected, colorTransparentBackgroundHover, colorTransparentBackgroundPressed, colorTransparentBackgroundSelected, strokeWidthThin, } from '../theme/design-tokens.js';
|
|
4
4
|
import { forcedColorsStylesheetBehavior } from '../utils/behaviors/match-media-stylesheet-behavior.js';
|
|
5
|
+
import { outlineState, pressedState, primaryState, subtleState, transparentState } from '../styles/states/index.js';
|
|
5
6
|
/**
|
|
6
7
|
* The styles for the ToggleButton component.
|
|
7
8
|
*
|
|
@@ -12,86 +13,86 @@ import { forcedColorsStylesheetBehavior } from '../utils/behaviors/match-media-s
|
|
|
12
13
|
export const styles = css `
|
|
13
14
|
${ButtonStyles}
|
|
14
15
|
|
|
15
|
-
:host(
|
|
16
|
+
:host(${pressedState}) {
|
|
16
17
|
border-color: ${colorNeutralStroke1};
|
|
17
18
|
background-color: ${colorNeutralBackground1Selected};
|
|
18
19
|
color: ${colorNeutralForeground1};
|
|
19
20
|
border-width: ${strokeWidthThin};
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
:host(
|
|
23
|
+
:host(${pressedState}:hover) {
|
|
23
24
|
border-color: ${colorNeutralStroke1Hover};
|
|
24
25
|
background-color: ${colorNeutralBackground1Hover};
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
:host(
|
|
28
|
+
:host(${pressedState}:active) {
|
|
28
29
|
border-color: ${colorNeutralStroke1Pressed};
|
|
29
30
|
background-color: ${colorNeutralBackground1Pressed};
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
:host(
|
|
33
|
+
:host(${pressedState}${primaryState}) {
|
|
33
34
|
border-color: transparent;
|
|
34
35
|
background-color: ${colorBrandBackgroundSelected};
|
|
35
36
|
color: ${colorNeutralForegroundOnBrand};
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
:host(
|
|
39
|
+
:host(${pressedState}${primaryState}:hover) {
|
|
39
40
|
background-color: ${colorBrandBackgroundHover};
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
:host(
|
|
43
|
+
:host(${pressedState}${primaryState}:active) {
|
|
43
44
|
background-color: ${colorBrandBackgroundPressed};
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
:host(
|
|
47
|
+
:host(${pressedState}${subtleState}) {
|
|
47
48
|
border-color: transparent;
|
|
48
49
|
background-color: ${colorSubtleBackgroundSelected};
|
|
49
50
|
color: ${colorNeutralForeground2Selected};
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
:host(
|
|
53
|
+
:host(${pressedState}${subtleState}:hover) {
|
|
53
54
|
background-color: ${colorSubtleBackgroundHover};
|
|
54
55
|
color: ${colorNeutralForeground2Hover};
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
:host(
|
|
58
|
+
:host(${pressedState}${subtleState}:active) {
|
|
58
59
|
background-color: ${colorSubtleBackgroundPressed};
|
|
59
60
|
color: ${colorNeutralForeground2Pressed};
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
:host(
|
|
63
|
-
:host(
|
|
63
|
+
:host(${pressedState}${outlineState}),
|
|
64
|
+
:host(${pressedState}${transparentState}) {
|
|
64
65
|
background-color: ${colorTransparentBackgroundSelected};
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
:host(
|
|
68
|
-
:host(
|
|
68
|
+
:host(${pressedState}${outlineState}:hover),
|
|
69
|
+
:host(${pressedState}${transparentState}:hover) {
|
|
69
70
|
background-color: ${colorTransparentBackgroundHover};
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
:host(
|
|
73
|
-
:host(
|
|
73
|
+
:host(${pressedState}${outlineState}:active),
|
|
74
|
+
:host(${pressedState}${transparentState}:active) {
|
|
74
75
|
background-color: ${colorTransparentBackgroundPressed};
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
:host(
|
|
78
|
+
:host(${pressedState}${transparentState}) {
|
|
78
79
|
border-color: transparent;
|
|
79
80
|
color: ${colorNeutralForeground2BrandSelected};
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
:host(
|
|
83
|
+
:host(${pressedState}${transparentState}:hover) {
|
|
83
84
|
color: ${colorNeutralForeground2BrandHover};
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
:host(
|
|
87
|
+
:host(${pressedState}${transparentState}:active) {
|
|
87
88
|
color: ${colorNeutralForeground2BrandPressed};
|
|
88
89
|
}
|
|
89
90
|
`.withBehaviors(forcedColorsStylesheetBehavior(css `
|
|
90
|
-
:host(
|
|
91
|
-
:host(
|
|
92
|
-
:host(
|
|
93
|
-
:host(
|
|
94
|
-
:host(
|
|
91
|
+
:host(${pressedState}),
|
|
92
|
+
:host(${pressedState}${primaryState}),
|
|
93
|
+
:host(${pressedState}${subtleState}),
|
|
94
|
+
:host(${pressedState}${outlineState}),
|
|
95
|
+
:host(${pressedState}${transparentState}) {
|
|
95
96
|
background: SelectedItem;
|
|
96
97
|
color: SelectedItemText;
|
|
97
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-button.styles.js","sourceRoot":"","sources":["../../../src/toggle-button/toggle-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,8BAA8B,EAC9B,+BAA+B,EAC/B,uBAAuB,EACvB,iCAAiC,EACjC,mCAAmC,EACnC,oCAAoC,EACpC,4BAA4B,EAC5B,8BAA8B,EAC9B,+BAA+B,EAC/B,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EAClC,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,8BAA8B,EAAE,MAAM,uDAAuD,CAAC;
|
|
1
|
+
{"version":3,"file":"toggle-button.styles.js","sourceRoot":"","sources":["../../../src/toggle-button/toggle-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,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