@fluentui/web-components 3.0.0-beta.30 → 3.0.0-beta.31
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 +38 -3
- package/dist/dts/anchor-button/anchor-button.options.d.ts +0 -1
- package/dist/dts/badge/badge.d.ts +30 -0
- package/dist/dts/button/button.d.ts +25 -1
- package/dist/dts/button/button.options.d.ts +0 -1
- package/dist/dts/compound-button/compound-button.options.d.ts +0 -5
- package/dist/dts/counter-badge/counter-badge.d.ts +36 -0
- package/dist/dts/menu-button/menu-button.options.d.ts +0 -1
- package/dist/dts/styles/states/index.d.ts +110 -0
- package/dist/dts/toggle-button/toggle-button.options.d.ts +0 -1
- package/dist/esm/anchor-button/anchor-button.js +76 -8
- package/dist/esm/anchor-button/anchor-button.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.styles.js +8 -1
- package/dist/esm/anchor-button/anchor-button.styles.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.template.js +2 -2
- package/dist/esm/anchor-button/anchor-button.template.js.map +1 -1
- package/dist/esm/badge/badge.js +59 -0
- package/dist/esm/badge/badge.js.map +1 -1
- package/dist/esm/badge/badge.styles.js +6 -5
- package/dist/esm/badge/badge.styles.js.map +1 -1
- package/dist/esm/button/button.js +48 -0
- package/dist/esm/button/button.js.map +1 -1
- package/dist/esm/button/button.options.js +0 -1
- package/dist/esm/button/button.options.js.map +1 -1
- package/dist/esm/button/button.styles.js +40 -49
- package/dist/esm/button/button.styles.js.map +1 -1
- package/dist/esm/compound-button/compound-button.styles.js +14 -15
- package/dist/esm/compound-button/compound-button.styles.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.js +67 -0
- package/dist/esm/counter-badge/counter-badge.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.styles.js +12 -6
- package/dist/esm/counter-badge/counter-badge.styles.js.map +1 -1
- package/dist/esm/link/link.styles.js +6 -0
- package/dist/esm/link/link.styles.js.map +1 -1
- package/dist/esm/link/link.template.js +2 -2
- package/dist/esm/link/link.template.js.map +1 -1
- package/dist/esm/styles/partials/badge.partials.js +43 -42
- package/dist/esm/styles/partials/badge.partials.js.map +1 -1
- package/dist/esm/styles/states/index.js +112 -0
- package/dist/esm/styles/states/index.js.map +1 -0
- package/dist/esm/toggle-button/toggle-button.js +2 -1
- package/dist/esm/toggle-button/toggle-button.js.map +1 -1
- package/dist/esm/toggle-button/toggle-button.styles.js +24 -23
- package/dist/esm/toggle-button/toggle-button.styles.js.map +1 -1
- package/dist/web-components.d.ts +129 -13
- package/dist/web-components.js +343 -80
- package/dist/web-components.min.js +305 -304
- package/package.json +3 -2
|
@@ -3,6 +3,7 @@ import { attr, FASTElement, nullableNumberConverter } from '@microsoft/fast-elem
|
|
|
3
3
|
// TODO: Remove with https://github.com/microsoft/fast/pull/6797
|
|
4
4
|
import { applyMixins } from '../utils/apply-mixins.js';
|
|
5
5
|
import { StartEnd } from '../patterns/index.js';
|
|
6
|
+
import { toggleState } from '../utils/element-internals.js';
|
|
6
7
|
/**
|
|
7
8
|
* The base class used for constructing a fluent-badge custom element
|
|
8
9
|
* @public
|
|
@@ -10,6 +11,12 @@ import { StartEnd } from '../patterns/index.js';
|
|
|
10
11
|
export class CounterBadge extends FASTElement {
|
|
11
12
|
constructor() {
|
|
12
13
|
super(...arguments);
|
|
14
|
+
/**
|
|
15
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
this.elementInternals = this.attachInternals();
|
|
13
20
|
/**
|
|
14
21
|
* The count the badge should have.
|
|
15
22
|
*
|
|
@@ -43,12 +50,72 @@ export class CounterBadge extends FASTElement {
|
|
|
43
50
|
*/
|
|
44
51
|
this.dot = false;
|
|
45
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Handles changes to appearance attribute custom states
|
|
55
|
+
* @param prev - the previous state
|
|
56
|
+
* @param next - the next state
|
|
57
|
+
*/
|
|
58
|
+
appearanceChanged(prev, next) {
|
|
59
|
+
if (prev) {
|
|
60
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
61
|
+
}
|
|
62
|
+
if (next) {
|
|
63
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Handles changes to color attribute custom states
|
|
68
|
+
* @param prev - the previous state
|
|
69
|
+
* @param next - the next state
|
|
70
|
+
*/
|
|
71
|
+
colorChanged(prev, next) {
|
|
72
|
+
if (prev) {
|
|
73
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
74
|
+
}
|
|
75
|
+
if (next) {
|
|
76
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Handles changes to shape attribute custom states
|
|
81
|
+
* @param prev - the previous state
|
|
82
|
+
* @param next - the next state
|
|
83
|
+
*/
|
|
84
|
+
shapeChanged(prev, next) {
|
|
85
|
+
if (prev) {
|
|
86
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
87
|
+
}
|
|
88
|
+
if (next) {
|
|
89
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Handles changes to size attribute custom states
|
|
94
|
+
* @param prev - the previous state
|
|
95
|
+
* @param next - the next state
|
|
96
|
+
*/
|
|
97
|
+
sizeChanged(prev, next) {
|
|
98
|
+
if (prev) {
|
|
99
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
100
|
+
}
|
|
101
|
+
if (next) {
|
|
102
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
46
105
|
countChanged() {
|
|
47
106
|
this.setCount();
|
|
48
107
|
}
|
|
49
108
|
overflowCountChanged() {
|
|
50
109
|
this.setCount();
|
|
51
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Handles changes to dot attribute custom states
|
|
113
|
+
* @param prev - the previous state
|
|
114
|
+
* @param next - the next state
|
|
115
|
+
*/
|
|
116
|
+
dotChanged(prev, next) {
|
|
117
|
+
toggleState(this.elementInternals, 'dot', !!next);
|
|
118
|
+
}
|
|
52
119
|
/**
|
|
53
120
|
* @internal
|
|
54
121
|
* Function to set the count
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"counter-badge.js","sourceRoot":"","sources":["../../../src/counter-badge/counter-badge.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACrF,gEAAgE;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"counter-badge.js","sourceRoot":"","sources":["../../../src/counter-badge/counter-badge.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACrF,gEAAgE;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAQ5D;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAA7C;;QACE;;;;WAIG;QACI,qBAAgB,GAAqB,IAAI,CAAC,eAAe,EAAE,CAAC;QAkGnE;;;;;;WAMG;QAEI,UAAK,GAAW,CAAC,CAAC;QAKzB;;;;;;WAMG;QAEI,kBAAa,GAAW,EAAE,CAAC;QAKlC;;;;;;WAMG;QAEI,aAAQ,GAAY,KAAK,CAAC;QAEjC;;;;;;WAMG;QAE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badgeSizeStyles } from '../styles/index.js';
|
|
3
3
|
import { borderRadiusMedium, borderRadiusSmall } from '../theme/design-tokens.js';
|
|
4
|
+
import { extraSmallState, roundedState, smallState, tinyState } from '../styles/states/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Selector for the `dot` state.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
const dotState = css.partial `:is([state--dot], :state(dot))`;
|
|
4
10
|
/** Badge styles
|
|
5
11
|
* @public
|
|
6
12
|
*/
|
|
7
13
|
export const styles = css `
|
|
8
|
-
:host(
|
|
14
|
+
:host(${roundedState}) {
|
|
9
15
|
border-radius: ${borderRadiusMedium};
|
|
10
16
|
}
|
|
11
17
|
|
|
12
|
-
:host(
|
|
13
|
-
:host(
|
|
14
|
-
:host(
|
|
18
|
+
:host(${roundedState}${tinyState}),
|
|
19
|
+
:host(${roundedState}${extraSmallState}),
|
|
20
|
+
:host(${roundedState}${smallState}) {
|
|
15
21
|
border-radius: ${borderRadiusSmall};
|
|
16
22
|
}
|
|
17
23
|
|
|
@@ -20,8 +26,8 @@ export const styles = css `
|
|
|
20
26
|
${badgeGhostStyles}
|
|
21
27
|
${badgeBaseStyles}
|
|
22
28
|
|
|
23
|
-
:host(
|
|
24
|
-
:host([
|
|
29
|
+
:host(${dotState}),
|
|
30
|
+
:host(${dotState}[appearance][size]) {
|
|
25
31
|
min-width: auto;
|
|
26
32
|
width: 6px;
|
|
27
33
|
height: 6px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"counter-badge.styles.js","sourceRoot":"","sources":["../../../src/counter-badge/counter-badge.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"counter-badge.styles.js","sourceRoot":"","sources":["../../../src/counter-badge/counter-badge.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEjG;;;GAGG;AACH,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAA,gCAAgC,CAAC;AAE7D;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;UACf,YAAY;qBACD,kBAAkB;;;UAG7B,YAAY,GAAG,SAAS;UACxB,YAAY,GAAG,eAAe;UAC9B,YAAY,GAAG,UAAU;qBACd,iBAAiB;;;IAGlC,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,eAAe;;UAET,QAAQ;UACR,QAAQ;;;;;;CAMjB,CAAC"}
|
|
@@ -5,6 +5,7 @@ export const styles = css `
|
|
|
5
5
|
${display('inline')}
|
|
6
6
|
|
|
7
7
|
:host {
|
|
8
|
+
position: relative;
|
|
8
9
|
box-sizing: border-box;
|
|
9
10
|
background-color: transparent;
|
|
10
11
|
color: ${colorBrandForegroundLink};
|
|
@@ -59,6 +60,11 @@ export const styles = css `
|
|
|
59
60
|
color: inherit;
|
|
60
61
|
text-decoration: none;
|
|
61
62
|
}
|
|
63
|
+
|
|
64
|
+
::slotted(a) {
|
|
65
|
+
position: absolute;
|
|
66
|
+
inset: 0;
|
|
67
|
+
}
|
|
62
68
|
`.withBehaviors(forcedColorsStylesheetBehavior(css `
|
|
63
69
|
:host {
|
|
64
70
|
color: LinkText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.styles.js","sourceRoot":"","sources":["../../../src/link/link.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,wBAAwB,EACxB,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAC3B,gCAAgC,EAChC,kCAAkC,EAClC,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,OAAO,CAAC,QAAQ,CAAC
|
|
1
|
+
{"version":3,"file":"link.styles.js","sourceRoot":"","sources":["../../../src/link/link.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,wBAAwB,EACxB,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAC3B,gCAAgC,EAChC,kCAAkC,EAClC,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,OAAO,CAAC,QAAQ,CAAC;;;;;;aAMR,wBAAwB;;mBAElB,cAAc;iBAChB,eAAe;mBACb,iBAAiB;;;;;;iCAMH,eAAe;;;;;;;;;;;;eAYjC,6BAA6B;;;;eAI7B,+BAA+B;;;;eAI/B,gCAAgC;;;;eAIhC,kCAAkC;;;;;aAKpC,2BAA2B;;;;;;;;;;;;;;;;;;CAkBvC,CAAC,aAAa,CACb,8BAA8B,CAAC,GAAG,CAAA;;;;GAIjC,CAAC,CACH,CAAC"}
|
|
@@ -7,8 +7,8 @@ export function anchorTemplate() {
|
|
|
7
7
|
return html `
|
|
8
8
|
<template
|
|
9
9
|
tabindex="0"
|
|
10
|
-
@click="${x => x.clickHandler()}"
|
|
11
|
-
@
|
|
10
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
11
|
+
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
12
12
|
>
|
|
13
13
|
<slot></slot>
|
|
14
14
|
</template>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.template.js","sourceRoot":"","sources":["../../../src/link/link.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAgB,MAAM,yBAAyB,CAAC;AAGlF;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,IAAI,CAAG;;;gBAGA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"link.template.js","sourceRoot":"","sources":["../../../src/link/link.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAgB,MAAM,yBAAyB,CAAC;AAGlF;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,IAAI,CAAG;;;gBAGA,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAqB,CAAC;kBAC/C,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,KAAsB,CAAC;;;;GAInE,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA8B,cAAc,EAAE,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { display } from '../../utils/index.js';
|
|
3
3
|
import { borderRadiusCircular, colorBrandBackground, colorBrandBackground2, colorBrandForeground1, colorBrandForeground2, colorBrandStroke2, colorNeutralBackground1, colorNeutralBackground4, colorNeutralBackground5, colorNeutralForeground1, colorNeutralForeground1Static, colorNeutralForeground3, colorNeutralForegroundInverted, colorNeutralForegroundOnBrand, colorNeutralForegroundStaticInverted, colorNeutralStroke2, colorNeutralStrokeAccessible, colorPaletteDarkOrangeBackground1, colorPaletteDarkOrangeBackground3, colorPaletteDarkOrangeBorder1, colorPaletteDarkOrangeForeground1, colorPaletteDarkOrangeForeground3, colorPaletteGreenBackground1, colorPaletteGreenBackground3, colorPaletteGreenBorder2, colorPaletteGreenForeground1, colorPaletteGreenForeground2, colorPaletteGreenForeground3, colorPaletteRedBackground1, colorPaletteRedBackground3, colorPaletteRedBorder1, colorPaletteRedForeground1, colorPaletteRedForeground3, colorPaletteYellowBackground1, colorPaletteYellowBackground3, colorPaletteYellowBorder1, colorPaletteYellowForeground2, colorTransparentStroke, fontFamilyBase, fontSizeBase100, fontSizeBase200, fontWeightSemibold, lineHeightBase100, lineHeightBase200, spacingHorizontalSNudge, spacingHorizontalXS, spacingHorizontalXXS, strokeWidthThin, } from '../../theme/design-tokens.js';
|
|
4
|
+
import { dangerState, extraLargeState, extraSmallState, ghostState, importantState, informativeState, largeState, outlineState, severeState, smallState, subtleState, successState, tintState, tinyState, warningState, } from '../states/index.js';
|
|
4
5
|
const textPadding = spacingHorizontalXXS;
|
|
5
6
|
export const badgeBaseStyles = css.partial `
|
|
6
7
|
${display('inline-flex')} :host {
|
|
@@ -26,7 +27,7 @@ export const badgeBaseStyles = css.partial `
|
|
|
26
27
|
font-size: 12px;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
:host(:not(
|
|
30
|
+
:host(:not(${ghostState}))::after {
|
|
30
31
|
position: absolute;
|
|
31
32
|
content: '';
|
|
32
33
|
top: 0;
|
|
@@ -44,7 +45,7 @@ export const badgeBaseStyles = css.partial `
|
|
|
44
45
|
* The badge's size styles
|
|
45
46
|
*/
|
|
46
47
|
export const badgeSizeStyles = css.partial `
|
|
47
|
-
:host(
|
|
48
|
+
:host(${tinyState}) {
|
|
48
49
|
width: 6px;
|
|
49
50
|
height: 6px;
|
|
50
51
|
font-size: 4px;
|
|
@@ -52,10 +53,10 @@ export const badgeSizeStyles = css.partial `
|
|
|
52
53
|
padding-inline: 0;
|
|
53
54
|
min-width: unset;
|
|
54
55
|
}
|
|
55
|
-
:host(
|
|
56
|
+
:host(${tinyState}) ::slotted(svg) {
|
|
56
57
|
font-size: 6px;
|
|
57
58
|
}
|
|
58
|
-
:host(
|
|
59
|
+
:host(${extraSmallState}) {
|
|
59
60
|
width: 10px;
|
|
60
61
|
height: 10px;
|
|
61
62
|
font-size: 6px;
|
|
@@ -63,37 +64,37 @@ export const badgeSizeStyles = css.partial `
|
|
|
63
64
|
padding-inline: 0;
|
|
64
65
|
min-width: unset;
|
|
65
66
|
}
|
|
66
|
-
:host(
|
|
67
|
+
:host(${extraSmallState}) ::slotted(svg) {
|
|
67
68
|
font-size: 10px;
|
|
68
69
|
}
|
|
69
|
-
:host(
|
|
70
|
+
:host(${smallState}) {
|
|
70
71
|
min-width: 16px;
|
|
71
72
|
height: 16px;
|
|
72
73
|
font-size: ${fontSizeBase100};
|
|
73
74
|
line-height: ${lineHeightBase100};
|
|
74
75
|
padding-inline: calc(${spacingHorizontalXXS} + ${textPadding});
|
|
75
76
|
}
|
|
76
|
-
:host(
|
|
77
|
+
:host(${smallState}) ::slotted(svg) {
|
|
77
78
|
font-size: 12px;
|
|
78
79
|
}
|
|
79
|
-
:host(
|
|
80
|
+
:host(${largeState}) {
|
|
80
81
|
min-width: 24px;
|
|
81
82
|
height: 24px;
|
|
82
83
|
font-size: ${fontSizeBase200};
|
|
83
84
|
line-height: ${lineHeightBase200};
|
|
84
85
|
padding-inline: calc(${spacingHorizontalXS} + ${textPadding});
|
|
85
86
|
}
|
|
86
|
-
:host(
|
|
87
|
+
:host(${largeState}) ::slotted(svg) {
|
|
87
88
|
font-size: 16px;
|
|
88
89
|
}
|
|
89
|
-
:host(
|
|
90
|
+
:host(${extraLargeState}) {
|
|
90
91
|
min-width: 32px;
|
|
91
92
|
height: 32px;
|
|
92
93
|
font-size: ${fontSizeBase200};
|
|
93
94
|
line-height: ${lineHeightBase200};
|
|
94
95
|
padding-inline: calc(${spacingHorizontalSNudge} + ${textPadding});
|
|
95
96
|
}
|
|
96
|
-
:host(
|
|
97
|
+
:host(${extraLargeState}) ::slotted(svg) {
|
|
97
98
|
font-size: 20px;
|
|
98
99
|
}
|
|
99
100
|
`;
|
|
@@ -104,37 +105,37 @@ export const badgeSizeStyles = css.partial `
|
|
|
104
105
|
* @public
|
|
105
106
|
*/
|
|
106
107
|
export const badgeFilledStyles = css.partial `
|
|
107
|
-
:host(
|
|
108
|
+
:host(${dangerState}) {
|
|
108
109
|
background-color: ${colorPaletteRedBackground3};
|
|
109
110
|
color: ${colorNeutralForegroundOnBrand};
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
:host(
|
|
113
|
+
:host(${importantState}) {
|
|
113
114
|
background-color: ${colorNeutralForeground1};
|
|
114
115
|
color: ${colorNeutralBackground1};
|
|
115
116
|
}
|
|
116
117
|
|
|
117
|
-
:host(
|
|
118
|
+
:host(${informativeState}) {
|
|
118
119
|
background-color: ${colorNeutralBackground5};
|
|
119
120
|
color: ${colorNeutralForeground3};
|
|
120
121
|
}
|
|
121
122
|
|
|
122
|
-
:host(
|
|
123
|
+
:host(${severeState}) {
|
|
123
124
|
background-color: ${colorPaletteDarkOrangeBackground3};
|
|
124
125
|
color: ${colorNeutralForegroundOnBrand};
|
|
125
126
|
}
|
|
126
127
|
|
|
127
|
-
:host(
|
|
128
|
+
:host(${subtleState}) {
|
|
128
129
|
background-color: ${colorNeutralBackground1};
|
|
129
130
|
color: ${colorNeutralForeground1};
|
|
130
131
|
}
|
|
131
132
|
|
|
132
|
-
:host(
|
|
133
|
+
:host(${successState}) {
|
|
133
134
|
background-color: ${colorPaletteGreenBackground3};
|
|
134
135
|
color: ${colorNeutralForegroundOnBrand};
|
|
135
136
|
}
|
|
136
137
|
|
|
137
|
-
:host(
|
|
138
|
+
:host(${warningState}) {
|
|
138
139
|
background-color: ${colorPaletteYellowBackground3};
|
|
139
140
|
color: ${colorNeutralForeground1Static};
|
|
140
141
|
}
|
|
@@ -144,36 +145,36 @@ export const badgeFilledStyles = css.partial `
|
|
|
144
145
|
* @public
|
|
145
146
|
*/
|
|
146
147
|
export const badgeGhostStyles = css.partial `
|
|
147
|
-
:host(
|
|
148
|
+
:host(${ghostState}) {
|
|
148
149
|
color: ${colorBrandForeground1};
|
|
149
150
|
background-color: initial;
|
|
150
151
|
}
|
|
151
152
|
|
|
152
|
-
:host(
|
|
153
|
+
:host(${ghostState}${dangerState}) {
|
|
153
154
|
color: ${colorPaletteRedForeground3};
|
|
154
155
|
}
|
|
155
156
|
|
|
156
|
-
:host(
|
|
157
|
+
:host(${ghostState}${importantState}) {
|
|
157
158
|
color: ${colorNeutralForeground1};
|
|
158
159
|
}
|
|
159
160
|
|
|
160
|
-
:host(
|
|
161
|
+
:host(${ghostState}${informativeState}) {
|
|
161
162
|
color: ${colorNeutralForeground3};
|
|
162
163
|
}
|
|
163
164
|
|
|
164
|
-
:host(
|
|
165
|
+
:host(${ghostState}${severeState}) {
|
|
165
166
|
color: ${colorPaletteDarkOrangeForeground3};
|
|
166
167
|
}
|
|
167
168
|
|
|
168
|
-
:host(
|
|
169
|
+
:host(${ghostState}${subtleState}) {
|
|
169
170
|
color: ${colorNeutralForegroundInverted};
|
|
170
171
|
}
|
|
171
172
|
|
|
172
|
-
:host(
|
|
173
|
+
:host(${ghostState}${successState}) {
|
|
173
174
|
color: ${colorPaletteGreenForeground3};
|
|
174
175
|
}
|
|
175
176
|
|
|
176
|
-
:host(
|
|
177
|
+
:host(${ghostState}${warningState}) {
|
|
177
178
|
color: ${colorPaletteYellowForeground2};
|
|
178
179
|
}
|
|
179
180
|
`;
|
|
@@ -182,39 +183,39 @@ export const badgeGhostStyles = css.partial `
|
|
|
182
183
|
* @public
|
|
183
184
|
*/
|
|
184
185
|
export const badgeOutlineStyles = css.partial `
|
|
185
|
-
:host(
|
|
186
|
+
:host(${outlineState}) {
|
|
186
187
|
border-color: currentColor;
|
|
187
188
|
color: ${colorBrandForeground1};
|
|
188
189
|
background-color: initial;
|
|
189
190
|
}
|
|
190
191
|
|
|
191
|
-
:host(
|
|
192
|
+
:host(${outlineState}${dangerState}) {
|
|
192
193
|
color: ${colorPaletteRedForeground3};
|
|
193
194
|
}
|
|
194
195
|
|
|
195
|
-
:host(
|
|
196
|
+
:host(${outlineState}${importantState}) {
|
|
196
197
|
color: ${colorNeutralForeground3};
|
|
197
198
|
border-color: ${colorNeutralStrokeAccessible};
|
|
198
199
|
}
|
|
199
200
|
|
|
200
|
-
:host(
|
|
201
|
+
:host(${outlineState}${informativeState}) {
|
|
201
202
|
color: ${colorNeutralForeground3};
|
|
202
203
|
border-color: ${colorNeutralStroke2};
|
|
203
204
|
}
|
|
204
205
|
|
|
205
|
-
:host(
|
|
206
|
+
:host(${outlineState}${severeState}) {
|
|
206
207
|
color: ${colorPaletteDarkOrangeForeground3};
|
|
207
208
|
}
|
|
208
209
|
|
|
209
|
-
:host(
|
|
210
|
+
:host(${outlineState}${subtleState}) {
|
|
210
211
|
color: ${colorNeutralForegroundStaticInverted};
|
|
211
212
|
}
|
|
212
213
|
|
|
213
|
-
:host(
|
|
214
|
+
:host(${outlineState}${successState}) {
|
|
214
215
|
color: ${colorPaletteGreenForeground2};
|
|
215
216
|
}
|
|
216
217
|
|
|
217
|
-
:host(
|
|
218
|
+
:host(${outlineState}${warningState}) {
|
|
218
219
|
color: ${colorPaletteYellowForeground2};
|
|
219
220
|
}
|
|
220
221
|
`;
|
|
@@ -223,49 +224,49 @@ export const badgeOutlineStyles = css.partial `
|
|
|
223
224
|
* @public
|
|
224
225
|
*/
|
|
225
226
|
export const badgeTintStyles = css.partial `
|
|
226
|
-
:host(
|
|
227
|
+
:host(${tintState}) {
|
|
227
228
|
background-color: ${colorBrandBackground2};
|
|
228
229
|
color: ${colorBrandForeground2};
|
|
229
230
|
border-color: ${colorBrandStroke2};
|
|
230
231
|
}
|
|
231
232
|
|
|
232
|
-
:host(
|
|
233
|
+
:host(${tintState}${dangerState}) {
|
|
233
234
|
background-color: ${colorPaletteRedBackground1};
|
|
234
235
|
color: ${colorPaletteRedForeground1};
|
|
235
236
|
border-color: ${colorPaletteRedBorder1};
|
|
236
237
|
}
|
|
237
238
|
|
|
238
|
-
:host(
|
|
239
|
+
:host(${tintState}${importantState}) {
|
|
239
240
|
background-color: ${colorNeutralForeground3};
|
|
240
241
|
color: ${colorNeutralBackground1};
|
|
241
242
|
border-color: ${colorTransparentStroke};
|
|
242
243
|
}
|
|
243
244
|
|
|
244
|
-
:host(
|
|
245
|
+
:host(${tintState}${informativeState}) {
|
|
245
246
|
background-color: ${colorNeutralBackground4};
|
|
246
247
|
color: ${colorNeutralForeground3};
|
|
247
248
|
border-color: ${colorNeutralStroke2};
|
|
248
249
|
}
|
|
249
250
|
|
|
250
|
-
:host(
|
|
251
|
+
:host(${tintState}${severeState}) {
|
|
251
252
|
background-color: ${colorPaletteDarkOrangeBackground1};
|
|
252
253
|
color: ${colorPaletteDarkOrangeForeground1};
|
|
253
254
|
border-color: ${colorPaletteDarkOrangeBorder1};
|
|
254
255
|
}
|
|
255
256
|
|
|
256
|
-
:host(
|
|
257
|
+
:host(${tintState}${subtleState}) {
|
|
257
258
|
background-color: ${colorNeutralBackground1};
|
|
258
259
|
color: ${colorNeutralForeground3};
|
|
259
260
|
border-color: ${colorNeutralStroke2};
|
|
260
261
|
}
|
|
261
262
|
|
|
262
|
-
:host(
|
|
263
|
+
:host(${tintState}${successState}) {
|
|
263
264
|
background-color: ${colorPaletteGreenBackground1};
|
|
264
265
|
color: ${colorPaletteGreenForeground1};
|
|
265
266
|
border-color: ${colorPaletteGreenBorder2};
|
|
266
267
|
}
|
|
267
268
|
|
|
268
|
-
:host(
|
|
269
|
+
:host(${tintState}${warningState}) {
|
|
269
270
|
background-color: ${colorPaletteYellowBackground1};
|
|
270
271
|
color: ${colorPaletteYellowForeground2};
|
|
271
272
|
border-color: ${colorPaletteYellowBorder1};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.partials.js","sourceRoot":"","sources":["../../../../src/styles/partials/badge.partials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,6BAA6B,EAC7B,uBAAuB,EACvB,8BAA8B,EAC9B,6BAA6B,EAC7B,oCAAoC,EACpC,mBAAmB,EACnB,4BAA4B,EAC5B,iCAAiC,EACjC,iCAAiC,EACjC,6BAA6B,EAC7B,iCAAiC,EACjC,iCAAiC,EACjC,4BAA4B,EAC5B,4BAA4B,EAC5B,wBAAwB,EACxB,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,EAC7B,yBAAyB,EACzB,6BAA6B,EAC7B,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,GAChB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"badge.partials.js","sourceRoot":"","sources":["../../../../src/styles/partials/badge.partials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,oB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
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export const ghostState = css.partial `:is([state--ghost], :state(ghost))`;
|
|
7
|
+
/**
|
|
8
|
+
* Selector for the `primary` state.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export const primaryState = css.partial `:is([state--primary], :state(primary))`;
|
|
12
|
+
/**
|
|
13
|
+
* Selector for the `outline` state.
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export const outlineState = css.partial `:is([state--outline], :state(outline))`;
|
|
17
|
+
/**
|
|
18
|
+
* Selector for the `subtle` state.
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export const subtleState = css.partial `:is([state--subtle], :state(subtle))`;
|
|
22
|
+
/**
|
|
23
|
+
* Selector for the `tint` state.
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export const tintState = css.partial `:is([state--tint], :state(tint))`;
|
|
27
|
+
/**
|
|
28
|
+
* Selector for the `transparent` state.
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export const transparentState = css.partial `:is([state--transparent], :state(transparent))`;
|
|
32
|
+
/**
|
|
33
|
+
* Selector for the `circular` state.
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export const circularState = css.partial `:is([state--circular], :state(circular))`;
|
|
37
|
+
/**
|
|
38
|
+
* Selector for the `rounded` state.
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export const roundedState = css.partial `:is([state--rounded], :state(rounded))`;
|
|
42
|
+
/**
|
|
43
|
+
* Selector for the `square` state.
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
export const squareState = css.partial `:is([state--square], :state(square))`;
|
|
47
|
+
/**
|
|
48
|
+
* Selector for the `tiny` state.
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
export const tinyState = css.partial `:is([state--tiny], :state(tiny))`;
|
|
52
|
+
/**
|
|
53
|
+
* Selector for the `extra-small` state.
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
export const extraSmallState = css.partial `:is([state--extra-small], :state(extra-small))`;
|
|
57
|
+
/**
|
|
58
|
+
* Selector for the `small` state.
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
export const smallState = css.partial `:is([state--small], :state(small))`;
|
|
62
|
+
/**
|
|
63
|
+
* Selector for the `large` state.
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
export const largeState = css.partial `:is([state--large], :state(large))`;
|
|
67
|
+
/**
|
|
68
|
+
* Selector for the `extra-large` state.
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
export const extraLargeState = css.partial `:is([state--extra-large], :state(extra-large))`;
|
|
72
|
+
/**
|
|
73
|
+
* Selector for the `iconOnly` state.
|
|
74
|
+
* @public
|
|
75
|
+
*/
|
|
76
|
+
export const iconOnlyState = css.partial `:is([state--icon], :state(icon))`;
|
|
77
|
+
/**
|
|
78
|
+
* Selector for the `pressed` state.
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
export const pressedState = css.partial `:is([state--pressed], :state(pressed))`;
|
|
82
|
+
/**
|
|
83
|
+
* Selector for the `danger` state.
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
86
|
+
export const dangerState = css.partial `:is([state--danger], :state(danger))`;
|
|
87
|
+
/**
|
|
88
|
+
* Selector for the `important` state.
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
export const importantState = css.partial `:is([state--important], :state(important))`;
|
|
92
|
+
/**
|
|
93
|
+
* Selector for the `informative` state.
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
export const informativeState = css.partial `:is([state--informative], :state(informative))`;
|
|
97
|
+
/**
|
|
98
|
+
* Selector for the `severe` state.
|
|
99
|
+
* @public
|
|
100
|
+
*/
|
|
101
|
+
export const severeState = css.partial `:is([state--severe], :state(severe))`;
|
|
102
|
+
/**
|
|
103
|
+
* Selector for the `success` state.
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
export const successState = css.partial `:is([state--success], :state(success))`;
|
|
107
|
+
/**
|
|
108
|
+
* Selector for the `warning` state.
|
|
109
|
+
* @public
|
|
110
|
+
*/
|
|
111
|
+
export const warningState = css.partial `:is([state--warning], :state(warning))`;
|
|
112
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/styles/states/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAA,oCAAoC,CAAC;AAE1E;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC,OAAO,CAAA,wCAAwC,CAAC;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC,OAAO,CAAA,wCAAwC,CAAC;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAA,sCAAsC,CAAC;AAE7E;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAA,kCAAkC,CAAC;AAEvE;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAAA,gDAAgD,CAAC;AAE5F;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAA,0CAA0C,CAAC;AAEnF;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC,OAAO,CAAA,wCAAwC,CAAC;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAA,sCAAsC,CAAC;AAE7E;;;GAGG;AACH,MAAM,CAAC,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import { Button } from '../button/button.js';
|
|
4
|
+
import { toggleState } from '../utils/element-internals.js';
|
|
4
5
|
/**
|
|
5
6
|
* The base class used for constructing a `<fluent-toggle-button>` custom element.
|
|
6
7
|
*
|
|
@@ -46,7 +47,7 @@ export class ToggleButton extends Button {
|
|
|
46
47
|
if (this.$fastController.isConnected) {
|
|
47
48
|
const ariaPressed = `${this.mixed ? 'mixed' : !!this.pressed}`;
|
|
48
49
|
this.elementInternals.ariaPressed = ariaPressed;
|
|
49
|
-
this.
|
|
50
|
+
toggleState(this.elementInternals, 'pressed', !!this.pressed || !!this.mixed);
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-button.js","sourceRoot":"","sources":["../../../src/toggle-button/toggle-button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"toggle-button.js","sourceRoot":"","sources":["../../../src/toggle-button/toggle-button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAM;IAWtC;;;;OAIG;IACO,cAAc;QACtB,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAYD;;;;;;OAMG;IACO,YAAY;QACpB,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACO,KAAK;QACb,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;IAC/B,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IA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