@fluentui/web-components 3.0.0-beta.26 → 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.
Files changed (43) hide show
  1. package/CHANGELOG.md +22 -2
  2. package/dist/dts/anchor-button/anchor-button.d.ts +82 -78
  3. package/dist/dts/anchor-button/anchor-button.options.d.ts +21 -0
  4. package/dist/dts/button/button.styles.d.ts +4 -0
  5. package/dist/dts/divider/divider.d.ts +24 -1
  6. package/dist/dts/index.d.ts +0 -1
  7. package/dist/dts/progress-bar/index.d.ts +0 -1
  8. package/dist/dts/progress-bar/progress-bar.d.ts +56 -13
  9. package/dist/dts/progress-bar/progress-bar.options.d.ts +1 -10
  10. package/dist/dts/progress-bar/progress-bar.template.d.ts +1 -2
  11. package/dist/esm/anchor-button/anchor-button.definition.js +0 -3
  12. package/dist/esm/anchor-button/anchor-button.definition.js.map +1 -1
  13. package/dist/esm/anchor-button/anchor-button.js +78 -67
  14. package/dist/esm/anchor-button/anchor-button.js.map +1 -1
  15. package/dist/esm/anchor-button/anchor-button.options.js +15 -0
  16. package/dist/esm/anchor-button/anchor-button.options.js.map +1 -1
  17. package/dist/esm/anchor-button/anchor-button.styles.js +6 -258
  18. package/dist/esm/anchor-button/anchor-button.styles.js.map +1 -1
  19. package/dist/esm/anchor-button/anchor-button.template.js +7 -35
  20. package/dist/esm/anchor-button/anchor-button.template.js.map +1 -1
  21. package/dist/esm/button/button.styles.js +16 -5
  22. package/dist/esm/button/button.styles.js.map +1 -1
  23. package/dist/esm/dialog-body/dialog-body.template.js +1 -1
  24. package/dist/esm/dialog-body/dialog-body.template.js.map +1 -1
  25. package/dist/esm/divider/divider.js +38 -13
  26. package/dist/esm/divider/divider.js.map +1 -1
  27. package/dist/esm/divider/divider.template.js +1 -9
  28. package/dist/esm/divider/divider.template.js.map +1 -1
  29. package/dist/esm/index.js.map +1 -1
  30. package/dist/esm/progress-bar/index.js.map +1 -1
  31. package/dist/esm/progress-bar/progress-bar.js +62 -11
  32. package/dist/esm/progress-bar/progress-bar.js.map +1 -1
  33. package/dist/esm/progress-bar/progress-bar.styles.js +48 -127
  34. package/dist/esm/progress-bar/progress-bar.styles.js.map +1 -1
  35. package/dist/esm/progress-bar/progress-bar.template.js +8 -26
  36. package/dist/esm/progress-bar/progress-bar.template.js.map +1 -1
  37. package/dist/web-components.d.ts +159 -331
  38. package/dist/web-components.js +446 -371
  39. package/dist/web-components.min.js +214 -224
  40. package/package.json +1 -1
  41. package/dist/dts/progress-bar/base-progress.d.ts +0 -41
  42. package/dist/esm/progress-bar/base-progress.js +0 -56
  43. 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, observable } from '@microsoft/fast-element';
3
- import { ARIAGlobalStatesAndProperties, StartEnd } from '../patterns/index.js';
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 }.
@@ -16,69 +18,98 @@ import { applyMixins } from '../utils/apply-mixins.js';
16
18
  */
17
19
  export class AnchorButton extends FASTElement {
18
20
  constructor() {
19
- super(...arguments);
21
+ super();
20
22
  /**
21
- * The anchor button has an icon only, no text content
23
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
22
24
  *
23
- * @public
24
- * @remarks
25
- * HTML Attribute: icon-only
25
+ * @internal
26
26
  */
27
- this.iconOnly = false;
27
+ this.elementInternals = this.attachInternals();
28
28
  /**
29
- * The anchor button is disabled
30
- *
31
- * @public
32
- * @remarks
33
- * HTML Attribute: disabled-focusable
29
+ * The proxy anchor element
30
+ * @internal
34
31
  */
35
- this.disabled = false;
32
+ this.internalProxyAnchor = this.createProxyElement();
36
33
  /**
37
- * The anchor button is disabled but focusable
34
+ * The anchor button has an icon only, no text content
38
35
  *
39
36
  * @public
40
37
  * @remarks
41
- * HTML Attribute: disabled-focusable
42
- */
43
- this.disabledFocusable = false;
44
- /**
45
- * Prevents disabledFocusable click events
38
+ * HTML Attribute: `icon-only`
46
39
  */
47
- this.handleDisabledFocusableClick = (e) => {
48
- if ((e && this.disabled) || this.disabledFocusable) {
49
- e.stopImmediatePropagation();
50
- return;
51
- }
52
- };
40
+ this.iconOnly = false;
41
+ this.elementInternals.role = 'link';
53
42
  }
54
- disabledChanged(prev, next) {
55
- if (this.disabled) {
56
- this.setAttribute('aria-disabled', 'true');
57
- this.setAttribute('tabindex', '-1');
58
- }
59
- else {
60
- this.removeAttribute('aria-disabled');
61
- this.removeAttribute('tabindex');
43
+ connectedCallback() {
44
+ super.connectedCallback();
45
+ Observable.getNotifier(this).subscribe(this);
46
+ Object.keys(this.$fastController.definition.attributeLookup).forEach(key => {
47
+ this.handleChange(this, key);
48
+ });
49
+ this.append(this.internalProxyAnchor);
50
+ }
51
+ disconnectedCallback() {
52
+ super.disconnectedCallback();
53
+ Observable.getNotifier(this).unsubscribe(this);
54
+ }
55
+ /**
56
+ * Handles changes to observable properties
57
+ * @internal
58
+ * @param source
59
+ * @param propertyName
60
+ */
61
+ handleChange(source, propertyName) {
62
+ var _a;
63
+ if (propertyName in AnchorAttributes) {
64
+ const attribute = (_a = this.$fastController.definition.attributeLookup[propertyName]) === null || _a === void 0 ? void 0 : _a.attribute;
65
+ if (attribute) {
66
+ this.handleProxyAttributeChange(attribute, this[propertyName]);
67
+ }
62
68
  }
63
69
  }
64
- disabledFocusableChanged(prev, next) {
65
- if (!this.$fastController.isConnected) {
70
+ /**
71
+ * Handles the anchor click event.
72
+ *
73
+ * @param e - The event object
74
+ * @internal
75
+ */
76
+ clickHandler() {
77
+ this.internalProxyAnchor.click();
78
+ return true;
79
+ }
80
+ /**
81
+ * Handles keypress events for the anchor.
82
+ *
83
+ * @param e - the keyboard event
84
+ * @returns - the return value of the click handler
85
+ * @public
86
+ */
87
+ keypressHandler(e) {
88
+ if (e.key === keyEnter) {
89
+ this.internalProxyAnchor.click();
66
90
  return;
67
91
  }
68
- if (this.disabledFocusable) {
69
- this.setAttribute('aria-disabled', 'true');
92
+ return true;
93
+ }
94
+ /**
95
+ * A method for updating proxy attributes when attributes have changed
96
+ * @internal
97
+ * @param attribute
98
+ * @param value
99
+ */
100
+ handleProxyAttributeChange(attribute, value) {
101
+ if (value) {
102
+ this.internalProxyAnchor.setAttribute(attribute, value);
70
103
  }
71
104
  else {
72
- this.removeAttribute('aria-disabled');
105
+ this.internalProxyAnchor.removeAttribute(attribute);
73
106
  }
74
107
  }
75
- connectedCallback() {
76
- super.connectedCallback();
77
- this.addEventListener('click', this.handleDisabledFocusableClick);
78
- }
79
- disconnectedCallback() {
80
- super.disconnectedCallback();
81
- this.removeEventListener('click', this.handleDisabledFocusableClick);
108
+ createProxyElement() {
109
+ var _a;
110
+ const proxy = (_a = this.internalProxyAnchor) !== null && _a !== void 0 ? _a : document.createElement('a');
111
+ proxy.hidden = true;
112
+ return proxy;
82
113
  }
83
114
  }
84
115
  __decorate([
@@ -105,9 +136,6 @@ __decorate([
105
136
  __decorate([
106
137
  attr
107
138
  ], AnchorButton.prototype, "type", void 0);
108
- __decorate([
109
- observable
110
- ], AnchorButton.prototype, "defaultSlottedContent", void 0);
111
139
  __decorate([
112
140
  attr
113
141
  ], AnchorButton.prototype, "appearance", void 0);
@@ -120,22 +148,5 @@ __decorate([
120
148
  __decorate([
121
149
  attr({ attribute: 'icon-only', mode: 'boolean' })
122
150
  ], AnchorButton.prototype, "iconOnly", void 0);
123
- __decorate([
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);
151
+ applyMixins(AnchorButton, StartEnd);
141
152
  //# 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,6BAA6B,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAcvD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAA7C;;QAqHE;;;;;;WAMG;QAEI,aAAQ,GAAY,KAAK,CAAC;QAEjC;;;;;;WAMG;QAEI,aAAQ,GAAa,KAAK,CAAC;QAWlC;;;;;;WAMG;QAEI,sBAAiB,GAAa,KAAK,CAAC;QAa3C;;WAEG;QACK,iCAA4B,GAAG,CAAC,CAAa,EAAQ,EAAE;YAC7D,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,iBAAiB,EAAE;gBAClD,CAAC,CAAC,wBAAwB,EAAE,CAAC;gBAC7B,OAAO;aACR;QACH,CAAC,CAAC;IAaJ,CAAC;IApDW,eAAe,CAAC,IAAa,EAAE,IAAa;QACpD,IAAI,IAAI,CAAC,QAAQ,EAAE;YAChB,IAA+B,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;YACtE,IAA+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,kBAAkB;;QACxB,MAAM,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 { 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';
3
- import { forcedColorsStylesheetBehavior } from '../utils/behaviors/match-media-stylesheet-behavior.js';
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
- ${display('inline-flex')}
8
-
9
- :host {
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,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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CAAC"}
@@ -1,4 +1,4 @@
1
- import { html, ref, slotted } from '@microsoft/fast-element';
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
- <a
10
- class="control"
11
- part="control"
12
- download="${x => x.download}"
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 ${slotted('defaultSlottedContent')}></slot>
16
+ <slot></slot>
45
17
  </span>
46
18
  ${endSlotTemplate(options)}
47
- </a>
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,EAAE,GAAG,EAAE,OAAO,EAAgB,MAAM,yBAAyB,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG1E;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAyB,UAAyB,EAAE;IAChF,OAAO,IAAI,CAAG;;;;kBAIE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;cACnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;kBACP,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;cACnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;wBACD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc;aAChC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG;gBACP,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM;cACf,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;qBACJ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU;mBACnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;uBACX,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;sBACpB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW;0BACd,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe;sBAC1B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW;uBACjB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;2BACf,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB;uBAC3B,CAAC,CAAC,EA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AAsB,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
- * The styles for the Button component.
6
- *
7
- * @public
5
+ * @internal
8
6
  */
9
- export const styles = css `
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([appearance='transparent']:hover) {
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,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;aAChC,uBAAuB;;;;;wBAKZ,0BAA0B;aACrC,4BAA4B;;;;;wBAKjB,4BAA4B;aACvC,8BAA8B;;;;;YAK/B,iCAAiC;;;;YAIjC,mCAAmC;;;;wBAIvB,0BAA0B;aACrC,uBAAuB;;;;wBAIZ,+BAA+B;aAC1C,iCAAiC;;;;wBAItB,iCAAiC;aAC5C,mCAAmC;;;;;;;;;;;;wBAYxB,8BAA8B;oBAClC,0BAA0B;aACjC,8BAA8B;;;;;;;;;;;;;wBAanB,0BAA0B;;;;;;wBAM1B,0BAA0B;;;;;;;;wBAQ1B,0BAA0B;;CAEjD,CAAC,aAAa,CACb,8BAA8B,CAAC,GAAG,CAAA;;;;GAIjC,CAAC,CACH,CAAC"}
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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C,4BAA4B;;;;;wBAKjB,4BAA4B;aACvC,8BAA8B;;;;;YAK/B,iCAAiC;;;;YAIjC,mCAAmC;;;;wBAIvB,0BAA0B;aACrC,uBAAuB;;;;wBAIZ,+BAA+B;aAC1C,iCAAiC;;;;wBAItB,iCAAiC;aAC5C,mCAAmC;;;;;;;;CAQ/C,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,gBAAgB;;;;;wBAKI,8BAA8B;oBAClC,0BAA0B;aACjC,8BAA8B;;;;;;;;;;;;;wBAanB,0BAA0B;;;;;;wBAM1B,0BAA0B;;;;;;;;wBAQ1B,0BAA0B;;CAEjD,CAAC,aAAa,CACb,8BAA8B,CAAC,GAAG,CAAA;;;;;;;;;GASjC,CAAC,CACH,CAAC"}
@@ -23,7 +23,7 @@ export const template = html `
23
23
  <slot name="title"></slot>
24
24
  <slot name="title-action">
25
25
  <fluent-button
26
- ?hidden=${x => { var _a; return x.noTitleAction || ((_a = x.parentNode) === null || _a === void 0 ? void 0 : _a.type) !== DialogType.nonModal; }}
26
+ ?hidden=${x => { var _a; return x.noTitleAction || ((_a = x.parentNode) === null || _a === void 0 ? void 0 : _a.type) === DialogType.alert; }}
27
27
  tabindex="0"
28
28
  part="title-action"
29
29
  class="title-action"
@@ -1 +1 @@
1
- {"version":3,"file":"dialog-body.template.js","sourceRoot":"","sources":["../../../src/dialog-body/dialog-body.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC;;;;;;;;;;;;;SAa/B,CAAC,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAwB,IAAI,CAAA;;;;;kBAK/B,CAAC,CAAC,EAAE,WAAC,OAAA,CAAC,CAAC,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