@ni/nimble-components 11.7.2 → 11.8.2
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/dist/all-components-bundle.js +279 -152
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +1195 -1072
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/all-components.d.ts +1 -0
- package/dist/esm/all-components.js +1 -0
- package/dist/esm/all-components.js.map +1 -1
- package/dist/esm/breadcrumb/styles.js +4 -6
- package/dist/esm/breadcrumb/styles.js.map +1 -1
- package/dist/esm/breadcrumb-item/styles.js +2 -2
- package/dist/esm/breadcrumb-item/styles.js.map +1 -1
- package/dist/esm/card-button/index.d.ts +17 -0
- package/dist/esm/card-button/index.js +40 -0
- package/dist/esm/card-button/index.js.map +1 -0
- package/dist/esm/card-button/styles.d.ts +1 -0
- package/dist/esm/card-button/styles.js +143 -0
- package/dist/esm/card-button/styles.js.map +1 -0
- package/dist/esm/switch/styles.js +4 -6
- package/dist/esm/switch/styles.js.map +1 -1
- package/dist/esm/text-field/styles.js +4 -7
- package/dist/esm/text-field/styles.js.map +1 -1
- package/dist/esm/tooltip/styles.js +4 -11
- package/dist/esm/tooltip/styles.js.map +1 -1
- package/dist/esm/utilities/style/appearance.d.ts +2 -2
- package/dist/esm/utilities/style/appearance.js +3 -3
- package/dist/esm/utilities/style/appearance.js.map +1 -1
- package/dist/esm/utilities/style/multivalue-property-stylesheet-behavior.d.ts +37 -0
- package/dist/esm/utilities/style/multivalue-property-stylesheet-behavior.js +56 -0
- package/dist/esm/utilities/style/multivalue-property-stylesheet-behavior.js.map +1 -0
- package/dist/esm/utilities/style/theme.d.ts +10 -15
- package/dist/esm/utilities/style/theme.js +23 -55
- package/dist/esm/utilities/style/theme.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-components.js","sourceRoot":"","sources":["../../src/all-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,CAAC;AAClB,OAAO,YAAY,CAAC;AACpB,OAAO,YAAY,CAAC;AACpB,OAAO,UAAU,CAAC;AAClB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,QAAQ,CAAC;AAChB,OAAO,eAAe,CAAC;AACvB,OAAO,aAAa,CAAC;AACrB,OAAO,gBAAgB,CAAC;AACxB,OAAO,UAAU,CAAC;AAClB,OAAO,UAAU,CAAC;AAClB,OAAO,OAAO,CAAC;AACf,OAAO,aAAa,CAAC;AACrB,OAAO,QAAQ,CAAC;AAChB,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AACrB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AACzB,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AACnB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"all-components.js","sourceRoot":"","sources":["../../src/all-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,CAAC;AAClB,OAAO,eAAe,CAAC;AACvB,OAAO,YAAY,CAAC;AACpB,OAAO,YAAY,CAAC;AACpB,OAAO,UAAU,CAAC;AAClB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,QAAQ,CAAC;AAChB,OAAO,eAAe,CAAC;AACvB,OAAO,aAAa,CAAC;AACrB,OAAO,gBAAgB,CAAC;AACxB,OAAO,UAAU,CAAC;AAClB,OAAO,UAAU,CAAC;AAClB,OAAO,OAAO,CAAC;AACf,OAAO,aAAa,CAAC;AACrB,OAAO,QAAQ,CAAC;AAChB,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AACrB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AACzB,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AACnB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { css } from '@microsoft/fast-element';
|
|
|
2
2
|
import { display } from '@microsoft/fast-foundation';
|
|
3
3
|
import { DigitalGreenDark, PowerGreen, White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';
|
|
4
4
|
import { bodyEmphasizedFont, bodyFont, bodyFontColor } from '../theme-provider/design-tokens';
|
|
5
|
+
import { Theme } from '../theme-provider/types';
|
|
5
6
|
import { hexToRgbaCssColor } from '../utilities/style/colors';
|
|
6
7
|
import { themeBehavior } from '../utilities/style/theme';
|
|
7
8
|
export const styles = css `
|
|
@@ -29,8 +30,7 @@ export const styles = css `
|
|
|
29
30
|
::slotted(*:not([href]):last-child) {
|
|
30
31
|
font: ${bodyEmphasizedFont};
|
|
31
32
|
}
|
|
32
|
-
`.withBehaviors(themeBehavior(css `
|
|
33
|
-
${'' /* Light theme */}
|
|
33
|
+
`.withBehaviors(themeBehavior(Theme.light, css `
|
|
34
34
|
:host {
|
|
35
35
|
--ni-private-breadcrumb-link-active-font-color: ${DigitalGreenDark};
|
|
36
36
|
}
|
|
@@ -38,8 +38,7 @@ export const styles = css `
|
|
|
38
38
|
:host(.prominent-links) {
|
|
39
39
|
--ni-private-breadcrumb-link-font-color: ${DigitalGreenDark};
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
${'' /* Dark theme */}
|
|
41
|
+
`), themeBehavior(Theme.dark, css `
|
|
43
42
|
:host {
|
|
44
43
|
--ni-private-breadcrumb-link-active-font-color: ${PowerGreen};
|
|
45
44
|
}
|
|
@@ -47,8 +46,7 @@ export const styles = css `
|
|
|
47
46
|
:host(.prominent-links) {
|
|
48
47
|
--ni-private-breadcrumb-link-font-color: ${PowerGreen};
|
|
49
48
|
}
|
|
50
|
-
|
|
51
|
-
${'' /* Color theme */}
|
|
49
|
+
`), themeBehavior(Theme.color, css `
|
|
52
50
|
:host {
|
|
53
51
|
--ni-private-breadcrumb-link-active-font-color: ${hexToRgbaCssColor(White, 0.6)};
|
|
54
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/breadcrumb/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,gBAAgB,EAChB,UAAU,EACV,KAAK,EACR,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACH,kBAAkB,EAClB,QAAQ,EACR,aAAa,EAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,cAAc,CAAC;;;;gBAIb,QAAQ;mDAC2B,aAAa;;;;;;;;;0DASN,aAAa;;;;;;;;gBAQvD,kBAAkB;;CAEjC,CAAC,aAAa,CACP,aAAa,CACT,
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/breadcrumb/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,gBAAgB,EAChB,UAAU,EACV,KAAK,EACR,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACH,kBAAkB,EAClB,QAAQ,EACR,aAAa,EAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,cAAc,CAAC;;;;gBAIb,QAAQ;mDAC2B,aAAa;;;;;;;;;0DASN,aAAa;;;;;;;;gBAQvD,kBAAkB;;CAEjC,CAAC,aAAa,CACP,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;kEAEmD,gBAAgB;;;;2DAIvB,gBAAgB;;SAElE,CACA,EACD,aAAa,CACT,KAAK,CAAC,IAAI,EACV,GAAG,CAAA;;kEAEmD,UAAU;;;;2DAIjB,UAAU;;SAE5D,CACA,EACD,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;kEAEmD,iBAAiB,CACnE,KAAK,EACL,GAAG,CACN;;;;2DAI8C,UAAU;;SAE5D,CACA,CACJ,CAAC"}
|
|
@@ -28,7 +28,7 @@ export const styles = css `
|
|
|
28
28
|
padding-right: calc(4px - ${borderWidth});
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.control:link {
|
|
31
|
+
.control:any-link {
|
|
32
32
|
cursor: pointer;
|
|
33
33
|
text-decoration: none;
|
|
34
34
|
}
|
|
@@ -42,7 +42,7 @@ export const styles = css `
|
|
|
42
42
|
text-decoration: underline;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
.control:link${focusVisible} {
|
|
45
|
+
.control:any-link${focusVisible} {
|
|
46
46
|
border: ${borderWidth} solid ${borderHoverColor};
|
|
47
47
|
outline: 2px solid ${borderHoverColor};
|
|
48
48
|
outline-offset: 1px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/breadcrumb-item/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,QAAQ,EACR,oBAAoB,EACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,aAAa,CAAC;;;kBAGV,aAAa;;gBAEf,QAAQ;iBACP,aAAa;mCACK,WAAW;;;;;;;;;;;;;;kBAc5B,WAAW;oCACO,WAAW;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/breadcrumb-item/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,QAAQ,EACR,oBAAoB,EACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,aAAa,CAAC;;;kBAGV,aAAa;;gBAEf,QAAQ;iBACP,aAAa;mCACK,WAAW;;;;;;;;;;;;;;kBAc5B,WAAW;oCACO,WAAW;;;;;;;;;;;;;;;;;uBAiBxB,YAAY;kBACjB,WAAW,UAAU,gBAAgB;6BAC1B,gBAAgB;;;;;;;;;;;;;;;;;;;;iBAoB5B,QAAQ;kBACP,QAAQ;;;;gBAIV,oBAAoB;;CAEnC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Button as FoundationButton } from '@microsoft/fast-foundation';
|
|
2
|
+
declare global {
|
|
3
|
+
interface HTMLElementTagNameMap {
|
|
4
|
+
'nimble-card-button': CardButton;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A nimble-styled card button
|
|
9
|
+
*/
|
|
10
|
+
export declare class CardButton extends FoundationButton {
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
* @remarks
|
|
14
|
+
* HTML Attribute: selected
|
|
15
|
+
*/
|
|
16
|
+
selected: boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr } from '@microsoft/fast-element';
|
|
3
|
+
import { Button as FoundationButton, buttonTemplate as template, DesignSystem } from '@microsoft/fast-foundation';
|
|
4
|
+
import { styles } from './styles';
|
|
5
|
+
/**
|
|
6
|
+
* A nimble-styled card button
|
|
7
|
+
*/
|
|
8
|
+
export class CardButton extends FoundationButton {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
* @remarks
|
|
14
|
+
* HTML Attribute: selected
|
|
15
|
+
*/
|
|
16
|
+
this.selected = false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
attr({ mode: 'boolean' })
|
|
21
|
+
], CardButton.prototype, "selected", void 0);
|
|
22
|
+
/**
|
|
23
|
+
* A function that returns a nimble-card-button registration for configuring the component with a DesignSystem.
|
|
24
|
+
* Implements {@link @microsoft/fast-foundation#buttonTemplate}
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
* @remarks
|
|
28
|
+
* Generates HTML Element: \<nimble-card-button\>
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
const nimbleCardButton = CardButton.compose({
|
|
32
|
+
baseName: 'card-button',
|
|
33
|
+
template,
|
|
34
|
+
styles,
|
|
35
|
+
shadowOptions: {
|
|
36
|
+
delegatesFocus: true
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCardButton());
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/card-button/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EACH,MAAM,IAAI,gBAAgB,EAC1B,cAAc,IAAI,QAAQ,EAC1B,YAAY,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAQlC;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,gBAAgB;IAAhD;;QACI;;;;WAIG;QAEI,aAAQ,GAAG,KAAK,CAAC;IAC5B,CAAC;CAAA;AADG;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;4CACF;AAG5B;;;;;;;;GAQG;AACH,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,CAAC;IACxC,QAAQ,EAAE,aAAa;IACvB,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACX,cAAc,EAAE,IAAI;KACvB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@microsoft/fast-element").ElementStyles;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
import { Black, Black15, Black91, White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';
|
|
3
|
+
import { display } from '@microsoft/fast-foundation';
|
|
4
|
+
import { focusVisible } from '../utilities/style/focus';
|
|
5
|
+
import { borderWidth, smallDelay, buttonLabelFont, buttonLabelFontColor, borderHoverColor } from '../theme-provider/design-tokens';
|
|
6
|
+
import { themeBehavior } from '../utilities/style/theme';
|
|
7
|
+
import { hexToRgbaCssColor } from '../utilities/style/colors';
|
|
8
|
+
import { Theme } from '../theme-provider/types';
|
|
9
|
+
// prettier-ignore
|
|
10
|
+
export const styles = css `
|
|
11
|
+
${display('inline-flex')}
|
|
12
|
+
|
|
13
|
+
:host {
|
|
14
|
+
background-color: transparent;
|
|
15
|
+
color: ${buttonLabelFontColor};
|
|
16
|
+
font: ${buttonLabelFont};
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
outline: none;
|
|
19
|
+
border: none;
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host(:hover) {
|
|
24
|
+
box-shadow: 0px 1px 4px
|
|
25
|
+
var(--ni-private-card-button-box-shadow-hover-color);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host(:active) {
|
|
29
|
+
box-shadow: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([disabled]) {
|
|
33
|
+
cursor: default;
|
|
34
|
+
box-shadow: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.control {
|
|
38
|
+
background-color: transparent;
|
|
39
|
+
height: 100%;
|
|
40
|
+
width: 100%;
|
|
41
|
+
border: ${borderWidth} solid transparent;
|
|
42
|
+
color: inherit;
|
|
43
|
+
border-radius: inherit;
|
|
44
|
+
fill: inherit;
|
|
45
|
+
cursor: inherit;
|
|
46
|
+
font: inherit;
|
|
47
|
+
outline: none;
|
|
48
|
+
transition: box-shadow ${smallDelay};
|
|
49
|
+
padding: 0px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.control:hover {
|
|
53
|
+
background: var(--ni-private-card-button-background-hover-color);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.control${focusVisible} {
|
|
57
|
+
box-shadow: 0px 0px 0px ${borderWidth} ${borderHoverColor} inset;
|
|
58
|
+
border-color: ${borderHoverColor};
|
|
59
|
+
outline: ${borderWidth} solid ${borderHoverColor};
|
|
60
|
+
outline-offset: -4px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.control:active {
|
|
64
|
+
background: var(--ni-private-card-button-background-active-color);
|
|
65
|
+
border-color: var(--ni-private-card-button-border-active-color);
|
|
66
|
+
outline: none;
|
|
67
|
+
box-shadow: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:host([selected]) .control {
|
|
71
|
+
background: var(--ni-private-card-button-background-active-color);
|
|
72
|
+
border-color: var(--ni-private-card-button-border-selected-color);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:host([selected]) .control${focusVisible} {
|
|
76
|
+
border-color: ${borderHoverColor};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([selected]) .control:active {
|
|
80
|
+
border-color: var(--ni-private-card-button-border-active-color);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host([selected]) .control${focusVisible}:active {
|
|
84
|
+
outline: none;
|
|
85
|
+
box-shadow: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.control[disabled] {
|
|
89
|
+
background: transparent;
|
|
90
|
+
opacity: 0.3;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.control[disabled]:active {
|
|
94
|
+
border-color: transparent;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host([selected]) .control[disabled]:active {
|
|
98
|
+
border-color: var(--ni-private-card-button-border-selected-color);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.content {
|
|
102
|
+
display: contents;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
slot[name='start'] {
|
|
106
|
+
display: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
slot[name='end'] {
|
|
110
|
+
display: none;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@media (prefers-reduced-motion) {
|
|
114
|
+
.control {
|
|
115
|
+
transition-duration: 0s;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
`.withBehaviors(themeBehavior(Theme.light, css `
|
|
119
|
+
:host {
|
|
120
|
+
--ni-private-card-button-box-shadow-hover-color: ${hexToRgbaCssColor(Black, 0.3)};
|
|
121
|
+
--ni-private-card-button-background-hover-color: ${hexToRgbaCssColor(White, 0.3)};
|
|
122
|
+
--ni-private-card-button-background-active-color: ${White};
|
|
123
|
+
--ni-private-card-button-border-active-color: ${hexToRgbaCssColor(Black91, 0.2)};
|
|
124
|
+
--ni-private-card-button-border-selected-color: ${hexToRgbaCssColor(Black91, 0.6)};
|
|
125
|
+
}
|
|
126
|
+
`), themeBehavior(Theme.dark, css `
|
|
127
|
+
:host {
|
|
128
|
+
--ni-private-card-button-box-shadow-hover-color: ${hexToRgbaCssColor(Black, 0.77)};
|
|
129
|
+
--ni-private-card-button-background-hover-color: ${hexToRgbaCssColor(Black15, 0.07)};
|
|
130
|
+
--ni-private-card-button-background-active-color: ${hexToRgbaCssColor(Black15, 0.15)};
|
|
131
|
+
--ni-private-card-button-border-active-color: ${hexToRgbaCssColor(Black15, 0.2)};
|
|
132
|
+
--ni-private-card-button-border-selected-color: ${Black15};
|
|
133
|
+
}
|
|
134
|
+
`), themeBehavior(Theme.color, css `
|
|
135
|
+
:host {
|
|
136
|
+
--ni-private-card-button-box-shadow-hover-color: ${hexToRgbaCssColor(White, 0.77)};
|
|
137
|
+
--ni-private-card-button-background-hover-color: ${hexToRgbaCssColor(White, 0.2)};
|
|
138
|
+
--ni-private-card-button-background-active-color: ${hexToRgbaCssColor(White, 0.4)};
|
|
139
|
+
--ni-private-card-button-border-active-color: ${hexToRgbaCssColor(White, 0.2)};
|
|
140
|
+
--ni-private-card-button-border-selected-color: ${hexToRgbaCssColor(White, 0.6)};
|
|
141
|
+
}
|
|
142
|
+
`));
|
|
143
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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,EAAE,aAAa,CACZ,KAAK,CAAC,IAAI,EACV,GAAG,CAAA;;uEAEwD,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC;uEAC9B,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC;wEAC/B,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC;oEACpC,iBAAiB,CAAC,OAAO,EAAE,GAAG,CAAC;sEAC7B,OAAO;;aAEhE,CACJ,EAAE,aAAa,CACZ,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;uEAEwD,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC;uEAC9B,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC;wEAC5B,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC;oEACjC,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC;sEAC3B,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC;;aAEtF,CACJ,CACJ,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { css } from '@microsoft/fast-element';
|
|
|
2
2
|
import { display } from '@microsoft/fast-foundation';
|
|
3
3
|
import { Black15, Black7, Black91, White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';
|
|
4
4
|
import { borderHoverColor, borderWidth, buttonLabelDisabledFontColor, buttonLabelFont, buttonLabelFontColor, controlHeight, controlLabelDisabledFontColor, controlLabelFont, controlLabelFontColor, fillHoverColor, smallDelay } from '../theme-provider/design-tokens';
|
|
5
|
+
import { Theme } from '../theme-provider/types';
|
|
5
6
|
import { hexToRgbaCssColor } from '../utilities/style/colors';
|
|
6
7
|
import { focusVisible } from '../utilities/style/focus';
|
|
7
8
|
import { themeBehavior } from '../utilities/style/theme';
|
|
@@ -143,8 +144,7 @@ export const styles = css `
|
|
|
143
144
|
transition-duration: 0s;
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
|
-
`.withBehaviors(themeBehavior(css `
|
|
147
|
-
${'' /* Light theme */}
|
|
147
|
+
`.withBehaviors(themeBehavior(Theme.light, css `
|
|
148
148
|
:host {
|
|
149
149
|
--ni-private-switch-background-disabled-color: ${hexToRgbaCssColor(Black91, 0.07)};
|
|
150
150
|
--ni-private-switch-indicator-background-color: ${White};
|
|
@@ -152,8 +152,7 @@ export const styles = css `
|
|
|
152
152
|
--ni-private-switch-indicator-border-color: ${Black91};
|
|
153
153
|
--ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(Black91, 0.3)};
|
|
154
154
|
}
|
|
155
|
-
|
|
156
|
-
${'' /* Dark theme */}
|
|
155
|
+
`), themeBehavior(Theme.dark, css `
|
|
157
156
|
:host {
|
|
158
157
|
--ni-private-switch-background-disabled-color: ${hexToRgbaCssColor(Black15, 0.07)};
|
|
159
158
|
--ni-private-switch-indicator-background-color: ${hexToRgbaCssColor(Black91, 0.3)};
|
|
@@ -161,8 +160,7 @@ export const styles = css `
|
|
|
161
160
|
--ni-private-switch-indicator-border-color: ${Black7};
|
|
162
161
|
--ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(Black7, 0.3)};
|
|
163
162
|
}
|
|
164
|
-
|
|
165
|
-
${'' /* Color theme */}
|
|
163
|
+
`), themeBehavior(Theme.color, css `
|
|
166
164
|
:host {
|
|
167
165
|
--ni-private-switch-background-disabled-color: ${hexToRgbaCssColor(White, 0.07)};
|
|
168
166
|
--ni-private-switch-indicator-background-color: ${hexToRgbaCssColor(White, 0.1)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/switch/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,OAAO,EACP,MAAM,EACN,OAAO,EACP,KAAK,EACR,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACH,gBAAgB,EAChB,WAAW,EACX,4BAA4B,EAC5B,eAAe,EACf,oBAAoB,E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MAAM,EACN,GAAG,CACN;;SAEJ,CACA,EACD,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;iEAEkD,iBAAiB,CAClE,KAAK,EACL,IAAI,CACP;kEACqD,iBAAiB,CACnE,KAAK,EACL,GAAG,CACN;2EAC8D,iBAAiB,CAC5E,KAAK,EACL,GAAG,CACN;8DACiD,KAAK;uEACI,iBAAiB,CACxE,KAAK,EACL,GAAG,CACN;;SAEJ,CACA,CACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/indent */
|
|
1
2
|
import { css } from '@microsoft/fast-element';
|
|
2
3
|
import { display } from '@microsoft/fast-foundation';
|
|
3
4
|
import { borderRgbPartialColor, borderHoverColor, borderWidth, bodyFontColor, bodyDisabledFontColor, controlHeight, failColor, fillSelectedRgbPartialColor, labelHeight, smallDelay, controlLabelFont, bodyFont, controlLabelFontColor, controlLabelDisabledFontColor, standardPadding } from '../theme-provider/design-tokens';
|
|
@@ -234,17 +235,13 @@ export const styles = css `
|
|
|
234
235
|
:host([readonly]) .root {
|
|
235
236
|
border-color: transparent;
|
|
236
237
|
}
|
|
237
|
-
`), themeBehavior(css `
|
|
238
|
-
${'' /* Light theme */}
|
|
238
|
+
`), themeBehavior(Theme.light, css `
|
|
239
239
|
.control::-ms-reveal {
|
|
240
240
|
filter: invert(0%);
|
|
241
241
|
}
|
|
242
|
-
|
|
243
|
-
${'' /* Dark theme */}
|
|
242
|
+
`), themeBehavior([Theme.dark, Theme.color], css `
|
|
244
243
|
.control::-ms-reveal {
|
|
245
244
|
filter: invert(100%);
|
|
246
245
|
}
|
|
247
|
-
|
|
248
|
-
// Color theme
|
|
249
|
-
Theme.dark));
|
|
246
|
+
`));
|
|
250
247
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/text-field/styles.ts"],"names":[],"mappings":"AAAA,OAA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;;;;;;UASrC,CAAA,yCAA0C,EAAE;;;;;;;;;;;;UAY5C,CAAA,yCAA0C,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAyC5C;AACE;;6CAE6C,CAAC,EAClD;;;;;iBAKS,qBAAqB;2BACX,2BAA2B;;;;iBAIrC,qBAAqB;;;;iBAIrB,qBAAqB;;;;;;;;;;4BAUV,WAAW;;;yBAGd,gBAAgB;;4BAEb,UAAU;;;;;;;;;;+BAUP,SAAS;;;;;;;;;;;;;;;;;UAiB9B,aAAa,CAAC,iBAAiB;;CAExC,CAAC,aAAa,CACX,kBAAkB,CACd,mBAAmB,CAAC,SAAS,EAC7B,GAAG,CAAA;;uCAE4B,WAAW;;;SAGzC,CACJ,EACD,kBAAkB,CACd,mBAAmB,CAAC,KAAK,EACzB,GAAG,CAAA;;yCAE8B,qBAAqB;;;;gCAI9B,WAAW;iCACV,WAAW;;;;;uCAKL,WAAW;;;;;;;;;yCAST,qBAAqB;;;;;yCAKrB,qBAAqB;;SAErD,CACJ,EACD,kBAAkB,CACd,mBAAmB,CAAC,OAAO,EAC3B,GAAG,CAAA;;gCAEqB,WAAW;;;SAGlC,CACJ,EACD,kBAAkB,CACd,mBAAmB,CAAC,SAAS,EAC7B,GAAG,CAAA;;gCAEqB,WAAW;iCACV,WAAW;;;;;;SAMnC,CACJ,EACD,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;;;SAIF,CACJ,EACD,aAAa,CACT,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,EACzB,GAAG,CAAA;;;;SAIF,CACJ,CACJ,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { css } from '@microsoft/fast-element';
|
|
|
2
2
|
import { display } from '@microsoft/fast-foundation';
|
|
3
3
|
import { BannerFail100DarkUi, Black15, Black85, Black91, ForestGreen, Information100DarkUi, Information100LightUi, White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';
|
|
4
4
|
import { tooltipCaptionFont, tooltipCaptionFontColor, popupBoxShadowColor, borderWidth, standardPadding, smallPadding } from '../theme-provider/design-tokens';
|
|
5
|
+
import { Theme } from '../theme-provider/types';
|
|
5
6
|
import { hexToRgbaCssColor } from '../utilities/style/colors';
|
|
6
7
|
import { themeBehavior } from '../utilities/style/theme';
|
|
7
8
|
export const styles = css `
|
|
@@ -45,11 +46,7 @@ export const styles = css `
|
|
|
45
46
|
display: flex;
|
|
46
47
|
flex: 0 0 auto;
|
|
47
48
|
}
|
|
48
|
-
`.withBehaviors(
|
|
49
|
-
/* Local Theme Behaviors for tooltip borders and backgrounds */
|
|
50
|
-
themeBehavior(
|
|
51
|
-
// Light Theme
|
|
52
|
-
css `
|
|
49
|
+
`.withBehaviors(themeBehavior(Theme.light, css `
|
|
53
50
|
:host(.fail) {
|
|
54
51
|
--ni-private-tooltip-border-color: ${BannerFail100DarkUi};
|
|
55
52
|
--ni-private-tooltip-background-color: ${White};
|
|
@@ -59,9 +56,7 @@ css `
|
|
|
59
56
|
--ni-private-tooltip-border-color: ${Information100LightUi};
|
|
60
57
|
--ni-private-tooltip-background-color: ${White};
|
|
61
58
|
}
|
|
62
|
-
|
|
63
|
-
// Dark Theme
|
|
64
|
-
css `
|
|
59
|
+
`), themeBehavior(Theme.dark, css `
|
|
65
60
|
:host {
|
|
66
61
|
--ni-private-tooltip-border-color: ${hexToRgbaCssColor(Black15, 0.3)};
|
|
67
62
|
--ni-private-tooltip-background-color: ${Black85};
|
|
@@ -74,9 +69,7 @@ css `
|
|
|
74
69
|
:host(.fail) {
|
|
75
70
|
--ni-private-tooltip-border-color: ${BannerFail100DarkUi};
|
|
76
71
|
}
|
|
77
|
-
|
|
78
|
-
// Color Theme
|
|
79
|
-
css `
|
|
72
|
+
`), themeBehavior(Theme.color, css `
|
|
80
73
|
.anchored-region {
|
|
81
74
|
background-color: ${ForestGreen};
|
|
82
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/tooltip/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,mBAAmB,EACnB,OAAO,EACP,OAAO,EACP,OAAO,EACP,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EACrB,KAAK,EACR,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACH,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,YAAY,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,aAAa,CAAC;;;gBAGZ,kBAAkB;iBACjB,uBAAuB;;6CAEK,iBAAiB,CAAC,OAAO,EAAE,GAAG,CAAC;iDAC3B,OAAO;;;;;;;kCAOtB,mBAAmB;;kBAEnC,WAAW;;;6BAGA,eAAe;8BACd,eAAe;uBACtB,YAAY;;;;;;;;;;;;;;;;;;;CAmBlC,CAAC,aAAa
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/tooltip/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,mBAAmB,EACnB,OAAO,EACP,OAAO,EACP,OAAO,EACP,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EACrB,KAAK,EACR,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACH,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,YAAY,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,aAAa,CAAC;;;gBAGZ,kBAAkB;iBACjB,uBAAuB;;6CAEK,iBAAiB,CAAC,OAAO,EAAE,GAAG,CAAC;iDAC3B,OAAO;;;;;;;kCAOtB,mBAAmB;;kBAEnC,WAAW;;;6BAGA,eAAe;8BACd,eAAe;uBACtB,YAAY;;;;;;;;;;;;;;;;;;;CAmBlC,CAAC,aAAa,CACP,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;qDAEsC,mBAAmB;yDACf,KAAK;;;;qDAIT,qBAAqB;yDACjB,KAAK;;SAErD,CACA,EACD,aAAa,CACT,KAAK,CAAC,IAAI,EACV,GAAG,CAAA;;qDAEsC,iBAAiB,CACtD,OAAO,EACP,GAAG,CACN;yDAC4C,OAAO;;;;qDAIX,oBAAoB;;;;qDAIpB,mBAAmB;;SAE/D,CACA,EACD,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;oCAEqB,WAAW;;;;qDAIM,iBAAiB,CACtD,KAAK,EACL,GAAG,CACN;yDAC4C,iBAAiB,CAC1D,KAAK,EACL,IAAI,CACP;;;;qDAIwC,KAAK;;;;qDAIL,KAAK;;;;;;SAMjD,CACA,CACJ,CAAC"}
|
|
@@ -3,9 +3,9 @@ import type { Behavior, ElementStyles } from '@microsoft/fast-element';
|
|
|
3
3
|
* Behavior that will conditionally apply a stylesheet based on the element's
|
|
4
4
|
* appearance property
|
|
5
5
|
*
|
|
6
|
-
* @param value - The value of the appearance property
|
|
6
|
+
* @param value - The value or values of the appearance property
|
|
7
7
|
* @param styles - The styles to be applied when condition matches
|
|
8
8
|
*
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
export declare function appearanceBehavior<AppearanceType>(value: AppearanceType, styles: ElementStyles): Behavior;
|
|
11
|
+
export declare function appearanceBehavior<AppearanceType>(value: AppearanceType | AppearanceType[], styles: ElementStyles): Behavior;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MultivaluePropertyStyleSheetBehavior } from './multivalue-property-stylesheet-behavior';
|
|
2
2
|
/**
|
|
3
3
|
* Behavior that will conditionally apply a stylesheet based on the element's
|
|
4
4
|
* appearance property
|
|
5
5
|
*
|
|
6
|
-
* @param value - The value of the appearance property
|
|
6
|
+
* @param value - The value or values of the appearance property
|
|
7
7
|
* @param styles - The styles to be applied when condition matches
|
|
8
8
|
*
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
11
|
export function appearanceBehavior(value, styles) {
|
|
12
|
-
return new
|
|
12
|
+
return new MultivaluePropertyStyleSheetBehavior('appearance', value, styles);
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=appearance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appearance.js","sourceRoot":"","sources":["../../../../src/utilities/style/appearance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"appearance.js","sourceRoot":"","sources":["../../../../src/utilities/style/appearance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oCAAoC,EAAE,MAAM,2CAA2C,CAAC;AAEjG;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAC9B,KAAwC,EACxC,MAAqB;IAErB,OAAO,IAAI,oCAAoC,CAC3C,YAAY,EACZ,KAAK,EACL,MAAM,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Behavior, ElementStyles, FASTElement } from '@microsoft/fast-element';
|
|
2
|
+
/**
|
|
3
|
+
* A behavior to add or remove a stylesheet from an element based on a property. The behavior ensures that
|
|
4
|
+
* styles are applied while the property matches and that styles are not applied if the property does
|
|
5
|
+
* not match.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export declare class MultivaluePropertyStyleSheetBehavior<PropertyType> implements Behavior {
|
|
10
|
+
private readonly propertyName;
|
|
11
|
+
private readonly value;
|
|
12
|
+
private readonly styles;
|
|
13
|
+
/**
|
|
14
|
+
* Constructs a {@link MultivaluePropertyStyleSheetBehavior} instance.
|
|
15
|
+
* @param propertyName - The property name to operate from.
|
|
16
|
+
* @param value - The property value or values to operate from.
|
|
17
|
+
* @param styles - The styles to coordinate with the property.
|
|
18
|
+
*/
|
|
19
|
+
constructor(propertyName: string, value: PropertyType | PropertyType[], styles: ElementStyles);
|
|
20
|
+
/**
|
|
21
|
+
* Binds the behavior to the element.
|
|
22
|
+
* @param elementInstance - The element for which the property is applied.
|
|
23
|
+
*/
|
|
24
|
+
bind(elementInstance: FASTElement): void;
|
|
25
|
+
/**
|
|
26
|
+
* Unbinds the behavior from the element.
|
|
27
|
+
* @param source - The element for which the behavior is unbinding.
|
|
28
|
+
*/
|
|
29
|
+
unbind(source: FASTElement & HTMLElement): void;
|
|
30
|
+
/**
|
|
31
|
+
* Change event for the provided element.
|
|
32
|
+
* @param source - the element for which to attach or detach styles.
|
|
33
|
+
* @param key - the key to lookup to know if the element already has the styles
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
handleChange(source: FASTElement, key: string): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Observable } from '@microsoft/fast-element';
|
|
2
|
+
/**
|
|
3
|
+
* A behavior to add or remove a stylesheet from an element based on a property. The behavior ensures that
|
|
4
|
+
* styles are applied while the property matches and that styles are not applied if the property does
|
|
5
|
+
* not match.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export class MultivaluePropertyStyleSheetBehavior {
|
|
10
|
+
/**
|
|
11
|
+
* Constructs a {@link MultivaluePropertyStyleSheetBehavior} instance.
|
|
12
|
+
* @param propertyName - The property name to operate from.
|
|
13
|
+
* @param value - The property value or values to operate from.
|
|
14
|
+
* @param styles - The styles to coordinate with the property.
|
|
15
|
+
*/
|
|
16
|
+
constructor(propertyName, value, styles) {
|
|
17
|
+
this.propertyName = propertyName;
|
|
18
|
+
this.value = value;
|
|
19
|
+
this.styles = styles;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Binds the behavior to the element.
|
|
23
|
+
* @param elementInstance - The element for which the property is applied.
|
|
24
|
+
*/
|
|
25
|
+
bind(elementInstance) {
|
|
26
|
+
Observable.getNotifier(elementInstance).subscribe(this, this.propertyName);
|
|
27
|
+
this.handleChange(elementInstance, this.propertyName);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Unbinds the behavior from the element.
|
|
31
|
+
* @param source - The element for which the behavior is unbinding.
|
|
32
|
+
*/
|
|
33
|
+
unbind(source) {
|
|
34
|
+
Observable.getNotifier(source).unsubscribe(this, this.propertyName);
|
|
35
|
+
source.$fastController.removeStyles(this.styles);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Change event for the provided element.
|
|
39
|
+
* @param source - the element for which to attach or detach styles.
|
|
40
|
+
* @param key - the key to lookup to know if the element already has the styles
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
handleChange(source, key) {
|
|
44
|
+
// @ts-expect-error Accessing arbitrary property of an element
|
|
45
|
+
const currentValue = source[key];
|
|
46
|
+
if (Array.isArray(this.value)
|
|
47
|
+
? this.value.includes(currentValue)
|
|
48
|
+
: this.value === currentValue) {
|
|
49
|
+
source.$fastController.addStyles(this.styles);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
source.$fastController.removeStyles(this.styles);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=multivalue-property-stylesheet-behavior.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multivalue-property-stylesheet-behavior.js","sourceRoot":"","sources":["../../../../src/utilities/style/multivalue-property-stylesheet-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,UAAU,EACb,MAAM,yBAAyB,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,OAAO,oCAAoC;IAE7C;;;;;OAKG;IACH,YACqB,YAAoB,EACpB,KAAoC,EACpC,MAAqB;QAFrB,iBAAY,GAAZ,YAAY,CAAQ;QACpB,UAAK,GAAL,KAAK,CAA+B;QACpC,WAAM,GAAN,MAAM,CAAe;IACvC,CAAC;IAEJ;;;OAGG;IACI,IAAI,CAAC,eAA4B;QACpC,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,SAAS,CAC7C,IAAI,EACJ,IAAI,CAAC,YAAY,CACpB,CAAC;QACF,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,MAAiC;QAC3C,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACpE,MAAM,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;IAED;;;;;OAKG;IACI,YAAY,CAAC,MAAmB,EAAE,GAAW;QAChD,8DAA8D;QAC9D,MAAM,YAAY,GAAiB,MAAM,CAAC,GAAG,CAAiB,CAAC;QAC/D,IACI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YACrB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC;YACnC,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,YAAY,EACnC;YACE,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACjD;aAAM;YACH,MAAM,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACpD;IACL,CAAC;CACJ"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { Behavior, ElementStyles, FASTElement } from '@microsoft/fast-element';
|
|
1
|
+
import type { Behavior, ElementStyles, FASTElement } from '@microsoft/fast-element';
|
|
2
2
|
import type { Theme } from '../../theme-provider/types';
|
|
3
|
-
export declare type LightStyle = ElementStyles | null;
|
|
4
|
-
export declare type DarkStyleOrAlias = ElementStyles | null | Extract<Theme, 'light'>;
|
|
5
|
-
export declare type ColorStyleOrAlias = ElementStyles | null | Extract<Theme, 'light' | 'dark'>;
|
|
6
3
|
/**
|
|
7
4
|
* Behavior to conditionally apply theme-based stylesheets.
|
|
8
5
|
*/
|
|
9
6
|
declare class ThemeStyleSheetBehavior implements Behavior {
|
|
10
|
-
private readonly
|
|
7
|
+
private readonly theme;
|
|
8
|
+
private readonly styles;
|
|
11
9
|
private readonly cache;
|
|
12
|
-
constructor(
|
|
13
|
-
private static resolveTheme;
|
|
10
|
+
constructor(theme: Theme | Theme[], styles: ElementStyles);
|
|
14
11
|
/**
|
|
15
12
|
* @internal
|
|
16
13
|
*/
|
|
@@ -23,20 +20,18 @@ declare class ThemeStyleSheetBehavior implements Behavior {
|
|
|
23
20
|
/**
|
|
24
21
|
* Behavior to conditionally apply theme-based stylesheets. To determine which to apply,
|
|
25
22
|
* the behavior will use the nearest ThemeProvider's 'theme' design system value.
|
|
26
|
-
* To re-use the same style for multiple themes you can specify the name of an already
|
|
27
|
-
* defined theme to alias them together.
|
|
28
23
|
*
|
|
29
24
|
* @public
|
|
30
25
|
* @example
|
|
31
26
|
* ```ts
|
|
32
27
|
* css`
|
|
33
|
-
*
|
|
34
|
-
* `.withBehaviors(
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
28
|
+
* // ...
|
|
29
|
+
* `.withBehaviors(
|
|
30
|
+
* themeBehavior(Theme.light, css` ... `),
|
|
31
|
+
* // Apply style for both dark and color theme
|
|
32
|
+
* themeBehavior([Theme.dark, Theme.color], css` ... `)
|
|
38
33
|
* )
|
|
39
34
|
* ```
|
|
40
35
|
*/
|
|
41
|
-
export declare const themeBehavior: (
|
|
36
|
+
export declare const themeBehavior: (theme: Theme | Theme[], styles: ElementStyles) => ThemeStyleSheetBehavior;
|
|
42
37
|
export {};
|