@fluentui/web-components 3.0.0-beta.89 → 3.0.0-beta.90
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/accordion-item/accordion-item.base.d.ts +0 -12
- package/dist/dts/accordion-item/accordion-item.d.ts +0 -18
- package/dist/dts/avatar/avatar.base.d.ts +0 -12
- package/dist/dts/avatar/avatar.d.ts +13 -2
- package/dist/dts/badge/badge.d.ts +0 -30
- package/dist/dts/button/button.d.ts +0 -24
- package/dist/dts/checkbox/checkbox.d.ts +0 -16
- package/dist/dts/counter-badge/counter-badge.d.ts +0 -30
- package/dist/dts/divider/divider.d.ts +0 -18
- package/dist/dts/dropdown/dropdown.d.ts +0 -16
- package/dist/dts/image/image.d.ts +0 -36
- package/dist/dts/label/label.d.ts +0 -24
- package/dist/dts/link/link.d.ts +0 -12
- package/dist/dts/message-bar/message-bar.d.ts +0 -18
- package/dist/dts/progress-bar/progress-bar.d.ts +0 -12
- package/dist/dts/rating-display/rating-display.d.ts +0 -14
- package/dist/dts/slider/slider.d.ts +0 -1
- package/dist/dts/spinner/spinner.d.ts +0 -12
- package/dist/dts/styles/states/index.d.ts +0 -500
- package/dist/dts/tablist/tablist.d.ts +0 -8
- package/dist/dts/text/text.d.ts +1 -34
- package/dist/dts/text-input/text-input.d.ts +0 -12
- package/dist/dts/textarea/textarea.d.ts +0 -4
- package/dist/dts/tree-item/tree-item.d.ts +1 -1
- package/dist/esm/accordion-item/accordion-item.base.js +0 -17
- package/dist/esm/accordion-item/accordion-item.base.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.js +0 -26
- package/dist/esm/accordion-item/accordion-item.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.styles.js +19 -20
- package/dist/esm/accordion-item/accordion-item.styles.js.map +1 -1
- package/dist/esm/avatar/avatar.base.js +0 -3
- package/dist/esm/avatar/avatar.base.js.map +1 -1
- package/dist/esm/avatar/avatar.js +4 -2
- package/dist/esm/avatar/avatar.js.map +1 -1
- package/dist/esm/avatar/avatar.styles.js +31 -32
- package/dist/esm/avatar/avatar.styles.js.map +1 -1
- package/dist/esm/badge/badge.js +1 -40
- package/dist/esm/badge/badge.js.map +1 -1
- package/dist/esm/badge/badge.styles.js +7 -10
- package/dist/esm/badge/badge.styles.js.map +1 -1
- package/dist/esm/button/button.js +0 -34
- package/dist/esm/button/button.js.map +1 -1
- package/dist/esm/button/button.styles.js +34 -35
- package/dist/esm/button/button.styles.js.map +1 -1
- package/dist/esm/checkbox/checkbox.js +1 -22
- package/dist/esm/checkbox/checkbox.js.map +1 -1
- package/dist/esm/checkbox/checkbox.styles.js +6 -6
- package/dist/esm/checkbox/checkbox.styles.js.map +1 -1
- package/dist/esm/compound-button/compound-button.styles.js +12 -13
- package/dist/esm/compound-button/compound-button.styles.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.js +0 -42
- package/dist/esm/counter-badge/counter-badge.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.styles.js +3 -7
- package/dist/esm/counter-badge/counter-badge.styles.js.map +1 -1
- package/dist/esm/divider/divider.js +0 -26
- package/dist/esm/divider/divider.js.map +1 -1
- package/dist/esm/divider/divider.styles.js +32 -35
- package/dist/esm/divider/divider.styles.js.map +1 -1
- package/dist/esm/dropdown/dropdown.js +1 -22
- package/dist/esm/dropdown/dropdown.js.map +1 -1
- package/dist/esm/dropdown/dropdown.styles.js +18 -18
- package/dist/esm/dropdown/dropdown.styles.js.map +1 -1
- package/dist/esm/image/image.js +0 -51
- package/dist/esm/image/image.js.map +1 -1
- package/dist/esm/image/image.styles.js +9 -10
- package/dist/esm/image/image.styles.js.map +1 -1
- package/dist/esm/label/label.js +0 -32
- package/dist/esm/label/label.js.map +1 -1
- package/dist/esm/label/label.styles.js +5 -6
- package/dist/esm/label/label.styles.js.map +1 -1
- package/dist/esm/link/link.js +0 -18
- package/dist/esm/link/link.js.map +1 -1
- package/dist/esm/link/link.styles.js +4 -5
- package/dist/esm/link/link.styles.js.map +1 -1
- package/dist/esm/message-bar/message-bar.js +0 -26
- package/dist/esm/message-bar/message-bar.js.map +1 -1
- package/dist/esm/message-bar/message-bar.styles.js +9 -10
- package/dist/esm/message-bar/message-bar.styles.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.js +0 -18
- package/dist/esm/progress-bar/progress-bar.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.styles.js +6 -7
- package/dist/esm/progress-bar/progress-bar.styles.js.map +1 -1
- package/dist/esm/radio-group/radio-group.styles.js +0 -1
- package/dist/esm/radio-group/radio-group.styles.js.map +1 -1
- package/dist/esm/rating-display/rating-display.js +0 -20
- package/dist/esm/rating-display/rating-display.js.map +1 -1
- package/dist/esm/rating-display/rating-display.styles.js +16 -19
- package/dist/esm/rating-display/rating-display.styles.js.map +1 -1
- package/dist/esm/slider/slider.js +1 -6
- package/dist/esm/slider/slider.js.map +1 -1
- package/dist/esm/slider/slider.styles.js +6 -7
- package/dist/esm/slider/slider.styles.js.map +1 -1
- package/dist/esm/spinner/spinner.js +0 -18
- package/dist/esm/spinner/spinner.js.map +1 -1
- package/dist/esm/spinner/spinner.styles.js +8 -9
- package/dist/esm/spinner/spinner.styles.js.map +1 -1
- package/dist/esm/styles/partials/badge.partials.js +42 -43
- package/dist/esm/styles/partials/badge.partials.js.map +1 -1
- package/dist/esm/styles/states/index.js +0 -500
- package/dist/esm/styles/states/index.js.map +1 -1
- package/dist/esm/tablist/tablist.js +1 -14
- package/dist/esm/tablist/tablist.js.map +1 -1
- package/dist/esm/tablist/tablist.styles.js +26 -27
- package/dist/esm/tablist/tablist.styles.js.map +1 -1
- package/dist/esm/text/text.js +1 -66
- package/dist/esm/text/text.js.map +1 -1
- package/dist/esm/text/text.styles.js +26 -27
- package/dist/esm/text/text.styles.js.map +1 -1
- package/dist/esm/text-input/text-input.js +0 -18
- package/dist/esm/text-input/text-input.js.map +1 -1
- package/dist/esm/text-input/text-input.styles.js +22 -23
- package/dist/esm/text-input/text-input.styles.js.map +1 -1
- package/dist/esm/textarea/textarea.js +1 -29
- package/dist/esm/textarea/textarea.js.map +1 -1
- package/dist/esm/textarea/textarea.styles.js +14 -14
- package/dist/esm/textarea/textarea.styles.js.map +1 -1
- package/dist/esm/toggle-button/toggle-button.styles.js +19 -20
- package/dist/esm/toggle-button/toggle-button.styles.js.map +1 -1
- package/dist/esm/tree-item/tree-item.js +1 -1
- package/dist/esm/tree-item/tree-item.js.map +1 -1
- package/dist/esm/tree-item/tree-item.styles.js.map +1 -1
- package/dist/esm/tree-item/tree-item.template.js +1 -1
- package/dist/esm/tree-item/tree-item.template.js.map +1 -1
- package/dist/web-components.d.ts +13 -363
- package/dist/web-components.js +178 -987
- package/dist/web-components.min.js +357 -354
- package/package.json +1 -1
|
@@ -2,31 +2,28 @@ 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';
|
|
6
5
|
// why is the border not showing up?
|
|
7
6
|
/** Badge styles
|
|
8
7
|
* @public
|
|
9
8
|
*/
|
|
10
9
|
export const styles = css `
|
|
11
|
-
:host(
|
|
10
|
+
:host([shape='square']) {
|
|
12
11
|
border-radius: ${borderRadiusNone};
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
:host(
|
|
14
|
+
:host([shape='rounded']) {
|
|
16
15
|
border-radius: ${borderRadiusMedium};
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
:host(
|
|
20
|
-
:host(${roundedState}${extraSmallState}),
|
|
21
|
-
:host(${roundedState}${smallState}) {
|
|
18
|
+
:host([shape='rounded']:is([size='tiny'], [size='extra-small'], [size='small'])) {
|
|
22
19
|
border-radius: ${borderRadiusSmall};
|
|
23
20
|
}
|
|
24
21
|
|
|
25
|
-
${badgeSizeStyles}
|
|
26
|
-
${badgeFilledStyles}
|
|
27
|
-
${badgeGhostStyles}
|
|
28
|
-
${badgeOutlineStyles}
|
|
29
22
|
${badgeTintStyles}
|
|
23
|
+
${badgeOutlineStyles}
|
|
24
|
+
${badgeGhostStyles}
|
|
25
|
+
${badgeFilledStyles}
|
|
26
|
+
${badgeSizeStyles}
|
|
30
27
|
${badgeBaseStyles}
|
|
31
28
|
`.withBehaviors(forcedColorsStylesheetBehavior(css `
|
|
32
29
|
:host,
|
|
@@ -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,
|
|
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;;qBAEJ,gBAAgB;;;;qBAIhB,kBAAkB;;;;qBAIlB,iBAAiB;;;IAGlC,eAAe;IACf,kBAAkB;IAClB,gBAAgB;IAChB,iBAAiB;IACjB,eAAe;IACf,eAAe;CAClB,CAAC,aAAa,CACb,8BAA8B,CAAC,GAAG,CAAA;;;;;;GAMjC,CAAC,CACH,CAAC"}
|
|
@@ -2,9 +2,7 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { attr } from '@microsoft/fast-element';
|
|
3
3
|
import { StartEnd } from '../patterns/index.js';
|
|
4
4
|
import { applyMixins } from '../utils/apply-mixins.js';
|
|
5
|
-
import { swapStates, toggleState } from '../utils/element-internals.js';
|
|
6
5
|
import { BaseButton } from './button.base.js';
|
|
7
|
-
import { ButtonAppearance, ButtonShape, ButtonSize } from './button.options.js';
|
|
8
6
|
/**
|
|
9
7
|
* A Button Custom HTML Element.
|
|
10
8
|
* Based on BaseButton and includes style and layout specific attributes
|
|
@@ -23,38 +21,6 @@ export class Button extends BaseButton {
|
|
|
23
21
|
*/
|
|
24
22
|
this.iconOnly = false;
|
|
25
23
|
}
|
|
26
|
-
/**
|
|
27
|
-
* Handles changes to appearance attribute custom states
|
|
28
|
-
* @param prev - the previous state
|
|
29
|
-
* @param next - the next state
|
|
30
|
-
*/
|
|
31
|
-
appearanceChanged(prev, next) {
|
|
32
|
-
swapStates(this.elementInternals, prev, next, ButtonAppearance);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Handles changes to shape attribute custom states
|
|
36
|
-
* @param prev - the previous state
|
|
37
|
-
* @param next - the next state
|
|
38
|
-
*/
|
|
39
|
-
shapeChanged(prev, next) {
|
|
40
|
-
swapStates(this.elementInternals, prev, next, ButtonShape);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Handles changes to size attribute custom states
|
|
44
|
-
* @param prev - the previous state
|
|
45
|
-
* @param next - the next state
|
|
46
|
-
*/
|
|
47
|
-
sizeChanged(prev, next) {
|
|
48
|
-
swapStates(this.elementInternals, prev, next, ButtonSize);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Handles changes to icon only custom states
|
|
52
|
-
* @param prev - the previous state
|
|
53
|
-
* @param next - the next state
|
|
54
|
-
*/
|
|
55
|
-
iconOnlyChanged(prev, next) {
|
|
56
|
-
toggleState(this.elementInternals, 'icon', next);
|
|
57
|
-
}
|
|
58
24
|
}
|
|
59
25
|
__decorate([
|
|
60
26
|
attr
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/button/button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/button/button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C;;;;;GAKG;AACH,MAAM,OAAO,MAAO,SAAQ,UAAU;IAAtC;;QA+BE;;;;;;WAMG;QAEI,aAAQ,GAAY,KAAK,CAAC;IACnC,CAAC;CAAA;AA/BQ;IADN,IAAI;0CACgC;AAU9B;IADN,IAAI;qCACsB;AAUpB;IADN,IAAI;oCACoB;AAUlB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;wCACjB;AAWnC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
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';
|
|
5
4
|
/**
|
|
6
5
|
* @internal
|
|
7
6
|
*/
|
|
@@ -84,12 +83,12 @@ export const baseButtonStyles = css `
|
|
|
84
83
|
margin-inline-start: var(--icon-spacing);
|
|
85
84
|
}
|
|
86
85
|
|
|
87
|
-
:host(
|
|
86
|
+
:host([icon-only]) {
|
|
88
87
|
min-width: 32px;
|
|
89
88
|
max-width: 32px;
|
|
90
89
|
}
|
|
91
90
|
|
|
92
|
-
:host(
|
|
91
|
+
:host([size='small']) {
|
|
93
92
|
--icon-spacing: ${spacingHorizontalXS};
|
|
94
93
|
min-height: 24px;
|
|
95
94
|
min-width: 64px;
|
|
@@ -100,12 +99,12 @@ export const baseButtonStyles = css `
|
|
|
100
99
|
font-weight: ${fontWeightRegular};
|
|
101
100
|
}
|
|
102
101
|
|
|
103
|
-
:host(
|
|
102
|
+
:host([size='small'][icon-only]) {
|
|
104
103
|
min-width: 24px;
|
|
105
104
|
max-width: 24px;
|
|
106
105
|
}
|
|
107
106
|
|
|
108
|
-
:host(
|
|
107
|
+
:host([size='large']) {
|
|
109
108
|
min-height: 40px;
|
|
110
109
|
border-radius: ${borderRadiusLarge};
|
|
111
110
|
padding: 0 ${spacingHorizontalL};
|
|
@@ -113,103 +112,103 @@ export const baseButtonStyles = css `
|
|
|
113
112
|
line-height: ${lineHeightBase400};
|
|
114
113
|
}
|
|
115
114
|
|
|
116
|
-
:host(
|
|
115
|
+
:host([size='large'][icon-only]) {
|
|
117
116
|
min-width: 40px;
|
|
118
117
|
max-width: 40px;
|
|
119
118
|
}
|
|
120
119
|
|
|
121
|
-
:host(
|
|
120
|
+
:host([size='large']) ::slotted(svg) {
|
|
122
121
|
font-size: 24px;
|
|
123
122
|
height: 24px;
|
|
124
123
|
width: 24px;
|
|
125
124
|
}
|
|
126
125
|
|
|
127
|
-
:host(:is(
|
|
126
|
+
:host(:is([shape='circular'], [shape='circular']:focus-visible)) {
|
|
128
127
|
border-radius: ${borderRadiusCircular};
|
|
129
128
|
}
|
|
130
129
|
|
|
131
|
-
:host(:is(
|
|
130
|
+
:host(:is([shape='square'], [shape='square']:focus-visible)) {
|
|
132
131
|
border-radius: ${borderRadiusNone};
|
|
133
132
|
}
|
|
134
133
|
|
|
135
|
-
:host(
|
|
134
|
+
:host([appearance='primary']) {
|
|
136
135
|
background-color: ${colorBrandBackground};
|
|
137
136
|
color: ${colorNeutralForegroundOnBrand};
|
|
138
137
|
border-color: transparent;
|
|
139
138
|
}
|
|
140
139
|
|
|
141
|
-
:host(
|
|
140
|
+
:host([appearance='primary']:hover) {
|
|
142
141
|
background-color: ${colorBrandBackgroundHover};
|
|
143
142
|
}
|
|
144
143
|
|
|
145
|
-
:host(
|
|
144
|
+
:host([appearance='primary']:is(:hover, :hover:active)) {
|
|
146
145
|
border-color: transparent;
|
|
147
146
|
color: ${colorNeutralForegroundOnBrand};
|
|
148
147
|
}
|
|
149
148
|
|
|
150
|
-
:host(
|
|
149
|
+
:host([appearance='primary']:hover:active) {
|
|
151
150
|
background-color: ${colorBrandBackgroundPressed};
|
|
152
151
|
}
|
|
153
152
|
|
|
154
|
-
:host(
|
|
153
|
+
:host([appearance='primary']:focus-visible) {
|
|
155
154
|
border-color: ${colorNeutralForegroundOnBrand};
|
|
156
155
|
box-shadow: ${shadow2}, 0 0 0 2px ${colorStrokeFocus2};
|
|
157
156
|
}
|
|
158
157
|
|
|
159
|
-
:host(
|
|
158
|
+
:host([appearance='outline']) {
|
|
160
159
|
background-color: ${colorTransparentBackground};
|
|
161
160
|
}
|
|
162
161
|
|
|
163
|
-
:host(
|
|
162
|
+
:host([appearance='outline']:hover) {
|
|
164
163
|
background-color: ${colorTransparentBackgroundHover};
|
|
165
164
|
}
|
|
166
165
|
|
|
167
|
-
:host(
|
|
166
|
+
:host([appearance='outline']:hover:active) {
|
|
168
167
|
background-color: ${colorTransparentBackgroundPressed};
|
|
169
168
|
}
|
|
170
169
|
|
|
171
|
-
:host(
|
|
170
|
+
:host([appearance='subtle']) {
|
|
172
171
|
background-color: ${colorSubtleBackground};
|
|
173
172
|
color: ${colorNeutralForeground2};
|
|
174
173
|
border-color: transparent;
|
|
175
174
|
}
|
|
176
175
|
|
|
177
|
-
:host(
|
|
176
|
+
:host([appearance='subtle']:hover) {
|
|
178
177
|
background-color: ${colorSubtleBackgroundHover};
|
|
179
178
|
color: ${colorNeutralForeground2Hover};
|
|
180
179
|
border-color: transparent;
|
|
181
180
|
}
|
|
182
181
|
|
|
183
|
-
:host(
|
|
182
|
+
:host([appearance='subtle']:hover:active) {
|
|
184
183
|
background-color: ${colorSubtleBackgroundPressed};
|
|
185
184
|
color: ${colorNeutralForeground2Pressed};
|
|
186
185
|
border-color: transparent;
|
|
187
186
|
}
|
|
188
187
|
|
|
189
|
-
:host(
|
|
188
|
+
:host([appearance='subtle']:hover) ::slotted(svg) {
|
|
190
189
|
fill: ${colorNeutralForeground2BrandHover};
|
|
191
190
|
}
|
|
192
191
|
|
|
193
|
-
:host(
|
|
192
|
+
:host([appearance='subtle']:hover:active) ::slotted(svg) {
|
|
194
193
|
fill: ${colorNeutralForeground2BrandPressed};
|
|
195
194
|
}
|
|
196
195
|
|
|
197
|
-
:host(
|
|
196
|
+
:host([appearance='transparent']) {
|
|
198
197
|
background-color: ${colorTransparentBackground};
|
|
199
198
|
color: ${colorNeutralForeground2};
|
|
200
199
|
}
|
|
201
200
|
|
|
202
|
-
:host(
|
|
201
|
+
:host([appearance='transparent']:hover) {
|
|
203
202
|
background-color: ${colorTransparentBackgroundHover};
|
|
204
203
|
color: ${colorNeutralForeground2BrandHover};
|
|
205
204
|
}
|
|
206
205
|
|
|
207
|
-
:host(
|
|
206
|
+
:host([appearance='transparent']:hover:active) {
|
|
208
207
|
background-color: ${colorTransparentBackgroundPressed};
|
|
209
208
|
color: ${colorNeutralForeground2BrandPressed};
|
|
210
209
|
}
|
|
211
210
|
|
|
212
|
-
:host(:is(
|
|
211
|
+
:host(:is([appearance='transparent'], [appearance='transparent']:is(:hover, :active))) {
|
|
213
212
|
border-color: transparent;
|
|
214
213
|
}
|
|
215
214
|
`;
|
|
@@ -230,24 +229,24 @@ export const styles = css `
|
|
|
230
229
|
cursor: not-allowed;
|
|
231
230
|
}
|
|
232
231
|
|
|
233
|
-
:host(
|
|
234
|
-
:host(
|
|
232
|
+
:host([appearance='primary']:is(:disabled, [disabled-focusable])),
|
|
233
|
+
:host([appearance='primary']:is(:disabled, [disabled-focusable]):is(:hover, :hover:active)) {
|
|
235
234
|
border-color: transparent;
|
|
236
235
|
}
|
|
237
236
|
|
|
238
|
-
:host(
|
|
239
|
-
:host(
|
|
237
|
+
:host([appearance='outline']:is(:disabled, [disabled-focusable])),
|
|
238
|
+
:host([appearance='outline']:is(:disabled, [disabled-focusable]):is(:hover, :hover:active)) {
|
|
240
239
|
background-color: ${colorTransparentBackground};
|
|
241
240
|
}
|
|
242
241
|
|
|
243
|
-
:host(
|
|
244
|
-
:host(
|
|
242
|
+
:host([appearance='subtle']:is(:disabled, [disabled-focusable])),
|
|
243
|
+
:host([appearance='subtle']:is(:disabled, [disabled-focusable]):is(:hover, :hover:active)) {
|
|
245
244
|
background-color: ${colorTransparentBackground};
|
|
246
245
|
border-color: transparent;
|
|
247
246
|
}
|
|
248
247
|
|
|
249
|
-
:host(
|
|
250
|
-
:host(
|
|
248
|
+
:host([appearance='transparent']:is(:disabled, [disabled-focusable])),
|
|
249
|
+
:host([appearance='transparent']:is(:disabled, [disabled-focusable]):is(:hover, :hover:active)) {
|
|
251
250
|
border-color: transparent;
|
|
252
251
|
background-color: ${colorTransparentBackground};
|
|
253
252
|
}
|
|
@@ -261,7 +260,7 @@ export const styles = css `
|
|
|
261
260
|
border-color: Highlight !important;
|
|
262
261
|
}
|
|
263
262
|
|
|
264
|
-
:host(
|
|
263
|
+
:host([appearance='primary']:not(:is(:hover, :focus-visible))) {
|
|
265
264
|
background-color: Highlight;
|
|
266
265
|
color: HighlightText;
|
|
267
266
|
forced-color-adjust: none;
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"button.styles.js","sourceRoot":"","sources":["../../../src/button/button.styles.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { attr, observable } from '@microsoft/fast-element';
|
|
3
|
-
import {
|
|
3
|
+
import { toggleState } from '../utils/element-internals.js';
|
|
4
4
|
import { BaseCheckbox } from './checkbox.base.js';
|
|
5
|
-
import { CheckboxShape, CheckboxSize } from './checkbox.options.js';
|
|
6
5
|
/**
|
|
7
6
|
* A Checkbox Custom HTML Element.
|
|
8
7
|
* Implements the {@link https://w3c.github.io/aria/#checkbox | ARIA checkbox }.
|
|
@@ -26,26 +25,6 @@ export class Checkbox extends BaseCheckbox {
|
|
|
26
25
|
this.setAriaChecked();
|
|
27
26
|
toggleState(this.elementInternals, 'indeterminate', next);
|
|
28
27
|
}
|
|
29
|
-
/**
|
|
30
|
-
* Applies shape states when the `shape` property changes.
|
|
31
|
-
*
|
|
32
|
-
* @param prev - the previous shape value
|
|
33
|
-
* @param next - the next shape value
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
36
|
-
shapeChanged(prev, next) {
|
|
37
|
-
swapStates(this.elementInternals, prev, next, CheckboxShape);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Applies size states when the `size` property changes.
|
|
41
|
-
*
|
|
42
|
-
* @param prev - the previous state
|
|
43
|
-
* @param next - the next state
|
|
44
|
-
* @internal
|
|
45
|
-
*/
|
|
46
|
-
sizeChanged(prev, next) {
|
|
47
|
-
swapStates(this.elementInternals, prev, next, CheckboxSize);
|
|
48
|
-
}
|
|
49
28
|
constructor() {
|
|
50
29
|
super();
|
|
51
30
|
this.elementInternals.role = 'checkbox';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../src/checkbox/checkbox.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../src/checkbox/checkbox.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAc,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,QAAS,SAAQ,YAAY;IASxC;;;;;;OAMG;IACO,oBAAoB,CAAC,IAAyB,EAAE,IAAyB;QACjF,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,WAAW,CAAC,IAAI,CAAC,gBAAgB,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;IAsBD;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,gBAAgB,CAAC,IAAI,GAAG,UAAU,CAAC;IAC1C,CAAC;IAED;;;;;OAKG;IACO,cAAc,CAAC,QAAiB,IAAI,CAAC,OAAO;QACpD,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,IAAI,CAAC,gBAAgB,CAAC,WAAW,GAAG,OAAO,CAAC;YAC5C,OAAO;QACT,CAAC;QAED,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAC,QAAiB,CAAC,IAAI,CAAC,OAAO;QACjD,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;CACF;AAhEQ;IADN,UAAU;+CACoB;AAsBxB;IADN,IAAI;uCACwB;AAUtB;IADN,IAAI;sCACsB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
|
-
import { checkedState,
|
|
2
|
+
import { checkedState, indeterminateState } from '../styles/states/index.js';
|
|
3
3
|
import { borderRadiusCircular, borderRadiusMedium, borderRadiusSmall, colorCompoundBrandBackground, colorCompoundBrandBackgroundHover, colorCompoundBrandBackgroundPressed, colorCompoundBrandStroke, colorCompoundBrandStrokeHover, colorCompoundBrandStrokePressed, colorNeutralBackground1, colorNeutralBackgroundDisabled, colorNeutralForegroundInverted, colorNeutralStrokeAccessible, colorNeutralStrokeAccessibleHover, colorNeutralStrokeAccessiblePressed, colorNeutralStrokeDisabled, colorStrokeFocus2, colorTransparentStroke, strokeWidthThick, strokeWidthThin, } from '../theme/design-tokens.js';
|
|
4
4
|
import { forcedColorsStylesheetBehavior } from '../utils/behaviors/match-media-stylesheet-behavior.js';
|
|
5
5
|
import { display } from '../utils/display.js';
|
|
@@ -100,17 +100,17 @@ export const styles = css `
|
|
|
100
100
|
inset: 0;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
:host(
|
|
103
|
+
:host([size='large']) {
|
|
104
104
|
--size: 20px;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
:host(
|
|
108
|
-
:host(
|
|
107
|
+
:host([size='large']) ::slotted([slot='checked-indicator']),
|
|
108
|
+
:host([size='large']) .checked-indicator {
|
|
109
109
|
width: 16px;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
:host(
|
|
113
|
-
:host(
|
|
112
|
+
:host([shape='circular']),
|
|
113
|
+
:host([shape='circular']) .indeterminate-indicator {
|
|
114
114
|
border-radius: ${borderRadiusCircular};
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.styles.js","sourceRoot":"","sources":["../../../src/checkbox/checkbox.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"checkbox.styles.js","sourceRoot":"","sources":["../../../src/checkbox/checkbox.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,4BAA4B,EAC5B,iCAAiC,EACjC,mCAAmC,EACnC,wBAAwB,EACxB,6BAA6B,EAC7B,+BAA+B,EAC/B,uBAAuB,EACvB,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC5B,iCAAiC,EACjC,mCAAmC,EACnC,0BAA0B,EAC1B,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,8BAA8B,EAAE,MAAM,uDAAuD,CAAC;AACvG,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,OAAO,CAAC,aAAa,CAAC;;;;wBAIF,uBAAuB;qBAC1B,iBAAiB;cACxB,eAAe,UAAU,4BAA4B;;;;;;;;;;;;;;oBAc/C,iCAAiC;;;;oBAIjC,mCAAmC;;;UAG7C,YAAY;wBACE,iCAAiC;oBACrC,6BAA6B;;;UAGvC,YAAY;wBACE,mCAAmC;oBACvC,+BAA+B;;;;;;;;;;;;;cAarC,gBAAgB,UAAU,sBAAsB;qBACzC,kBAAkB;;;;oBAInB,iBAAiB;;;;;aAKxB,8BAA8B;;;;;;;;;;;;;;eAc5B,YAAY;;;;UAIjB,YAAY;UACZ,kBAAkB;oBACR,wBAAwB;;;UAGlC,YAAY;UACZ,kBAAkB;wBACJ,4BAA4B;;;UAG1C,kBAAkB;qBACP,iBAAiB;;;;;;;;;;;;;;;;;qBAiBjB,oBAAoB;;;;oBAIrB,YAAY;wBACR,8BAA8B;oBAClC,0BAA0B;;;;;;;oBAO1B,kBAAkB;wBACd,0BAA0B;;;oBAG9B,YAAY;aACnB,0BAA0B;;CAEtC,CAAC,aAAa,CACb,8BAA8B,CAAC,GAAG,CAAA;;;;;;;;;;YAUxB,YAAY;;;;;;;;;;YAUZ,YAAY;YACZ,kBAAkB;;;;YAIlB,YAAY;YACZ,kBAAkB;;;;;;;;sBAQR,kBAAkB;;;;;sBAKlB,YAAY;;;GAG/B,CAAC,CACH,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
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';
|
|
5
4
|
// Need to support icon hover styles
|
|
6
5
|
export const styles = css `
|
|
7
6
|
${ButtonStyles}
|
|
@@ -31,7 +30,7 @@ export const styles = css `
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
::slotted(svg),
|
|
34
|
-
:host(
|
|
33
|
+
:host([size='large']) ::slotted(svg) {
|
|
35
34
|
font-size: 40px;
|
|
36
35
|
height: 40px;
|
|
37
36
|
width: 40px;
|
|
@@ -45,20 +44,20 @@ export const styles = css `
|
|
|
45
44
|
color: ${colorNeutralForeground2Pressed};
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
:host(:is(
|
|
47
|
+
:host(:is([appearance='primary'], [appearance='primary']:is(:hover, :active))) ::slotted([slot='description']) {
|
|
49
48
|
color: ${colorNeutralForegroundOnBrand};
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
:host(:is(
|
|
53
|
-
|
|
51
|
+
:host(:is([appearance='transparent'], [appearance='subtle'], [appearance='subtle']:is(:hover, :active)))
|
|
52
|
+
::slotted([slot='description']) {
|
|
54
53
|
color: ${colorNeutralForeground2};
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
:host(
|
|
56
|
+
:host([appearance='transparent']:hover) ::slotted([slot='description']) {
|
|
58
57
|
color: ${colorNeutralForeground2BrandHover};
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
:host(
|
|
60
|
+
:host([appearance='transparent']:active) ::slotted([slot='description']) {
|
|
62
61
|
color: ${colorNeutralForeground2BrandPressed};
|
|
63
62
|
}
|
|
64
63
|
|
|
@@ -67,37 +66,37 @@ export const styles = css `
|
|
|
67
66
|
color: ${colorNeutralForegroundDisabled};
|
|
68
67
|
}
|
|
69
68
|
|
|
70
|
-
:host(
|
|
69
|
+
:host([size='small']) {
|
|
71
70
|
padding: 8px;
|
|
72
71
|
padding-bottom: 10px;
|
|
73
72
|
}
|
|
74
73
|
|
|
75
|
-
:host(
|
|
74
|
+
:host([icon-only]) {
|
|
76
75
|
min-width: 52px;
|
|
77
76
|
max-width: 52px;
|
|
78
77
|
padding: ${spacingHorizontalSNudge};
|
|
79
78
|
}
|
|
80
79
|
|
|
81
|
-
:host(
|
|
80
|
+
:host([icon-only][size='small']) {
|
|
82
81
|
min-width: 48px;
|
|
83
82
|
max-width: 48px;
|
|
84
83
|
padding: ${spacingHorizontalXS};
|
|
85
84
|
}
|
|
86
85
|
|
|
87
|
-
:host(
|
|
86
|
+
:host([icon-only][size='large']) {
|
|
88
87
|
min-width: 56px;
|
|
89
88
|
max-width: 56px;
|
|
90
89
|
padding: ${spacingHorizontalS};
|
|
91
90
|
}
|
|
92
91
|
|
|
93
|
-
:host(
|
|
92
|
+
:host([size='large']) {
|
|
94
93
|
padding-top: 18px;
|
|
95
94
|
padding-inline: 16px;
|
|
96
95
|
padding-bottom: 20px;
|
|
97
96
|
font-size: ${fontSizeBase400};
|
|
98
97
|
line-height: ${lineHeightBase400};
|
|
99
98
|
}
|
|
100
|
-
:host(
|
|
99
|
+
:host([size='large']) ::slotted([slot='description']) {
|
|
101
100
|
font-size: ${fontSizeBase300};
|
|
102
101
|
}
|
|
103
102
|
`;
|
|
@@ -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;
|
|
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;;;;;;;;;;;aAWvB,4BAA4B;;;;aAI5B,8BAA8B;;;;aAI9B,6BAA6B;;;;;aAK7B,uBAAuB;;;;aAIvB,iCAAiC;;;;aAIjC,mCAAmC;;;;;aAKnC,8BAA8B;;;;;;;;;;;eAW5B,uBAAuB;;;;;;eAMvB,mBAAmB;;;;;;eAMnB,kBAAkB;;;;;;;iBAOhB,eAAe;mBACb,iBAAiB;;;iBAGnB,eAAe;;CAE/B,CAAC"}
|
|
@@ -2,8 +2,6 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { attr, FASTElement, nullableNumberConverter } from '@microsoft/fast-element';
|
|
3
3
|
import { applyMixins } from '../utils/apply-mixins.js';
|
|
4
4
|
import { StartEnd } from '../patterns/index.js';
|
|
5
|
-
import { swapStates, toggleState } from '../utils/element-internals.js';
|
|
6
|
-
import { CounterBadgeAppearance, CounterBadgeColor, CounterBadgeShape, CounterBadgeSize, } from './counter-badge.options.js';
|
|
7
5
|
/**
|
|
8
6
|
* The base class used for constructing a fluent-badge custom element
|
|
9
7
|
* @public
|
|
@@ -50,52 +48,12 @@ export class CounterBadge extends FASTElement {
|
|
|
50
48
|
*/
|
|
51
49
|
this.dot = false;
|
|
52
50
|
}
|
|
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
|
-
swapStates(this.elementInternals, prev, next, CounterBadgeAppearance);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Handles changes to color attribute custom states
|
|
63
|
-
* @param prev - the previous state
|
|
64
|
-
* @param next - the next state
|
|
65
|
-
*/
|
|
66
|
-
colorChanged(prev, next) {
|
|
67
|
-
swapStates(this.elementInternals, prev, next, CounterBadgeColor);
|
|
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
|
-
swapStates(this.elementInternals, prev, next, CounterBadgeShape);
|
|
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
|
-
swapStates(this.elementInternals, prev, next, CounterBadgeSize);
|
|
84
|
-
}
|
|
85
51
|
countChanged() {
|
|
86
52
|
this.setCount();
|
|
87
53
|
}
|
|
88
54
|
overflowCountChanged() {
|
|
89
55
|
this.setCount();
|
|
90
56
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Handles changes to dot attribute custom states
|
|
93
|
-
* @param prev - the previous state
|
|
94
|
-
* @param next - the next state
|
|
95
|
-
*/
|
|
96
|
-
dotChanged(prev, next) {
|
|
97
|
-
toggleState(this.elementInternals, 'dot', !!next);
|
|
98
|
-
}
|
|
99
57
|
/**
|
|
100
58
|
* @internal
|
|
101
59
|
* 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,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,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAQhD;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAA7C;;QACE;;;;WAIG;QACI,qBAAgB,GAAqB,IAAI,CAAC,eAAe,EAAE,CAAC;QA0CnE;;;;;;WAMG;QAEI,UAAK,GAAW,CAAC,CAAC;QAKzB;;;;;;WAMG;QAEI,kBAAa,GAAW,EAAE,CAAC;QAKlC;;;;;;WAMG;QAEI,aAAQ,GAAY,KAAK,CAAC;QAEjC;;;;;;WAMG;QAEI,QAAG,GAAY,KAAK,CAAC;IAiB9B,CAAC;IApDW,YAAY;QACpB,IAAI,CAAC,QAAQ,EAAE,CAAC;IAClB,CAAC;IAWS,oBAAoB;QAC5B,IAAI,CAAC,QAAQ,EAAE,CAAC;IAClB,CAAC;IAsBD;;;;;OAKG;IACI,QAAQ;QACb,MAAM,KAAK,GAAkB,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;QAE7C,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YAChD,OAAO,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC;QAC5E,CAAC;QAED,OAAO;IACT,CAAC;CACF;AA7FQ;IADN,IAAI;gDACsC;AAUpC;IADN,IAAI;2CAC4B;AAU1B;IADN,IAAI;2CAC4B;AAU1B;IADN,IAAI;0CAC0B;AAUxB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;2CACpB;AAalB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;mDACxC;AAa3B;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8CACjB;AAU1B;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;yCACE;AA2B9B,WAAW,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { badgeBaseStyles, badgeFilledStyles, badgeGhostStyles, badgeSizeStyles } from '../styles/index.js';
|
|
3
3
|
import { borderRadiusMedium, borderRadiusSmall } from '../theme/design-tokens.js';
|
|
4
|
-
import { dotState, extraSmallState, roundedState, smallState, tinyState } from '../styles/states/index.js';
|
|
5
4
|
/** Badge styles
|
|
6
5
|
* @public
|
|
7
6
|
*/
|
|
8
7
|
export const styles = css `
|
|
9
|
-
:host(
|
|
8
|
+
:host([shape='rounded']) {
|
|
10
9
|
border-radius: ${borderRadiusMedium};
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
:host(
|
|
14
|
-
:host(${roundedState}${extraSmallState}),
|
|
15
|
-
:host(${roundedState}${smallState}) {
|
|
12
|
+
:host([shape='rounded']:is([size='tiny'], [size='extra-small'], [size='small'])) {
|
|
16
13
|
border-radius: ${borderRadiusSmall};
|
|
17
14
|
}
|
|
18
15
|
|
|
@@ -21,8 +18,7 @@ export const styles = css `
|
|
|
21
18
|
${badgeGhostStyles}
|
|
22
19
|
${badgeBaseStyles}
|
|
23
20
|
|
|
24
|
-
:host(
|
|
25
|
-
:host(${dotState}[appearance][size]) {
|
|
21
|
+
:host(:is([dot], [dot][appearance][size])) {
|
|
26
22
|
min-width: auto;
|
|
27
23
|
width: 6px;
|
|
28
24
|
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;AAElF;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;qBAEJ,kBAAkB;;;;qBAIlB,iBAAiB;;;IAGlC,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,eAAe;;;;;;;;CAQlB,CAAC"}
|