@fluentui/web-components 3.0.0-beta.27 → 3.0.0-beta.28
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 +12 -2
- package/dist/dts/anchor-button/anchor-button.d.ts +82 -78
- package/dist/dts/anchor-button/anchor-button.options.d.ts +21 -0
- package/dist/dts/button/button.styles.d.ts +4 -0
- package/dist/dts/index.d.ts +0 -1
- package/dist/dts/progress-bar/index.d.ts +0 -1
- package/dist/dts/progress-bar/progress-bar.d.ts +56 -13
- package/dist/dts/progress-bar/progress-bar.options.d.ts +1 -10
- package/dist/dts/progress-bar/progress-bar.template.d.ts +1 -2
- package/dist/esm/anchor-button/anchor-button.definition.js +0 -3
- package/dist/esm/anchor-button/anchor-button.definition.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.js +78 -67
- package/dist/esm/anchor-button/anchor-button.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.options.js +15 -0
- package/dist/esm/anchor-button/anchor-button.options.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.styles.js +6 -258
- package/dist/esm/anchor-button/anchor-button.styles.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.template.js +7 -35
- package/dist/esm/anchor-button/anchor-button.template.js.map +1 -1
- package/dist/esm/button/button.styles.js +16 -5
- package/dist/esm/button/button.styles.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/progress-bar/index.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.js +62 -11
- package/dist/esm/progress-bar/progress-bar.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.styles.js +48 -127
- package/dist/esm/progress-bar/progress-bar.styles.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.template.js +8 -26
- package/dist/esm/progress-bar/progress-bar.template.js.map +1 -1
- package/dist/web-components.d.ts +135 -330
- package/dist/web-components.js +404 -367
- package/dist/web-components.min.js +214 -224
- package/package.json +1 -1
- package/dist/dts/progress-bar/base-progress.d.ts +0 -41
- package/dist/esm/progress-bar/base-progress.js +0 -56
- package/dist/esm/progress-bar/base-progress.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor-button.js","sourceRoot":"","sources":["../../../src/anchor-button/anchor-button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"anchor-button.js","sourceRoot":"","sources":["../../../src/anchor-button/anchor-button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACL,gBAAgB,GAKjB,MAAM,4BAA4B,CAAC;AAQpC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IA+I3C;QACE,KAAK,EAAE,CAAC;QA/IV;;;;WAIG;QACO,qBAAgB,GAAqB,IAAI,CAAC,eAAe,EAAE,CAAC;QAEtE;;;WAGG;QACK,wBAAmB,GAAsB,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAyH3E;;;;;;WAMG;QAEI,aAAQ,GAAY,KAAK,CAAC;QAK/B,IAAI,CAAC,gBAAgB,CAAC,IAAI,GAAG,MAAM,CAAC;IACtC,CAAC;IAEM,iBAAiB;QACtB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAE7C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,OAA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AAM,KAAK,GAAG,MAAA,IAAI,CAAC,mBAAmB,mCAAI,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACtE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;QACpB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA5MC;IADC,IAAI;8CACoB;AAWzB;IADC,IAAI;0CACgB;AAWrB;IADC,IAAI;8CACoB;AAWzB;IADC,IAAI;0CACgB;AAWrB;IADC,IAAI;oDAC0B;AAW/B;IADC,IAAI;yCACe;AAWpB;IADC,IAAI;4CACwB;AAW7B;IADC,IAAI;0CACgB;AAUrB;IADC,IAAI;gDACkD;AAUvD;IADC,IAAI;2CACwC;AAU7C;IADC,IAAI;0CAC0B;AAU/B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8CACjB;AAiGnC,WAAW,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -25,4 +25,19 @@ export const AnchorTarget = {
|
|
|
25
25
|
_parent: '_parent',
|
|
26
26
|
_top: '_top',
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* Reflected anchor attributes.
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
export const AnchorAttributes = {
|
|
34
|
+
download: 'download',
|
|
35
|
+
href: 'href',
|
|
36
|
+
hreflang: 'hreflang',
|
|
37
|
+
ping: 'ping',
|
|
38
|
+
referrerpolicy: 'referrerpolicy',
|
|
39
|
+
rel: 'rel',
|
|
40
|
+
target: 'target',
|
|
41
|
+
type: 'type',
|
|
42
|
+
};
|
|
28
43
|
//# sourceMappingURL=anchor-button.options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor-button.options.js","sourceRoot":"","sources":["../../../src/anchor-button/anchor-button.options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAIxF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AAQvD;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAQ7C;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAU3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;CACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"anchor-button.options.js","sourceRoot":"","sources":["../../../src/anchor-button/anchor-button.options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAIxF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AAQvD;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAQ7C;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAU3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;CACJ,CAAC;AASX;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,gBAAgB;IAChC,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAC"}
|
|
@@ -1,263 +1,11 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
|
-
import {
|
|
3
|
-
import { forcedColorsStylesheetBehavior } from '../utils/
|
|
4
|
-
import { display } from '../utils/display.js';
|
|
2
|
+
import { baseButtonStyles } from '../button/button.styles.js';
|
|
3
|
+
import { forcedColorsStylesheetBehavior } from '../utils/index.js';
|
|
5
4
|
// Need to support icon hover styles
|
|
6
|
-
export const styles = css `
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
--icon-spacing: ${spacingHorizontalSNudge};
|
|
11
|
-
contain: layout style;
|
|
12
|
-
vertical-align: middle;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
:host .control {
|
|
16
|
-
display: inline-flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
box-sizing: border-box;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
text-decoration-line: none;
|
|
21
|
-
margin: 0;
|
|
22
|
-
min-height: 32px;
|
|
23
|
-
outline-style: none;
|
|
24
|
-
background-color: ${colorNeutralBackground1};
|
|
25
|
-
color: ${colorNeutralForeground1};
|
|
26
|
-
border: ${strokeWidthThin} solid ${colorNeutralStroke1};
|
|
27
|
-
padding: 0 ${spacingHorizontalM};
|
|
28
|
-
min-width: 96px;
|
|
29
|
-
border-radius: ${borderRadiusMedium};
|
|
30
|
-
font-size: ${fontSizeBase300};
|
|
31
|
-
font-family: ${fontFamilyBase};
|
|
32
|
-
font-weight: ${fontWeightSemibold};
|
|
33
|
-
line-height: ${lineHeightBase300};
|
|
34
|
-
transition-duration: ${durationFaster};
|
|
35
|
-
transition-property: background, border, color;
|
|
36
|
-
transition-timing-function: ${curveEasyEase};
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.content {
|
|
41
|
-
display: inherit;
|
|
42
|
-
text-align: center;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:host(:hover) .control {
|
|
46
|
-
background-color: ${colorNeutralBackground1Hover};
|
|
47
|
-
color: ${colorNeutralForeground1Hover};
|
|
48
|
-
border-color: ${colorNeutralStroke1Hover};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
:host(:hover:active) .control {
|
|
52
|
-
background-color: ${colorNeutralBackground1Pressed};
|
|
53
|
-
border-color: ${colorNeutralStroke1Pressed};
|
|
54
|
-
color: ${colorNeutralForeground1Pressed};
|
|
55
|
-
outline-style: none;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
:host .control:focus-visible {
|
|
59
|
-
border-color: ${colorTransparentStroke};
|
|
60
|
-
outline: ${strokeWidthThick}) solid ${colorTransparentStroke};
|
|
61
|
-
box-shadow: ${shadow4}, 0 0 0 2px ${colorStrokeFocus2};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@media screen and (prefers-reduced-motion: reduce) {
|
|
65
|
-
transition-duration: 0.01ms;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
::slotted(svg) {
|
|
69
|
-
font-size: 20px;
|
|
70
|
-
height: 20px;
|
|
71
|
-
width: 20px;
|
|
72
|
-
fill: currentColor;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
[slot='start'],
|
|
76
|
-
::slotted([slot='start']) {
|
|
77
|
-
margin-inline-end: var(--icon-spacing);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
[slot='end'],
|
|
81
|
-
::slotted([slot='end']) {
|
|
82
|
-
margin-inline-start: var(--icon-spacing);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
:host([icon-only]) .control {
|
|
86
|
-
min-width: 32px;
|
|
87
|
-
max-width: 32px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
:host([size='small']) {
|
|
91
|
-
--icon-spacing: ${spacingHorizontalXS};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
:host([size='small']) .control {
|
|
95
|
-
min-height: 24px;
|
|
96
|
-
min-width: 64px;
|
|
97
|
-
padding: 0 ${spacingHorizontalS};
|
|
98
|
-
border-radius: ${borderRadiusSmall};
|
|
99
|
-
font-size: ${fontSizeBase200};
|
|
100
|
-
line-height: ${lineHeightBase200};
|
|
101
|
-
font-weight: ${fontWeightRegular};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
:host([size='small'][icon-only]) .control {
|
|
105
|
-
min-width: 24px;
|
|
106
|
-
max-width: 24px;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
:host([size='large']) .control {
|
|
110
|
-
min-height: 40px;
|
|
111
|
-
border-radius: ${borderRadiusLarge};
|
|
112
|
-
padding: 0 ${spacingHorizontalL};
|
|
113
|
-
font-size: ${fontSizeBase400};
|
|
114
|
-
line-height: ${lineHeightBase400};
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
:host([size='large'][icon-only]) .control {
|
|
118
|
-
min-width: 40px;
|
|
119
|
-
max-width: 40px;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
:host([size='large']) ::slotted(svg) {
|
|
123
|
-
font-size: 24px;
|
|
124
|
-
height: 24px;
|
|
125
|
-
width: 24px;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
:host([shape='circular']) .control,
|
|
129
|
-
:host([shape='circular']) .control:focus-visible {
|
|
130
|
-
border-radius: ${borderRadiusCircular};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
:host([shape='square']) .control,
|
|
134
|
-
:host([shape='square']) .control:focus-visible {
|
|
135
|
-
border-radius: ${borderRadiusNone};
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
:host([appearance='primary']) .control {
|
|
139
|
-
background-color: ${colorBrandBackground};
|
|
140
|
-
color: ${colorNeutralForegroundOnBrand};
|
|
141
|
-
border-color: transparent;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
:host([appearance='primary']:hover) .control {
|
|
145
|
-
background-color: ${colorBrandBackgroundHover};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
:host([appearance='primary']:hover) .control,
|
|
149
|
-
:host([appearance='primary']:hover:active) .control {
|
|
150
|
-
border-color: transparent;
|
|
151
|
-
color: ${colorNeutralForegroundOnBrand};
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
:host([appearance='primary']:hover:active) .control {
|
|
155
|
-
background-color: ${colorBrandBackgroundPressed};
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
:host([appearance='primary']) .control:focus-visible {
|
|
159
|
-
border-color: ${colorNeutralForegroundOnBrand};
|
|
160
|
-
box-shadow: ${shadow2}, 0 0 0 2px ${colorStrokeFocus2};
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
:host(:is([disabled][appearance='primary'], [disabled-focusabale][appearance='primary'])) .control,
|
|
164
|
-
:host(:is([disabled][appearance='primary'], [disabled-focusabale][appearance='primary']):hover) .control,
|
|
165
|
-
:host(:is([disabled][appearance='primary'], [disabled-focusabale][appearance='primary']):hover:active) .control {
|
|
166
|
-
border-color: transparent;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
:host([appearance='outline']) .control {
|
|
170
|
-
background-color: ${colorTransparentBackground};
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
:host([appearance='outline']:hover) .control {
|
|
174
|
-
background-color: ${colorTransparentBackgroundHover};
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
:host([appearance='outline']:hover:active) .control {
|
|
178
|
-
background-color: ${colorTransparentBackgroundPressed};
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
:host(:is([disabled][appearance='outline'], [disabled-focusabale][appearance='outline'])) .control,
|
|
182
|
-
:host(:is([disabled][appearance='outline'], [disabled-focusabale][appearance='outline']):hover) .control,
|
|
183
|
-
:host(:is([disabled][appearance='outline'], [disabled-focusabale][appearance='outline']):hover:active) .control {
|
|
184
|
-
background-color: ${colorTransparentBackground};
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
:host([appearance='subtle']) .control {
|
|
188
|
-
background-color: ${colorSubtleBackground};
|
|
189
|
-
color: ${colorNeutralForeground2};
|
|
190
|
-
border-color: transparent;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
:host([appearance='subtle']:hover) .control {
|
|
194
|
-
background-color: ${colorSubtleBackgroundHover};
|
|
195
|
-
color: ${colorNeutralForeground2Hover};
|
|
196
|
-
border-color: transparent;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
:host([appearance='subtle']:hover:active) .control {
|
|
200
|
-
background-color: ${colorSubtleBackgroundPressed};
|
|
201
|
-
color: ${colorNeutralForeground2Pressed};
|
|
202
|
-
border-color: transparent;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
:host(:is([disabled][appearance='subtle'], [disabled-focusabale][appearance='subtle'])) .control,
|
|
206
|
-
:host(:is([disabled][appearance='subtle'], [disabled-focusabale][appearance='subtle']):hover) .control,
|
|
207
|
-
:host(:is([disabled][appearance='subtle'], [disabled-focusabale][appearance='subtle']):hover:active) .control {
|
|
208
|
-
background-color: ${colorTransparentBackground};
|
|
209
|
-
border-color: transparent;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
:host([appearance='subtle']:hover) ::slotted(svg) {
|
|
213
|
-
fill: ${colorNeutralForeground2BrandHover};
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
:host([appearance='subtle']:hover:active) ::slotted(svg) {
|
|
217
|
-
fill: ${colorNeutralForeground2BrandPressed};
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
:host([appearance='transparent']) .control {
|
|
221
|
-
background-color: ${colorTransparentBackground};
|
|
222
|
-
color: ${colorNeutralForeground2};
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
:host([appearance='transparent']:hover) .control {
|
|
226
|
-
background-color: ${colorTransparentBackgroundHover};
|
|
227
|
-
color: ${colorNeutralForeground2BrandHover};
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
:host([appearance='transparent']:hover:active) .control {
|
|
231
|
-
background-color: ${colorTransparentBackgroundPressed};
|
|
232
|
-
color: ${colorNeutralForeground2BrandPressed};
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
:host([appearance='transparent']) .control,
|
|
236
|
-
:host([appearance='transparent']:hover) .control,
|
|
237
|
-
:host([appearance='transparent']:hover:active) .control {
|
|
238
|
-
border-color: transparent;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
:host(:is([disabled][appearance='transparent'], [disabled-focusabale][appearance='transparent'])) .control,
|
|
242
|
-
:host(:is([disabled][appearance='transparent'], [disabled-focusabale][appearance='transparent']):hover) .control,
|
|
243
|
-
:host(:is([disabled][appearance='transparent'], [disabled-focusabale][appearance='transparent']):hover:active)
|
|
244
|
-
.control {
|
|
245
|
-
border-color: transparent;
|
|
246
|
-
background-color: ${colorTransparentBackground};
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
:host(:is([disabled], [disabled-focusable], [appearance][disabled], [appearance][disabled-focusable])) .control,
|
|
250
|
-
:host(:is([disabled], [disabled-focusable], [appearance][disabled], [appearance][disabled-focusable]):hover) .control,
|
|
251
|
-
:host(:is([disabled], [disabled-focusable], [appearance][disabled], [appearance][disabled-focusable]):hover:active)
|
|
252
|
-
.control {
|
|
253
|
-
background-color: ${colorNeutralBackgroundDisabled};
|
|
254
|
-
border-color: ${colorNeutralStrokeDisabled};
|
|
255
|
-
color: ${colorNeutralForegroundDisabled};
|
|
256
|
-
cursor: not-allowed;
|
|
257
|
-
}
|
|
258
|
-
`.withBehaviors(forcedColorsStylesheetBehavior(css `
|
|
259
|
-
:host([appearance='transparent']:hover) .control {
|
|
260
|
-
border-color: Highlight;
|
|
5
|
+
export const styles = baseButtonStyles.withBehaviors(forcedColorsStylesheetBehavior(css `
|
|
6
|
+
:host {
|
|
7
|
+
border-color: LinkText;
|
|
8
|
+
color: LinkText;
|
|
261
9
|
}
|
|
262
10
|
`));
|
|
263
11
|
//# sourceMappingURL=anchor-button.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor-button.styles.js","sourceRoot":"","sources":["../../../src/anchor-button/anchor-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"anchor-button.styles.js","sourceRoot":"","sources":["../../../src/anchor-button/anchor-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AAEnE,oCAAoC;AACpC,MAAM,CAAC,MAAM,MAAM,GAAG,gBAAgB,CAAC,aAAa,CAClD,8BAA8B,CAAC,GAAG,CAAA;;;;;GAKjC,CAAC,CACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html
|
|
1
|
+
import { html } from '@microsoft/fast-element';
|
|
2
2
|
import { endSlotTemplate, startSlotTemplate } from '../patterns/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* The template for the Button component.
|
|
@@ -6,45 +6,17 @@ import { endSlotTemplate, startSlotTemplate } from '../patterns/index.js';
|
|
|
6
6
|
*/
|
|
7
7
|
export function anchorTemplate(options = {}) {
|
|
8
8
|
return html `
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
href="${x => x.href}"
|
|
14
|
-
hreflang="${x => x.hreflang}"
|
|
15
|
-
ping="${x => x.ping}"
|
|
16
|
-
referrerpolicy="${x => x.referrerpolicy}"
|
|
17
|
-
rel="${x => x.rel}"
|
|
18
|
-
target="${x => x.target}"
|
|
19
|
-
type="${x => x.type}"
|
|
20
|
-
aria-atomic="${x => x.ariaAtomic}"
|
|
21
|
-
aria-busy="${x => x.ariaBusy}"
|
|
22
|
-
aria-controls="${x => x.ariaControls}"
|
|
23
|
-
aria-current="${x => x.ariaCurrent}"
|
|
24
|
-
aria-describedby="${x => x.ariaDescribedby}"
|
|
25
|
-
aria-details="${x => x.ariaDetails}"
|
|
26
|
-
aria-disabled="${x => x.ariaDisabled}"
|
|
27
|
-
aria-errormessage="${x => x.ariaErrormessage}"
|
|
28
|
-
aria-expanded="${x => x.ariaExpanded}"
|
|
29
|
-
aria-flowto="${x => x.ariaFlowto}"
|
|
30
|
-
aria-haspopup="${x => x.ariaHaspopup}"
|
|
31
|
-
aria-hidden="${x => x.ariaHidden}"
|
|
32
|
-
aria-invalid="${x => x.ariaInvalid}"
|
|
33
|
-
aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
|
|
34
|
-
aria-label="${x => x.ariaLabel}"
|
|
35
|
-
aria-labelledby="${x => x.ariaLabelledby}"
|
|
36
|
-
aria-live="${x => x.ariaLive}"
|
|
37
|
-
aria-owns="${x => x.ariaOwns}"
|
|
38
|
-
aria-relevant="${x => x.ariaRelevant}"
|
|
39
|
-
aria-roledescription="${x => x.ariaRoledescription}"
|
|
40
|
-
${ref('control')}
|
|
9
|
+
<template
|
|
10
|
+
tabindex="0"
|
|
11
|
+
@click="${x => x.clickHandler()}"
|
|
12
|
+
@keypress="${(x, c) => x.keypressHandler(c.event)}"
|
|
41
13
|
>
|
|
42
14
|
${startSlotTemplate(options)}
|
|
43
15
|
<span class="content" part="content">
|
|
44
|
-
<slot
|
|
16
|
+
<slot></slot>
|
|
45
17
|
</span>
|
|
46
18
|
${endSlotTemplate(options)}
|
|
47
|
-
</
|
|
19
|
+
</template>
|
|
48
20
|
`;
|
|
49
21
|
}
|
|
50
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor-button.template.js","sourceRoot":"","sources":["../../../src/anchor-button/anchor-button.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,
|
|
1
|
+
{"version":3,"file":"anchor-button.template.js","sourceRoot":"","sources":["../../../src/anchor-button/anchor-button.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAgB,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG1E;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAyB,UAAyB,EAAE;IAChF,OAAO,IAAI,CAAG;;;gBAGA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE;mBAClB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,KAAsB,CAAC;;QAEhE,iBAAiB,CAAC,OAAO,CAAC;;;;QAI1B,eAAe,CAAC,OAAO,CAAC;;GAE7B,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAsC,cAAc,EAAE,CAAC"}
|
|
@@ -2,11 +2,9 @@ import { css } from '@microsoft/fast-element';
|
|
|
2
2
|
import { display, forcedColorsStylesheetBehavior } from '../utils/index.js';
|
|
3
3
|
import { borderRadiusCircular, borderRadiusLarge, borderRadiusMedium, borderRadiusNone, borderRadiusSmall, colorBrandBackground, colorBrandBackgroundHover, colorBrandBackgroundPressed, colorNeutralBackground1, colorNeutralBackground1Hover, colorNeutralBackground1Pressed, colorNeutralBackgroundDisabled, colorNeutralForeground1, colorNeutralForeground1Hover, colorNeutralForeground1Pressed, colorNeutralForeground2, colorNeutralForeground2BrandHover, colorNeutralForeground2BrandPressed, colorNeutralForeground2Hover, colorNeutralForeground2Pressed, colorNeutralForegroundDisabled, colorNeutralForegroundOnBrand, colorNeutralStroke1, colorNeutralStroke1Hover, colorNeutralStroke1Pressed, colorNeutralStrokeDisabled, colorStrokeFocus2, colorSubtleBackground, colorSubtleBackgroundHover, colorSubtleBackgroundPressed, colorTransparentBackground, colorTransparentBackgroundHover, colorTransparentBackgroundPressed, colorTransparentStroke, curveEasyEase, durationFaster, fontFamilyBase, fontSizeBase200, fontSizeBase300, fontSizeBase400, fontWeightRegular, fontWeightSemibold, lineHeightBase200, lineHeightBase300, lineHeightBase400, shadow2, shadow4, spacingHorizontalL, spacingHorizontalM, spacingHorizontalS, spacingHorizontalSNudge, spacingHorizontalXS, strokeWidthThick, strokeWidthThin, } from '../theme/design-tokens.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
5
|
+
* @internal
|
|
8
6
|
*/
|
|
9
|
-
export const
|
|
7
|
+
export const baseButtonStyles = css `
|
|
10
8
|
${display('inline-flex')}
|
|
11
9
|
|
|
12
10
|
:host {
|
|
@@ -215,6 +213,14 @@ export const styles = css `
|
|
|
215
213
|
:host([appearance='transparent']:hover:active) {
|
|
216
214
|
border-color: transparent;
|
|
217
215
|
}
|
|
216
|
+
`;
|
|
217
|
+
/**
|
|
218
|
+
* The styles for the Button component.
|
|
219
|
+
*
|
|
220
|
+
* @public
|
|
221
|
+
*/
|
|
222
|
+
export const styles = css `
|
|
223
|
+
${baseButtonStyles}
|
|
218
224
|
|
|
219
225
|
:host(:is([disabled], [disabled-focusable], [appearance][disabled], [appearance][disabled-focusable])),
|
|
220
226
|
:host(:is([disabled], [disabled-focusable], [appearance][disabled], [appearance][disabled-focusable]):hover),
|
|
@@ -251,7 +257,12 @@ export const styles = css `
|
|
|
251
257
|
background-color: ${colorTransparentBackground};
|
|
252
258
|
}
|
|
253
259
|
`.withBehaviors(forcedColorsStylesheetBehavior(css `
|
|
254
|
-
:host
|
|
260
|
+
:host {
|
|
261
|
+
background: ButtonFace;
|
|
262
|
+
color: ButtonText;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
:host(:is(:hover, :focus-visible)) {
|
|
255
266
|
border-color: Highlight;
|
|
256
267
|
}
|
|
257
268
|
`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.styles.js","sourceRoot":"","sources":["../../../src/button/button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,uBAAuB,EACvB,iCAAiC,EACjC,mCAAmC,EACnC,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,EACjC,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAEnC
|
|
1
|
+
{"version":3,"file":"button.styles.js","sourceRoot":"","sources":["../../../src/button/button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,uBAAuB,EACvB,4BAA4B,E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BAA0B,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,2BAA2B,EAC3B,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,sDAAsD,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/progress-bar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/progress-bar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC/G,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,QAAQ,IAAI,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,27 +1,66 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { attr } from '@microsoft/fast-element';
|
|
3
|
-
import { BaseProgress } from './base-progress.js';
|
|
2
|
+
import { attr, FASTElement, nullableNumberConverter, volatile } from '@microsoft/fast-element';
|
|
4
3
|
/**
|
|
5
4
|
* An Progress HTML Element.
|
|
6
5
|
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#progressbar | ARIA progressbar }.
|
|
7
6
|
*
|
|
8
|
-
* @slot indeterminate - The slot for a custom indeterminate indicator
|
|
9
|
-
* @csspart progress - Represents the progress element
|
|
10
|
-
* @csspart determinate - The determinate indicator
|
|
11
|
-
* @csspart indeterminate - The indeterminate indicator
|
|
12
|
-
*
|
|
13
7
|
* @public
|
|
14
8
|
*/
|
|
15
|
-
export class ProgressBar extends
|
|
9
|
+
export class ProgressBar extends FASTElement {
|
|
10
|
+
/**
|
|
11
|
+
* Updates the percent complete when the `value` property changes.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
valueChanged(prev, next) {
|
|
16
|
+
this.elementInternals.ariaValueNow = typeof next === 'number' ? `${next}` : null;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Updates the percent complete when the `min` property changes.
|
|
20
|
+
*
|
|
21
|
+
* @param prev - The previous min value
|
|
22
|
+
* @param next - The current min value
|
|
23
|
+
*/
|
|
24
|
+
minChanged(prev, next) {
|
|
25
|
+
this.elementInternals.ariaValueMin = typeof next === 'number' ? `${next}` : null;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Updates the percent complete when the `max` property changes.
|
|
29
|
+
*
|
|
30
|
+
* @param prev - The previous max value
|
|
31
|
+
* @param next - The current max value
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
maxChanged(prev, next) {
|
|
35
|
+
this.elementInternals.ariaValueMax = typeof next === 'number' ? `${next}` : null;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Indicates progress in %
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
get percentComplete() {
|
|
42
|
+
var _a, _b, _c;
|
|
43
|
+
const min = (_a = this.min) !== null && _a !== void 0 ? _a : 0;
|
|
44
|
+
const max = (_b = this.max) !== null && _b !== void 0 ? _b : 100;
|
|
45
|
+
const value = (_c = this.value) !== null && _c !== void 0 ? _c : 0;
|
|
46
|
+
const range = max - min;
|
|
47
|
+
return range === 0 ? 0 : Math.fround(((value - min) / range) * 100);
|
|
48
|
+
}
|
|
16
49
|
constructor() {
|
|
17
|
-
super(
|
|
50
|
+
super();
|
|
51
|
+
/**
|
|
52
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
53
|
+
*
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
this.elementInternals = this.attachInternals();
|
|
18
57
|
/**
|
|
19
58
|
* The validation state of the progress bar
|
|
20
59
|
* @public
|
|
21
|
-
*
|
|
22
|
-
* HTML Attribute: validation-state
|
|
60
|
+
* HTML Attribute: `validation-state`
|
|
23
61
|
*/
|
|
24
62
|
this.validationState = null;
|
|
63
|
+
this.elementInternals.role = 'progressbar';
|
|
25
64
|
}
|
|
26
65
|
}
|
|
27
66
|
__decorate([
|
|
@@ -33,4 +72,16 @@ __decorate([
|
|
|
33
72
|
__decorate([
|
|
34
73
|
attr({ attribute: 'validation-state' })
|
|
35
74
|
], ProgressBar.prototype, "validationState", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
attr({ converter: nullableNumberConverter })
|
|
77
|
+
], ProgressBar.prototype, "value", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
attr({ converter: nullableNumberConverter })
|
|
80
|
+
], ProgressBar.prototype, "min", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
attr({ converter: nullableNumberConverter })
|
|
83
|
+
], ProgressBar.prototype, "max", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
volatile
|
|
86
|
+
], ProgressBar.prototype, "percentComplete", null);
|
|
36
87
|
//# sourceMappingURL=progress-bar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar.js","sourceRoot":"","sources":["../../../src/progress-bar/progress-bar.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"progress-bar.js","sourceRoot":"","sources":["../../../src/progress-bar/progress-bar.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAG/F;;;;;GAKG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAyC1C;;;;OAIG;IACO,YAAY,CAAC,IAAwB,EAAE,IAAwB;QACvE,IAAI,CAAC,gBAAgB,CAAC,YAAY,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACnF,CAAC;IAUD;;;;;OAKG;IACO,UAAU,CAAC,IAAwB,EAAE,IAAwB;QACrE,IAAI,CAAC,gBAAgB,CAAC,YAAY,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACnF,CAAC;IAUD;;;;;;OAMG;IACO,UAAU,CAAC,IAAwB,EAAE,IAAwB;QACrE,IAAI,CAAC,gBAAgB,CAAC,YAAY,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACnF,CAAC;IAED;;;OAGG;IAEH,IAAW,eAAe;;QACxB,MAAM,GAAG,GAAG,MAAA,IAAI,CAAC,GAAG,mCAAI,CAAC,CAAC;QAC1B,MAAM,GAAG,GAAG,MAAA,IAAI,CAAC,GAAG,mCAAI,GAAG,CAAC;QAC5B,MAAM,KAAK,GAAG,MAAA,IAAI,CAAC,KAAK,mCAA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