@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
package/dist/esm/badge/badge.js
CHANGED
|
@@ -3,6 +3,7 @@ import { attr, FASTElement } from '@microsoft/fast-element';
|
|
|
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
|
import { BadgeAppearance, BadgeColor } from './badge.options.js';
|
|
7
8
|
/**
|
|
8
9
|
* The base class used for constructing a fluent-badge custom element
|
|
@@ -11,6 +12,12 @@ import { BadgeAppearance, BadgeColor } from './badge.options.js';
|
|
|
11
12
|
export class Badge extends FASTElement {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
15
|
+
/**
|
|
16
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
this.elementInternals = this.attachInternals();
|
|
14
21
|
/**
|
|
15
22
|
* The appearance the badge should have.
|
|
16
23
|
*
|
|
@@ -28,6 +35,58 @@ export class Badge extends FASTElement {
|
|
|
28
35
|
*/
|
|
29
36
|
this.color = BadgeColor.brand;
|
|
30
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Handles changes to appearance attribute custom states
|
|
40
|
+
* @param prev - the previous state
|
|
41
|
+
* @param next - the next state
|
|
42
|
+
*/
|
|
43
|
+
appearanceChanged(prev, next) {
|
|
44
|
+
if (prev) {
|
|
45
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
46
|
+
}
|
|
47
|
+
if (next) {
|
|
48
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Handles changes to color attribute custom states
|
|
53
|
+
* @param prev - the previous state
|
|
54
|
+
* @param next - the next state
|
|
55
|
+
*/
|
|
56
|
+
colorChanged(prev, next) {
|
|
57
|
+
if (prev) {
|
|
58
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
59
|
+
}
|
|
60
|
+
if (next) {
|
|
61
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Handles changes to shape attribute custom states
|
|
66
|
+
* @param prev - the previous state
|
|
67
|
+
* @param next - the next state
|
|
68
|
+
*/
|
|
69
|
+
shapeChanged(prev, next) {
|
|
70
|
+
if (prev) {
|
|
71
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
72
|
+
}
|
|
73
|
+
if (next) {
|
|
74
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Handles changes to size attribute custom states
|
|
79
|
+
* @param prev - the previous state
|
|
80
|
+
* @param next - the next state
|
|
81
|
+
*/
|
|
82
|
+
sizeChanged(prev, next) {
|
|
83
|
+
if (prev) {
|
|
84
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
85
|
+
}
|
|
86
|
+
if (next) {
|
|
87
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
31
90
|
}
|
|
32
91
|
__decorate([
|
|
33
92
|
attr
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../../src/badge/badge.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC5D,gEAAgE;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAyB,MAAM,oBAAoB,CAAC;AAExF;;;GAGG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE;;;;;;WAMG;QAEI,eAAU,GAAoB,eAAe,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../../src/badge/badge.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC5D,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;AAC5D,OAAO,EAAE,eAAe,EAAE,UAAU,EAAyB,MAAM,oBAAoB,CAAC;AAExF;;;GAGG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE;;;;WAIG;QACI,qBAAgB,GAAqB,IAAI,CAAC,eAAe,EAAE,CAAC;QAEnE;;;;;;WAMG;QAEI,eAAU,GAAoB,eAAe,CAAC,MAAM,CAAC;QAgB5D;;;;;;WAMG;QAEI,UAAK,GAAe,UAAU,CAAC,KAAK,CAAC;IA+D9C,CAAC;IArFC;;;;OAIG;IACI,iBAAiB,CAAC,IAAiC,EAAE,IAAiC;QAC3F,IAAI,IAAI,EAAE;YACR,WAAW,CAA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,CAAC,CAAC"}
|
|
@@ -2,22 +2,23 @@ import { css } from '@microsoft/fast-element';
|
|
|
2
2
|
import { forcedColorsStylesheetBehavior } from '../utils/index.js';
|
|
3
3
|
import { badgeBaseStyles, badgeFilledStyles, badgeGhostStyles, badgeOutlineStyles, badgeSizeStyles, badgeTintStyles, } from '../styles/index.js';
|
|
4
4
|
import { borderRadiusMedium, borderRadiusNone, borderRadiusSmall } from '../theme/design-tokens.js';
|
|
5
|
+
import { extraSmallState, roundedState, smallState, squareState, tinyState } from '../styles/states/index.js';
|
|
5
6
|
// why is the border not showing up?
|
|
6
7
|
/** Badge styles
|
|
7
8
|
* @public
|
|
8
9
|
*/
|
|
9
10
|
export const styles = css `
|
|
10
|
-
:host(
|
|
11
|
+
:host(${squareState}) {
|
|
11
12
|
border-radius: ${borderRadiusNone};
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
:host(
|
|
15
|
+
:host(${roundedState}) {
|
|
15
16
|
border-radius: ${borderRadiusMedium};
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
:host(
|
|
19
|
-
:host(
|
|
20
|
-
:host(
|
|
19
|
+
:host(${roundedState}${tinyState}),
|
|
20
|
+
:host(${roundedState}${extraSmallState}),
|
|
21
|
+
:host(${roundedState}${smallState}) {
|
|
21
22
|
border-radius: ${borderRadiusSmall};
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.styles.js","sourceRoot":"","sources":["../../../src/badge/badge.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACpG,oCAAoC;AACpC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"badge.styles.js","sourceRoot":"","sources":["../../../src/badge/badge.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC9G,oCAAoC;AACpC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;UACf,WAAW;qBACA,gBAAgB;;;UAG3B,YAAY;qBACD,kBAAkB;;;UAG7B,YAAY,GAAG,SAAS;UACxB,YAAY,GAAG,eAAe;UAC9B,YAAY,GAAG,UAAU;qBACd,iBAAiB;;;IAGlC,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,eAAe;CAClB,CAAC,aAAa,CACb,8BAA8B,CAAC,GAAG,CAAA;;;;;;GAMjC,CAAC,CACH,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { attr, FASTElement, observable } from '@microsoft/fast-element';
|
|
|
3
3
|
import { keyEnter, keySpace } from '@microsoft/fast-web-utilities';
|
|
4
4
|
import { StartEnd } from '../patterns/index.js';
|
|
5
5
|
import { applyMixins } from '../utils/apply-mixins.js';
|
|
6
|
+
import { toggleState } from '../utils/element-internals.js';
|
|
6
7
|
import { ButtonType } from './button.options.js';
|
|
7
8
|
/**
|
|
8
9
|
* A Button Custom HTML Element.
|
|
@@ -16,6 +17,19 @@ import { ButtonType } from './button.options.js';
|
|
|
16
17
|
* @public
|
|
17
18
|
*/
|
|
18
19
|
export class Button extends FASTElement {
|
|
20
|
+
/**
|
|
21
|
+
* Handles changes to appearance attribute custom states
|
|
22
|
+
* @param prev - the previous state
|
|
23
|
+
* @param next - the next state
|
|
24
|
+
*/
|
|
25
|
+
appearanceChanged(prev, next) {
|
|
26
|
+
if (prev) {
|
|
27
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
28
|
+
}
|
|
29
|
+
if (next) {
|
|
30
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
19
33
|
/**
|
|
20
34
|
* Sets the element's internal disabled state when the element is focusable while disabled.
|
|
21
35
|
*
|
|
@@ -36,6 +50,14 @@ export class Button extends FASTElement {
|
|
|
36
50
|
get form() {
|
|
37
51
|
return this.elementInternals.form;
|
|
38
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Handles changes to icon only custom states
|
|
55
|
+
* @param prev - the previous state
|
|
56
|
+
* @param next - the next state
|
|
57
|
+
*/
|
|
58
|
+
iconOnlyChanged(prev, next) {
|
|
59
|
+
toggleState(this.elementInternals, 'icon', next);
|
|
60
|
+
}
|
|
39
61
|
/**
|
|
40
62
|
* A reference to all associated label elements.
|
|
41
63
|
*
|
|
@@ -44,6 +66,32 @@ export class Button extends FASTElement {
|
|
|
44
66
|
get labels() {
|
|
45
67
|
return Object.freeze(Array.from(this.elementInternals.labels));
|
|
46
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Handles changes to shape attribute custom states
|
|
71
|
+
* @param prev - the previous state
|
|
72
|
+
* @param next - the next state
|
|
73
|
+
*/
|
|
74
|
+
shapeChanged(prev, next) {
|
|
75
|
+
if (prev) {
|
|
76
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
77
|
+
}
|
|
78
|
+
if (next) {
|
|
79
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Handles changes to size attribute custom states
|
|
84
|
+
* @param prev - the previous state
|
|
85
|
+
* @param next - the next state
|
|
86
|
+
*/
|
|
87
|
+
sizeChanged(prev, next) {
|
|
88
|
+
if (prev) {
|
|
89
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
90
|
+
}
|
|
91
|
+
if (next) {
|
|
92
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
47
95
|
/**
|
|
48
96
|
* Removes the form submission fallback control when the type changes.
|
|
49
97
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/button/button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/button/button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,MAA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,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;iDACjB;AAwC1C;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;0CACP;AAmB3B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;6CACE;AAW9B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;2CACP;AAW5B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;0CACP;AAW3B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8CACvB;AAyBhC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;0CACG;AAUrC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;wCACjB;AA6BjC;IADC,IAAI;oCACgB;AAUrB;IADC,IAAI;qCACsB;AAwB3B;IADC,IAAI;oCACoB;AAyBzB;IADC,IAAI;oCACoB;AA0BzB;IADC,IAAI;qCACiB;AAgMxB,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.options.js","sourceRoot":"","sources":["../../../src/button/button.options.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,
|
|
1
|
+
{"version":3,"file":"button.options.js","sourceRoot":"","sources":["../../../src/button/button.options.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,aAAa;CAClB,CAAC;AAQX;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACR,CAAC;AAQX;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;CACN,CAAC;AAQX;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;CACR,CAAC;AAeX;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,SAAS;IACjB,GAAG,EAAE,MAAM;CACH,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
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
|
+
import { circularState, iconOnlyState, largeState, outlineState, primaryState, smallState, squareState, subtleState, transparentState, } from '../styles/states/index.js';
|
|
4
5
|
/**
|
|
5
6
|
* @internal
|
|
6
7
|
*/
|
|
@@ -9,6 +10,7 @@ export const baseButtonStyles = css `
|
|
|
9
10
|
|
|
10
11
|
:host {
|
|
11
12
|
--icon-spacing: ${spacingHorizontalSNudge};
|
|
13
|
+
position: relative;
|
|
12
14
|
contain: layout style;
|
|
13
15
|
vertical-align: middle;
|
|
14
16
|
align-items: center;
|
|
@@ -70,22 +72,20 @@ export const baseButtonStyles = css `
|
|
|
70
72
|
fill: currentColor;
|
|
71
73
|
}
|
|
72
74
|
|
|
73
|
-
[slot='start'],
|
|
74
|
-
::slotted([slot='start']) {
|
|
75
|
+
:is([slot='start'], ::slotted([slot='start'])) {
|
|
75
76
|
margin-inline-end: var(--icon-spacing);
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
[slot='end'],
|
|
79
|
-
::slotted([slot='end']) {
|
|
79
|
+
:is([slot='end'], ::slotted([slot='end'])) {
|
|
80
80
|
margin-inline-start: var(--icon-spacing);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
:host(
|
|
83
|
+
:host(${iconOnlyState}) {
|
|
84
84
|
min-width: 32px;
|
|
85
85
|
max-width: 32px;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
:host(
|
|
88
|
+
:host(${smallState}) {
|
|
89
89
|
--icon-spacing: ${spacingHorizontalXS};
|
|
90
90
|
min-height: 24px;
|
|
91
91
|
min-width: 64px;
|
|
@@ -96,12 +96,12 @@ export const baseButtonStyles = css `
|
|
|
96
96
|
font-weight: ${fontWeightRegular};
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
:host(
|
|
99
|
+
:host(${smallState}${iconOnlyState}) {
|
|
100
100
|
min-width: 24px;
|
|
101
101
|
max-width: 24px;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
:host(
|
|
104
|
+
:host(${largeState}) {
|
|
105
105
|
min-height: 40px;
|
|
106
106
|
border-radius: ${borderRadiusLarge};
|
|
107
107
|
padding: 0 ${spacingHorizontalL};
|
|
@@ -109,108 +109,103 @@ export const baseButtonStyles = css `
|
|
|
109
109
|
line-height: ${lineHeightBase400};
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
:host(
|
|
112
|
+
:host(${largeState}${iconOnlyState}) {
|
|
113
113
|
min-width: 40px;
|
|
114
114
|
max-width: 40px;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
:host(
|
|
117
|
+
:host(${largeState}) ::slotted(svg) {
|
|
118
118
|
font-size: 24px;
|
|
119
119
|
height: 24px;
|
|
120
120
|
width: 24px;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
:host(
|
|
124
|
-
:host([shape='circular']:focus-visible) {
|
|
123
|
+
:host(:is(${circularState}, ${circularState}:focus-visible)) {
|
|
125
124
|
border-radius: ${borderRadiusCircular};
|
|
126
125
|
}
|
|
127
126
|
|
|
128
|
-
:host(
|
|
129
|
-
:host([shape='square']:focus-visible) {
|
|
127
|
+
:host(:is(${squareState}, ${squareState}:focus-visible)) {
|
|
130
128
|
border-radius: ${borderRadiusNone};
|
|
131
129
|
}
|
|
132
130
|
|
|
133
|
-
:host(
|
|
131
|
+
:host(${primaryState}) {
|
|
134
132
|
background-color: ${colorBrandBackground};
|
|
135
133
|
color: ${colorNeutralForegroundOnBrand};
|
|
136
134
|
border-color: transparent;
|
|
137
135
|
}
|
|
138
136
|
|
|
139
|
-
:host(
|
|
137
|
+
:host(${primaryState}:hover) {
|
|
140
138
|
background-color: ${colorBrandBackgroundHover};
|
|
141
139
|
}
|
|
142
140
|
|
|
143
|
-
:host(
|
|
144
|
-
:host([appearance='primary']:hover:active) {
|
|
141
|
+
:host(${primaryState}:is(:hover, :hover:active)) {
|
|
145
142
|
border-color: transparent;
|
|
146
143
|
color: ${colorNeutralForegroundOnBrand};
|
|
147
144
|
}
|
|
148
145
|
|
|
149
|
-
:host(
|
|
146
|
+
:host(${primaryState}:hover:active) {
|
|
150
147
|
background-color: ${colorBrandBackgroundPressed};
|
|
151
148
|
}
|
|
152
149
|
|
|
153
|
-
:host(
|
|
150
|
+
:host(${primaryState}:focus-visible) {
|
|
154
151
|
border-color: ${colorNeutralForegroundOnBrand};
|
|
155
152
|
box-shadow: ${shadow2}, 0 0 0 2px ${colorStrokeFocus2};
|
|
156
153
|
}
|
|
157
154
|
|
|
158
|
-
:host(
|
|
155
|
+
:host(${outlineState}) {
|
|
159
156
|
background-color: ${colorTransparentBackground};
|
|
160
157
|
}
|
|
161
158
|
|
|
162
|
-
:host(
|
|
159
|
+
:host(${outlineState}:hover) {
|
|
163
160
|
background-color: ${colorTransparentBackgroundHover};
|
|
164
161
|
}
|
|
165
162
|
|
|
166
|
-
:host(
|
|
163
|
+
:host(${outlineState}:hover:active) {
|
|
167
164
|
background-color: ${colorTransparentBackgroundPressed};
|
|
168
165
|
}
|
|
169
166
|
|
|
170
|
-
:host(
|
|
167
|
+
:host(${subtleState}) {
|
|
171
168
|
background-color: ${colorSubtleBackground};
|
|
172
169
|
color: ${colorNeutralForeground2};
|
|
173
170
|
border-color: transparent;
|
|
174
171
|
}
|
|
175
172
|
|
|
176
|
-
:host(
|
|
173
|
+
:host(${subtleState}:hover) {
|
|
177
174
|
background-color: ${colorSubtleBackgroundHover};
|
|
178
175
|
color: ${colorNeutralForeground2Hover};
|
|
179
176
|
border-color: transparent;
|
|
180
177
|
}
|
|
181
178
|
|
|
182
|
-
:host(
|
|
179
|
+
:host(${subtleState}:hover:active) {
|
|
183
180
|
background-color: ${colorSubtleBackgroundPressed};
|
|
184
181
|
color: ${colorNeutralForeground2Pressed};
|
|
185
182
|
border-color: transparent;
|
|
186
183
|
}
|
|
187
184
|
|
|
188
|
-
:host(
|
|
185
|
+
:host(${subtleState}:hover) ::slotted(svg) {
|
|
189
186
|
fill: ${colorNeutralForeground2BrandHover};
|
|
190
187
|
}
|
|
191
188
|
|
|
192
|
-
:host(
|
|
189
|
+
:host(${subtleState}:hover:active) ::slotted(svg) {
|
|
193
190
|
fill: ${colorNeutralForeground2BrandPressed};
|
|
194
191
|
}
|
|
195
192
|
|
|
196
|
-
:host(
|
|
193
|
+
:host(${transparentState}) {
|
|
197
194
|
background-color: ${colorTransparentBackground};
|
|
198
195
|
color: ${colorNeutralForeground2};
|
|
199
196
|
}
|
|
200
197
|
|
|
201
|
-
:host(
|
|
198
|
+
:host(${transparentState}:hover) {
|
|
202
199
|
background-color: ${colorTransparentBackgroundHover};
|
|
203
200
|
color: ${colorNeutralForeground2BrandHover};
|
|
204
201
|
}
|
|
205
202
|
|
|
206
|
-
:host(
|
|
203
|
+
:host(${transparentState}:hover:active) {
|
|
207
204
|
background-color: ${colorTransparentBackgroundPressed};
|
|
208
205
|
color: ${colorNeutralForeground2BrandPressed};
|
|
209
206
|
}
|
|
210
207
|
|
|
211
|
-
:host(
|
|
212
|
-
:host([appearance='transparent']:hover),
|
|
213
|
-
:host([appearance='transparent']:hover:active) {
|
|
208
|
+
:host(:is(${transparentState}, ${transparentState}:is(:hover, :active))) {
|
|
214
209
|
border-color: transparent;
|
|
215
210
|
}
|
|
216
211
|
`;
|
|
@@ -222,37 +217,33 @@ export const baseButtonStyles = css `
|
|
|
222
217
|
export const styles = css `
|
|
223
218
|
${baseButtonStyles}
|
|
224
219
|
|
|
225
|
-
:host(:is(
|
|
226
|
-
:host(:is(
|
|
227
|
-
:host(:is(
|
|
220
|
+
:host(:is(:disabled, [disabled-focusable], [appearance]:disabled, [appearance][disabled-focusable])),
|
|
221
|
+
:host(:is(:disabled, [disabled-focusable], [appearance]:disabled, [appearance][disabled-focusable]):hover),
|
|
222
|
+
:host(:is(:disabled, [disabled-focusable], [appearance]:disabled, [appearance][disabled-focusable]):hover:active) {
|
|
228
223
|
background-color: ${colorNeutralBackgroundDisabled};
|
|
229
224
|
border-color: ${colorNeutralStrokeDisabled};
|
|
230
225
|
color: ${colorNeutralForegroundDisabled};
|
|
231
226
|
cursor: not-allowed;
|
|
232
227
|
}
|
|
233
228
|
|
|
234
|
-
:host(:is(
|
|
235
|
-
:host(:is(
|
|
236
|
-
:host(:is([disabled][appearance='primary'], [disabled-focusable][appearance='primary']):hover:active) {
|
|
229
|
+
:host(${primaryState}:is(:disabled, [disabled-focusable])),
|
|
230
|
+
:host(${primaryState}:is(:disabled, [disabled-focusable]):is(:hover, :hover:active)) {
|
|
237
231
|
border-color: transparent;
|
|
238
232
|
}
|
|
239
233
|
|
|
240
|
-
:host(:is(
|
|
241
|
-
:host(:is(
|
|
242
|
-
:host(:is([disabled][appearance='outline'], [disabled-focusable][appearance='outline']):hover:active) {
|
|
234
|
+
:host(${outlineState}:is(:disabled, [disabled-focusable])),
|
|
235
|
+
:host(${outlineState}:is(:disabled, [disabled-focusable]):is(:hover, :hover:active)) {
|
|
243
236
|
background-color: ${colorTransparentBackground};
|
|
244
237
|
}
|
|
245
238
|
|
|
246
|
-
:host(:is(
|
|
247
|
-
:host(:is(
|
|
248
|
-
:host(:is([disabled][appearance='subtle'], [disabled-focusable][appearance='subtle']):hover:active) {
|
|
239
|
+
:host(${subtleState}:is(:disabled, [disabled-focusable])),
|
|
240
|
+
:host(${subtleState}:is(:disabled, [disabled-focusable]):is(:hover, :hover:active)) {
|
|
249
241
|
background-color: ${colorTransparentBackground};
|
|
250
242
|
border-color: transparent;
|
|
251
243
|
}
|
|
252
244
|
|
|
253
|
-
:host(:is(
|
|
254
|
-
:host(:is(
|
|
255
|
-
:host(:is([disabled][appearance='transparent'], [disabled-focusable][appearance='transparent']):hover:active) {
|
|
245
|
+
:host(${transparentState}:is(:disabled, [disabled-focusable])),
|
|
246
|
+
:host(${transparentState}:is(:disabled, [disabled-focusable]):is(:hover, :hover:active)) {
|
|
256
247
|
border-color: transparent;
|
|
257
248
|
background-color: ${colorTransparentBackground};
|
|
258
249
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.styles.js","sourceRoot":"","sources":["../../../src/button/button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,uBAAuB,EACvB,iCAAiC,EACjC,mCAAmC,EACnC,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,EACjC,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;IAC/B,OAAO,CAAC,aAAa,CAAC;;;sBAGJ,uBAAuB
|
|
1
|
+
{"version":3,"file":"button.styles.js","sourceRoot":"","sources":["../../../src/button/button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,uBAAuB,EACvB,iCAAiC,EACjC,mCAAmC,EACnC,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,EACjC,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,aAAa,EACb,aAAa,EACb,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,EACX,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AA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A0B;aACrC,4BAA4B;;;;UAI/B,WAAW;wBACG,4BAA4B;aACvC,8BAA8B;;;;UAIjC,WAAW;YACT,iCAAiC;;;UAGnC,WAAW;YACT,mCAAmC;;;UAGrC,gBAAgB;wBACF,0BAA0B;aACrC,uBAAuB;;;UAG1B,gBAAgB;wBACF,+BAA+B;aAC1C,iCAAiC;;;UAGpC,gBAAgB;wBACF,iCAAiC;aAC5C,mCAAmC;;;cAGlC,gBAAgB,KAAK,gBAAgB;;;CAGlD,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,gBAAgB;;;;;wBAKI,8BAA8B;oBAClC,0BAA0B;aACjC,8BAA8B;;;;UAIjC,YAAY;UACZ,YAAY;;;;UAIZ,YAAY;UACZ,YAAY;wBACE,0BAA0B;;;UAGxC,WAAW;UACX,WAAW;wBACG,0BAA0B;;;;UAIxC,gBAAgB;UAChB,gBAAgB;;wBAEF,0BAA0B;;CAEjD,CAAC,aAAa,CACb,8BAA8B,CAAC,GAAG,CAAA;;;;;;;;;GASjC,CAAC,CACH,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { styles as ButtonStyles } from '../button/button.styles.js';
|
|
3
3
|
import { colorNeutralForeground2, colorNeutralForeground2BrandHover, colorNeutralForeground2BrandPressed, colorNeutralForeground2Hover, colorNeutralForeground2Pressed, colorNeutralForegroundDisabled, colorNeutralForegroundOnBrand, fontSizeBase200, fontSizeBase300, fontSizeBase400, fontWeightRegular, lineHeightBase300, lineHeightBase400, spacingHorizontalS, spacingHorizontalSNudge, spacingHorizontalXS, } from '../theme/design-tokens.js';
|
|
4
|
+
import { iconOnlyState, largeState, primaryState, smallState, subtleState, transparentState, } from '../styles/states/index.js';
|
|
4
5
|
// Need to support icon hover styles
|
|
5
6
|
export const styles = css `
|
|
6
7
|
${ButtonStyles}
|
|
@@ -30,7 +31,7 @@ export const styles = css `
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
::slotted(svg),
|
|
33
|
-
:host(
|
|
34
|
+
:host(${largeState}) ::slotted(svg) {
|
|
34
35
|
font-size: 40px;
|
|
35
36
|
height: 40px;
|
|
36
37
|
width: 40px;
|
|
@@ -44,61 +45,59 @@ export const styles = css `
|
|
|
44
45
|
color: ${colorNeutralForeground2Pressed};
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
:host(:is(
|
|
48
|
-
::slotted([slot='description']) {
|
|
48
|
+
:host(:is(${primaryState}, ${primaryState}:hover, ${primaryState}:active)) ::slotted([slot='description']) {
|
|
49
49
|
color: ${colorNeutralForegroundOnBrand};
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
:host(:is(
|
|
53
|
-
|
|
54
|
-
:host([appearance='transparent']) ::slotted([slot='description']) {
|
|
52
|
+
:host(:is(${subtleState}, ${subtleState}:hover, ${subtleState}:active)) ::slotted([slot='description']),
|
|
53
|
+
:host(${transparentState}) ::slotted([slot='description']) {
|
|
55
54
|
color: ${colorNeutralForeground2};
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
:host(
|
|
57
|
+
:host(${transparentState}:hover) ::slotted([slot='description']) {
|
|
59
58
|
color: ${colorNeutralForeground2BrandHover};
|
|
60
59
|
}
|
|
61
60
|
|
|
62
|
-
:host(
|
|
61
|
+
:host(${transparentState}:active) ::slotted([slot='description']) {
|
|
63
62
|
color: ${colorNeutralForeground2BrandPressed};
|
|
64
63
|
}
|
|
65
64
|
|
|
66
|
-
:host(:is(
|
|
65
|
+
:host(:is(:disabled, :disabled[appearance], [disabled-focusable], [disabled-focusable][appearance]))
|
|
67
66
|
::slotted([slot='description']) {
|
|
68
67
|
color: ${colorNeutralForegroundDisabled};
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
:host(
|
|
70
|
+
:host(${smallState}) {
|
|
72
71
|
padding: 8px;
|
|
73
72
|
padding-bottom: 10px;
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
:host(
|
|
75
|
+
:host(${iconOnlyState}) {
|
|
77
76
|
min-width: 52px;
|
|
78
77
|
max-width: 52px;
|
|
79
78
|
padding: ${spacingHorizontalSNudge};
|
|
80
79
|
}
|
|
81
80
|
|
|
82
|
-
:host(
|
|
81
|
+
:host(${iconOnlyState}${smallState}) {
|
|
83
82
|
min-width: 48px;
|
|
84
83
|
max-width: 48px;
|
|
85
84
|
padding: ${spacingHorizontalXS};
|
|
86
85
|
}
|
|
87
86
|
|
|
88
|
-
:host(
|
|
87
|
+
:host(${iconOnlyState}${largeState}) {
|
|
89
88
|
min-width: 56px;
|
|
90
89
|
max-width: 56px;
|
|
91
90
|
padding: ${spacingHorizontalS};
|
|
92
91
|
}
|
|
93
92
|
|
|
94
|
-
:host(
|
|
93
|
+
:host(${largeState}) {
|
|
95
94
|
padding-top: 18px;
|
|
96
95
|
padding-inline: 16px;
|
|
97
96
|
padding-bottom: 20px;
|
|
98
97
|
font-size: ${fontSizeBase400};
|
|
99
98
|
line-height: ${lineHeightBase400};
|
|
100
99
|
}
|
|
101
|
-
:host(
|
|
100
|
+
:host(${largeState}) ::slotted([slot='description']) {
|
|
102
101
|
font-size: ${fontSizeBase300};
|
|
103
102
|
}
|
|
104
103
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compound-button.styles.js","sourceRoot":"","sources":["../../../src/compound-button/compound-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,mCAAmC,EACnC,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,eAAe,EACf,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAEnC,oCAAoC;AACpC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,YAAY;;;;;;;;;iBASC,eAAe;mBACb,iBAAiB;;;;;;;;;;aAUvB,uBAAuB;;iBAEnB,eAAe;mBACb,iBAAiB
|
|
1
|
+
{"version":3,"file":"compound-button.styles.js","sourceRoot":"","sources":["../../../src/compound-button/compound-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,mCAAmC,EACnC,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,eAAe,EACf,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,aAAa,EACb,UAAU,EACV,YAAY,EACZ,UAAU,EACV,WAAW,EACX,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,oCAAoC;AACpC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,YAAY;;;;;;;;;iBASC,eAAe;mBACb,iBAAiB;;;;;;;;;;aAUvB,uBAAuB;;iBAEnB,eAAe;mBACb,iBAAiB;;;;UAI1B,UAAU;;;;;;;aAOP,4BAA4B;;;;aAI5B,8BAA8B;;;cAG7B,YAAY,KAAK,YAAY,WAAW,YAAY;aACrD,6BAA6B;;;cAG5B,WAAW,KAAK,WAAW,WAAW,WAAW;UACrD,gBAAgB;aACb,uBAAuB;;;UAG1B,gBAAgB;aACb,iCAAiC;;;UAGpC,gBAAgB;aACb,mCAAmC;;;;;aAKnC,8BAA8B;;;UAGjC,UAAU;;;;;UAKV,aAAa;;;eAGR,uBAAuB;;;UAG5B,aAAa,GAAG,UAAU;;;eAGrB,mBAAmB;;;UAGxB,aAAa,GAAG,UAAU;;;eAGrB,kBAAkB;;;UAGvB,UAAU;;;;iBAIH,eAAe;mBACb,iBAAiB;;UAE1B,UAAU;iBACH,eAAe;;CAE/B,CAAC"}
|