@fluentui/web-components 3.0.0-beta.27 → 3.0.0-beta.29
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 +22 -2
- package/dist/dts/anchor-button/anchor-button.d.ts +88 -82
- 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-rollup.d.ts +1 -0
- package/dist/dts/index.d.ts +2 -3
- package/dist/dts/link/define.d.ts +1 -0
- package/dist/dts/link/index.d.ts +4 -0
- package/dist/dts/link/link.bench.d.ts +3 -0
- package/dist/dts/link/link.d.ts +33 -0
- package/dist/dts/link/link.definition.d.ts +7 -0
- package/dist/dts/link/link.options.d.ts +52 -0
- package/dist/dts/link/link.styles.d.ts +1 -0
- package/dist/dts/link/link.template.d.ts +12 -0
- 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 +97 -81
- 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-rollup.js +1 -0
- package/dist/esm/index-rollup.js.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/link/define.js +4 -0
- package/dist/esm/link/define.js.map +1 -0
- package/dist/esm/link/index.js +5 -0
- package/dist/esm/link/index.js.map +1 -0
- package/dist/esm/link/link.bench.js +11 -0
- package/dist/esm/link/link.bench.js.map +1 -0
- package/dist/esm/link/link.definition.js +15 -0
- package/dist/esm/link/link.definition.js.map +1 -0
- package/dist/esm/link/link.js +36 -0
- package/dist/esm/link/link.js.map +1 -0
- package/dist/esm/link/link.options.js +21 -0
- package/dist/esm/link/link.options.js.map +1 -0
- package/dist/esm/link/link.styles.js +67 -0
- package/dist/esm/link/link.styles.js.map +1 -0
- package/dist/esm/link/link.template.js +22 -0
- package/dist/esm/link/link.template.js.map +1 -0
- 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/esm/theme/set-theme.js +8 -3
- package/dist/esm/theme/set-theme.js.map +1 -1
- package/dist/web-components.d.ts +271 -391
- package/dist/web-components.js +351 -265
- package/dist/web-components.min.js +240 -246
- package/package.json +6 -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,7 +1,9 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { attr, FASTElement,
|
|
3
|
-
import {
|
|
2
|
+
import { attr, FASTElement, Observable } from '@microsoft/fast-element';
|
|
3
|
+
import { keyEnter } from '@microsoft/fast-web-utilities';
|
|
4
|
+
import { StartEnd } from '../patterns/index.js';
|
|
4
5
|
import { applyMixins } from '../utils/apply-mixins.js';
|
|
6
|
+
import { AnchorAttributes, } from './anchor-button.options.js';
|
|
5
7
|
/**
|
|
6
8
|
* An Anchor Custom HTML Element.
|
|
7
9
|
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element }.
|
|
@@ -14,100 +16,131 @@ import { applyMixins } from '../utils/apply-mixins.js';
|
|
|
14
16
|
*
|
|
15
17
|
* @public
|
|
16
18
|
*/
|
|
17
|
-
export class
|
|
19
|
+
export class BaseAnchor extends FASTElement {
|
|
18
20
|
constructor() {
|
|
19
|
-
super(
|
|
20
|
-
/**
|
|
21
|
-
* The anchor button has an icon only, no text content
|
|
22
|
-
*
|
|
23
|
-
* @public
|
|
24
|
-
* @remarks
|
|
25
|
-
* HTML Attribute: icon-only
|
|
26
|
-
*/
|
|
27
|
-
this.iconOnly = false;
|
|
28
|
-
/**
|
|
29
|
-
* The anchor button is disabled
|
|
30
|
-
*
|
|
31
|
-
* @public
|
|
32
|
-
* @remarks
|
|
33
|
-
* HTML Attribute: disabled-focusable
|
|
34
|
-
*/
|
|
35
|
-
this.disabled = false;
|
|
21
|
+
super();
|
|
36
22
|
/**
|
|
37
|
-
* The
|
|
23
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
38
24
|
*
|
|
39
|
-
* @
|
|
40
|
-
* @remarks
|
|
41
|
-
* HTML Attribute: disabled-focusable
|
|
25
|
+
* @internal
|
|
42
26
|
*/
|
|
43
|
-
this.
|
|
27
|
+
this.elementInternals = this.attachInternals();
|
|
44
28
|
/**
|
|
45
|
-
*
|
|
29
|
+
* The proxy anchor element
|
|
30
|
+
* @internal
|
|
46
31
|
*/
|
|
47
|
-
this.
|
|
48
|
-
|
|
49
|
-
e.stopImmediatePropagation();
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
32
|
+
this.internalProxyAnchor = this.createProxyElement();
|
|
33
|
+
this.elementInternals.role = 'link';
|
|
53
34
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
35
|
+
connectedCallback() {
|
|
36
|
+
super.connectedCallback();
|
|
37
|
+
Observable.getNotifier(this).subscribe(this);
|
|
38
|
+
Object.keys(this.$fastController.definition.attributeLookup).forEach(key => {
|
|
39
|
+
this.handleChange(this, key);
|
|
40
|
+
});
|
|
41
|
+
this.append(this.internalProxyAnchor);
|
|
42
|
+
}
|
|
43
|
+
disconnectedCallback() {
|
|
44
|
+
super.disconnectedCallback();
|
|
45
|
+
Observable.getNotifier(this).unsubscribe(this);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Handles changes to observable properties
|
|
49
|
+
* @internal
|
|
50
|
+
* @param source - the source of the change
|
|
51
|
+
* @param propertyName - the property name being changed
|
|
52
|
+
*/
|
|
53
|
+
handleChange(source, propertyName) {
|
|
54
|
+
var _a;
|
|
55
|
+
if (propertyName in AnchorAttributes) {
|
|
56
|
+
const attribute = (_a = this.$fastController.definition.attributeLookup[propertyName]) === null || _a === void 0 ? void 0 : _a.attribute;
|
|
57
|
+
if (attribute) {
|
|
58
|
+
this.handleProxyAttributeChange(attribute, this[propertyName]);
|
|
59
|
+
}
|
|
62
60
|
}
|
|
63
61
|
}
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Handles the anchor click event.
|
|
64
|
+
*
|
|
65
|
+
* @param e - The event object
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
clickHandler() {
|
|
69
|
+
this.internalProxyAnchor.click();
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Handles keypress events for the anchor.
|
|
74
|
+
*
|
|
75
|
+
* @param e - the keyboard event
|
|
76
|
+
* @returns - the return value of the click handler
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
keypressHandler(e) {
|
|
80
|
+
if (e.key === keyEnter) {
|
|
81
|
+
this.internalProxyAnchor.click();
|
|
66
82
|
return;
|
|
67
83
|
}
|
|
68
|
-
|
|
69
|
-
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A method for updating proxy attributes when attributes have changed
|
|
88
|
+
* @internal
|
|
89
|
+
* @param attribute - an attribute to set/remove
|
|
90
|
+
* @param value - the value of the attribute
|
|
91
|
+
*/
|
|
92
|
+
handleProxyAttributeChange(attribute, value) {
|
|
93
|
+
if (value) {
|
|
94
|
+
this.internalProxyAnchor.setAttribute(attribute, value);
|
|
70
95
|
}
|
|
71
96
|
else {
|
|
72
|
-
this.removeAttribute(
|
|
97
|
+
this.internalProxyAnchor.removeAttribute(attribute);
|
|
73
98
|
}
|
|
74
99
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
this.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
super.disconnectedCallback();
|
|
81
|
-
this.removeEventListener('click', this.handleDisabledFocusableClick);
|
|
100
|
+
createProxyElement() {
|
|
101
|
+
var _a;
|
|
102
|
+
const proxy = (_a = this.internalProxyAnchor) !== null && _a !== void 0 ? _a : document.createElement('a');
|
|
103
|
+
proxy.hidden = true;
|
|
104
|
+
return proxy;
|
|
82
105
|
}
|
|
83
106
|
}
|
|
84
107
|
__decorate([
|
|
85
108
|
attr
|
|
86
|
-
],
|
|
109
|
+
], BaseAnchor.prototype, "download", void 0);
|
|
87
110
|
__decorate([
|
|
88
111
|
attr
|
|
89
|
-
],
|
|
112
|
+
], BaseAnchor.prototype, "href", void 0);
|
|
90
113
|
__decorate([
|
|
91
114
|
attr
|
|
92
|
-
],
|
|
115
|
+
], BaseAnchor.prototype, "hreflang", void 0);
|
|
93
116
|
__decorate([
|
|
94
117
|
attr
|
|
95
|
-
],
|
|
118
|
+
], BaseAnchor.prototype, "ping", void 0);
|
|
96
119
|
__decorate([
|
|
97
120
|
attr
|
|
98
|
-
],
|
|
121
|
+
], BaseAnchor.prototype, "referrerpolicy", void 0);
|
|
99
122
|
__decorate([
|
|
100
123
|
attr
|
|
101
|
-
],
|
|
124
|
+
], BaseAnchor.prototype, "rel", void 0);
|
|
102
125
|
__decorate([
|
|
103
126
|
attr
|
|
104
|
-
],
|
|
127
|
+
], BaseAnchor.prototype, "target", void 0);
|
|
105
128
|
__decorate([
|
|
106
129
|
attr
|
|
107
|
-
],
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
130
|
+
], BaseAnchor.prototype, "type", void 0);
|
|
131
|
+
export class AnchorButton extends BaseAnchor {
|
|
132
|
+
constructor() {
|
|
133
|
+
super(...arguments);
|
|
134
|
+
/**
|
|
135
|
+
* The anchor button has an icon only, no text content
|
|
136
|
+
*
|
|
137
|
+
* @public
|
|
138
|
+
* @remarks
|
|
139
|
+
* HTML Attribute: `icon-only`
|
|
140
|
+
*/
|
|
141
|
+
this.iconOnly = false;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
111
144
|
__decorate([
|
|
112
145
|
attr
|
|
113
146
|
], AnchorButton.prototype, "appearance", void 0);
|
|
@@ -120,22 +153,5 @@ __decorate([
|
|
|
120
153
|
__decorate([
|
|
121
154
|
attr({ attribute: 'icon-only', mode: 'boolean' })
|
|
122
155
|
], AnchorButton.prototype, "iconOnly", void 0);
|
|
123
|
-
|
|
124
|
-
attr({ mode: 'boolean' })
|
|
125
|
-
], AnchorButton.prototype, "disabled", void 0);
|
|
126
|
-
__decorate([
|
|
127
|
-
attr({ attribute: 'disabled-focusable', mode: 'boolean' })
|
|
128
|
-
], AnchorButton.prototype, "disabledFocusable", void 0);
|
|
129
|
-
/**
|
|
130
|
-
* Includes ARIA states and properties relating to the ARIA link role
|
|
131
|
-
*
|
|
132
|
-
* @public
|
|
133
|
-
*/
|
|
134
|
-
export class DelegatesARIALink {
|
|
135
|
-
}
|
|
136
|
-
__decorate([
|
|
137
|
-
attr({ attribute: 'aria-expanded' })
|
|
138
|
-
], DelegatesARIALink.prototype, "ariaExpanded", void 0);
|
|
139
|
-
applyMixins(DelegatesARIALink, ARIAGlobalStatesAndProperties);
|
|
140
|
-
applyMixins(AnchorButton, StartEnd, DelegatesARIALink);
|
|
156
|
+
applyMixins(AnchorButton, StartEnd);
|
|
141
157
|
//# sourceMappingURL=anchor-button.js.map
|
|
@@ -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":"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"}
|
|
@@ -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
|
`));
|