@ni/nimble-components 1.0.0 → 1.1.0
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/esm/button/index.js +1 -1
- package/dist/esm/button/index.js.map +1 -1
- package/dist/esm/button/types.d.ts +2 -6
- package/dist/esm/button/types.js +1 -6
- package/dist/esm/button/types.js.map +1 -1
- package/dist/esm/nimble-components/src/button/types.d.ts +2 -6
- package/dist/esm/{button → nimble-components/src/patterns/button}/styles.d.ts +0 -0
- package/dist/esm/nimble-components/src/patterns/button/types.d.ts +10 -0
- package/dist/esm/nimble-components/src/toggle-button/index.d.ts +33 -0
- package/dist/esm/nimble-components/src/{button → toggle-button}/styles.d.ts +0 -0
- package/dist/esm/nimble-components/src/toggle-button/template.d.ts +2 -0
- package/dist/esm/nimble-components/src/toggle-button/types.d.ts +6 -0
- package/dist/esm/{button/behaviors.d.ts → nimble-components/src/utilities/style/appearance.d.ts} +1 -1
- package/dist/esm/patterns/button/styles.d.ts +1 -0
- package/dist/esm/{button → patterns/button}/styles.js +8 -8
- package/dist/esm/patterns/button/styles.js.map +1 -0
- package/dist/esm/patterns/button/types.d.ts +10 -0
- package/dist/esm/patterns/button/types.js +11 -0
- package/dist/esm/patterns/button/types.js.map +1 -0
- package/dist/esm/toggle-button/index.d.ts +33 -0
- package/dist/esm/toggle-button/index.js +43 -0
- package/dist/esm/toggle-button/index.js.map +1 -0
- package/dist/esm/toggle-button/styles.d.ts +1 -0
- package/dist/esm/toggle-button/styles.js +31 -0
- package/dist/esm/toggle-button/styles.js.map +1 -0
- package/dist/esm/toggle-button/template.d.ts +2 -0
- package/dist/esm/toggle-button/template.js +25 -0
- package/dist/esm/toggle-button/template.js.map +1 -0
- package/dist/esm/toggle-button/types.d.ts +6 -0
- package/dist/esm/toggle-button/types.js +2 -0
- package/dist/esm/toggle-button/types.js.map +1 -0
- package/dist/esm/{nimble-components/src/button/behaviors.d.ts → utilities/style/appearance.d.ts} +1 -1
- package/dist/esm/{button/behaviors.js → utilities/style/appearance.js} +1 -1
- package/dist/esm/utilities/style/appearance.js.map +1 -0
- package/package.json +1 -1
- package/dist/esm/button/behaviors.js.map +0 -1
- package/dist/esm/button/styles.js.map +0 -1
package/dist/esm/button/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { attr } from '@microsoft/fast-element';
|
|
3
3
|
import { Button as FoundationButton, buttonTemplate as template, DesignSystem } from '@microsoft/fast-foundation';
|
|
4
|
-
import { styles } from '
|
|
4
|
+
import { styles } from '../patterns/button/styles';
|
|
5
5
|
import { ButtonAppearance } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* A nimble-styled HTML button
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EACH,MAAM,IAAI,gBAAgB,EAE1B,cAAc,IAAI,QAAQ,EAC1B,YAAY,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EACH,MAAM,IAAI,gBAAgB,EAE1B,cAAc,IAAI,QAAQ,EAC1B,YAAY,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAU3C;;GAEG;AACH,MAAM,MAAO,SAAQ,gBAAgB;IAArC;;QAWI;;;;;;;;WAQG;QAEI,kBAAa,GAAG,KAAK,CAAC;QAEZ,cAAS,GAAG,uBAAuB,CAAC;IAYzD,CAAC;IAVU,iBAAiB;QACpB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC;SAC9C;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,CAAE,CAAC;QACxD,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QAC5B,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACjE,CAAC;CACJ;AA1BG;IADC,IAAI;0CACgC;AAYrC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;6CAC1B;AAgBjC;;;;;;;;GAQG;AACH,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAgB;IAC/C,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,gBAAgB;IAC3B,0GAA0G;IAC1G,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,YAAY,EAAE,CAAC,CAAC"}
|
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
* @public
|
|
4
4
|
*/
|
|
5
5
|
import type { Button } from '@microsoft/fast-foundation';
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
Ghost = "ghost",
|
|
9
|
-
Block = "block"
|
|
10
|
-
}
|
|
11
|
-
export declare type ButtonAppearanceAttribute = `${ButtonAppearance}`;
|
|
6
|
+
export type { ButtonAppearanceAttribute } from '../patterns/button/types';
|
|
7
|
+
export { ButtonAppearance } from '../patterns/button/types';
|
|
12
8
|
export declare type ButtonType = Button['type'];
|
package/dist/esm/button/types.js
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
(function (ButtonAppearance) {
|
|
3
|
-
ButtonAppearance["Outline"] = "outline";
|
|
4
|
-
ButtonAppearance["Ghost"] = "ghost";
|
|
5
|
-
ButtonAppearance["Block"] = "block";
|
|
6
|
-
})(ButtonAppearance || (ButtonAppearance = {}));
|
|
1
|
+
export { ButtonAppearance } from '../patterns/button/types';
|
|
7
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/button/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/button/types.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
* @public
|
|
4
4
|
*/
|
|
5
5
|
import type { Button } from '@microsoft/fast-foundation';
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
Ghost = "ghost",
|
|
9
|
-
Block = "block"
|
|
10
|
-
}
|
|
11
|
-
export declare type ButtonAppearanceAttribute = `${ButtonAppearance}`;
|
|
6
|
+
export type { ButtonAppearanceAttribute } from '../patterns/button/types';
|
|
7
|
+
export { ButtonAppearance } from '../patterns/button/types';
|
|
12
8
|
export declare type ButtonType = Button['type'];
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Switch as FoundationSwitch } from '@microsoft/fast-foundation';
|
|
2
|
+
import { ButtonAppearance } from '../patterns/button/types';
|
|
3
|
+
export type { ToggleButton };
|
|
4
|
+
declare global {
|
|
5
|
+
interface HTMLElementTagNameMap {
|
|
6
|
+
'nimble-toggle-button': ToggleButton;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A nimble-styled toggle button control.
|
|
11
|
+
*/
|
|
12
|
+
declare class ToggleButton extends FoundationSwitch {
|
|
13
|
+
/**
|
|
14
|
+
* The appearance the button should have.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
* @remarks
|
|
18
|
+
* HTML Attribute: appearance
|
|
19
|
+
*/
|
|
20
|
+
appearance: ButtonAppearance;
|
|
21
|
+
/**
|
|
22
|
+
* Specify as 'true' to hide the text content of the button. The button will
|
|
23
|
+
* become square, and the text content will be used as the label of the button
|
|
24
|
+
* for accessibility purposes.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
* @remarks
|
|
28
|
+
* HTML Attribute: content-hidden
|
|
29
|
+
*/
|
|
30
|
+
contentHidden: boolean;
|
|
31
|
+
readonly control: HTMLElement;
|
|
32
|
+
connectedCallback(): void;
|
|
33
|
+
}
|
|
File without changes
|
package/dist/esm/{button/behaviors.d.ts → nimble-components/src/utilities/style/appearance.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Behavior, ElementStyles } from '@microsoft/fast-element';
|
|
2
|
-
import type { ButtonAppearance } from '
|
|
2
|
+
import type { ButtonAppearance } from '../../patterns/button/types';
|
|
3
3
|
/**
|
|
4
4
|
* Behavior that will conditionally apply a stylesheet based on the element's
|
|
5
5
|
* appearance property
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@microsoft/fast-element").ElementStyles;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { display } from '@microsoft/fast-foundation';
|
|
3
|
-
import { focusVisible } from '
|
|
4
|
-
import { actionColorRgbPartial, borderColorHover, borderColorRgbPartial, borderWidth, buttonContentFontColor, contentFontColorDisabled, contentFontSize, controlHeight, fillColorSelected, fontFamily, iconColor, smallDelay, standardPadding } from '
|
|
5
|
-
import { appearanceBehavior } from '
|
|
3
|
+
import { focusVisible } from '../../utilities/style/focus';
|
|
4
|
+
import { actionColorRgbPartial, borderColorHover, borderColorRgbPartial, borderWidth, buttonContentFontColor, contentFontColorDisabled, contentFontSize, controlHeight, fillColorSelected, fontFamily, iconColor, smallDelay, standardPadding } from '../../theme-provider/design-tokens';
|
|
5
|
+
import { appearanceBehavior } from '../../utilities/style/appearance';
|
|
6
6
|
import { ButtonAppearance } from './types';
|
|
7
7
|
export const styles = css `
|
|
8
8
|
${display('inline-flex')}
|
|
@@ -113,7 +113,7 @@ export const styles = css `
|
|
|
113
113
|
.withBehaviors(appearanceBehavior(ButtonAppearance.Outline, css `
|
|
114
114
|
.control {
|
|
115
115
|
background-color: transparent;
|
|
116
|
-
border-color: rgba(${actionColorRgbPartial}, 0.
|
|
116
|
+
border-color: rgba(${actionColorRgbPartial}, 0.3);
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
.control:hover {
|
|
@@ -128,7 +128,7 @@ export const styles = css `
|
|
|
128
128
|
|
|
129
129
|
.control:active {
|
|
130
130
|
background-color: ${fillColorSelected};
|
|
131
|
-
border-color:
|
|
131
|
+
border-color: ${fillColorSelected};
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
.control[disabled] {
|
|
@@ -153,7 +153,7 @@ export const styles = css `
|
|
|
153
153
|
|
|
154
154
|
.control:active {
|
|
155
155
|
background-color: ${fillColorSelected};
|
|
156
|
-
border-color:
|
|
156
|
+
border-color: ${fillColorSelected};
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
.control[disabled] {
|
|
@@ -178,12 +178,12 @@ export const styles = css `
|
|
|
178
178
|
|
|
179
179
|
.control:active {
|
|
180
180
|
background-color: ${fillColorSelected};
|
|
181
|
-
border-color:
|
|
181
|
+
border-color: ${fillColorSelected};
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
.control[disabled] {
|
|
185
185
|
background-color: rgba(${borderColorRgbPartial}, 0.1);
|
|
186
|
-
border-color:
|
|
186
|
+
border-color: transparent;
|
|
187
187
|
}
|
|
188
188
|
`));
|
|
189
189
|
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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,CACJ,EACD,kBAAkB,CACd,gBAAgB,CAAC,KAAK,EACtB,GAAG,CAAA;;;;;;;;oCAQqB,gBAAgB;;;0BAG1B,YAAY;;oCAEF,gBAAgB;;;;wCAIZ,iBAAiB;oCACrB,iBAAiB;;;;;;;aAOxC,CACJ,EACD,kBAAkB,CACd,gBAAgB,CAAC,KAAK,EACtB,GAAG,CAAA;;6CAE8B,qBAAqB;;;;;6CAKrB,qBAAqB;oCAC9B,gBAAgB;;;0BAG1B,YAAY;6CACO,qBAAqB;oCAC9B,gBAAgB;;;;wCAIZ,iBAAiB;oCACrB,iBAAiB;;;;6CAIR,qBAAqB;;;aAGrD,CACJ,CACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types of button appearance.
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export var ButtonAppearance;
|
|
6
|
+
(function (ButtonAppearance) {
|
|
7
|
+
ButtonAppearance["Outline"] = "outline";
|
|
8
|
+
ButtonAppearance["Ghost"] = "ghost";
|
|
9
|
+
ButtonAppearance["Block"] = "block";
|
|
10
|
+
})(ButtonAppearance || (ButtonAppearance = {}));
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/patterns/button/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IACxB,uCAAmB,CAAA;IACnB,mCAAe,CAAA;IACf,mCAAe,CAAA;AACnB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Switch as FoundationSwitch } from '@microsoft/fast-foundation';
|
|
2
|
+
import { ButtonAppearance } from '../patterns/button/types';
|
|
3
|
+
export type { ToggleButton };
|
|
4
|
+
declare global {
|
|
5
|
+
interface HTMLElementTagNameMap {
|
|
6
|
+
'nimble-toggle-button': ToggleButton;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A nimble-styled toggle button control.
|
|
11
|
+
*/
|
|
12
|
+
declare class ToggleButton extends FoundationSwitch {
|
|
13
|
+
/**
|
|
14
|
+
* The appearance the button should have.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
* @remarks
|
|
18
|
+
* HTML Attribute: appearance
|
|
19
|
+
*/
|
|
20
|
+
appearance: ButtonAppearance;
|
|
21
|
+
/**
|
|
22
|
+
* Specify as 'true' to hide the text content of the button. The button will
|
|
23
|
+
* become square, and the text content will be used as the label of the button
|
|
24
|
+
* for accessibility purposes.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
* @remarks
|
|
28
|
+
* HTML Attribute: content-hidden
|
|
29
|
+
*/
|
|
30
|
+
contentHidden: boolean;
|
|
31
|
+
readonly control: HTMLElement;
|
|
32
|
+
connectedCallback(): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr } from '@microsoft/fast-element';
|
|
3
|
+
import { DesignSystem, Switch as FoundationSwitch } from '@microsoft/fast-foundation';
|
|
4
|
+
import { styles } from './styles';
|
|
5
|
+
import { template } from './template';
|
|
6
|
+
import { ButtonAppearance } from '../patterns/button/types';
|
|
7
|
+
/**
|
|
8
|
+
* A nimble-styled toggle button control.
|
|
9
|
+
*/
|
|
10
|
+
class ToggleButton extends FoundationSwitch {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/**
|
|
14
|
+
* Specify as 'true' to hide the text content of the button. The button will
|
|
15
|
+
* become square, and the text content will be used as the label of the button
|
|
16
|
+
* for accessibility purposes.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
* @remarks
|
|
20
|
+
* HTML Attribute: content-hidden
|
|
21
|
+
*/
|
|
22
|
+
this.contentHidden = false;
|
|
23
|
+
}
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
super.connectedCallback();
|
|
26
|
+
if (!this.appearance) {
|
|
27
|
+
this.appearance = ButtonAppearance.Outline;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
__decorate([
|
|
32
|
+
attr
|
|
33
|
+
], ToggleButton.prototype, "appearance", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
attr({ attribute: 'content-hidden', mode: 'boolean' })
|
|
36
|
+
], ToggleButton.prototype, "contentHidden", void 0);
|
|
37
|
+
const nimbleToggleButton = ToggleButton.compose({
|
|
38
|
+
baseName: 'toggle-button',
|
|
39
|
+
template,
|
|
40
|
+
styles
|
|
41
|
+
});
|
|
42
|
+
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleToggleButton());
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/toggle-button/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EACH,YAAY,EACZ,MAAM,IAAI,gBAAgB,EAE7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAU5D;;GAEG;AACH,MAAM,YAAa,SAAQ,gBAAgB;IAA3C;;QAWI;;;;;;;;WAQG;QAEI,kBAAa,GAAG,KAAK,CAAC;IAUjC,CAAC;IANU,iBAAiB;QACpB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC;SAC9C;IACL,CAAC;CACJ;AAtBG;IADC,IAAI;gDACgC;AAYrC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;mDAC1B;AAYjC,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,CAAgB;IAC3D,QAAQ,EAAE,eAAe;IACzB,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@microsoft/fast-element").ElementStyles;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
import { focusVisible } from '../utilities/style/focus';
|
|
3
|
+
import { fillColorSelected } from '../theme-provider/design-tokens';
|
|
4
|
+
import { styles as buttonStyles } from '../patterns/button/styles';
|
|
5
|
+
export const styles = css `
|
|
6
|
+
${buttonStyles}
|
|
7
|
+
|
|
8
|
+
.control[aria-pressed='true'] {
|
|
9
|
+
background-color: ${fillColorSelected};
|
|
10
|
+
border-color: ${fillColorSelected};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.control[aria-pressed='true']:hover {
|
|
14
|
+
background-color: ${fillColorSelected};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.control[aria-pressed='true']${focusVisible} {
|
|
18
|
+
background-color: ${fillColorSelected};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.control[aria-pressed='true'][disabled] {
|
|
22
|
+
background-color: ${fillColorSelected};
|
|
23
|
+
border-color: ${fillColorSelected};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.control[aria-pressed='true'][disabled]:hover {
|
|
27
|
+
background-color: ${fillColorSelected};
|
|
28
|
+
border-color: ${fillColorSelected};
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/toggle-button/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,YAAY;;;4BAGU,iBAAiB;wBACrB,iBAAiB;;;;4BAIb,iBAAiB;;;mCAGV,YAAY;4BACnB,iBAAiB;;;;4BAIjB,iBAAiB;wBACrB,iBAAiB;;;;4BAIb,iBAAiB;wBACrB,iBAAiB;;CAExC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { html, ref } from '@microsoft/fast-element';
|
|
2
|
+
export const template = html `
|
|
3
|
+
<div
|
|
4
|
+
role="button"
|
|
5
|
+
part="control"
|
|
6
|
+
aria-pressed="${(x) => x.checked}"
|
|
7
|
+
aria-disabled="${(x) => x.disabled}"
|
|
8
|
+
aria-readonly="${(x) => x.readOnly}"
|
|
9
|
+
aria-labelledby="nimble-toggle-button-content"
|
|
10
|
+
tabindex="${(x) => (x.disabled ? null : 0)}"
|
|
11
|
+
@keypress="${(x, c) => x.keypressHandler(c.event)}"
|
|
12
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
13
|
+
class="control ${(x) => (x.checked ? 'checked' : '')}"
|
|
14
|
+
?disabled="${x => x.disabled}"
|
|
15
|
+
${ref('control')}
|
|
16
|
+
>
|
|
17
|
+
<span part="start" class="start">
|
|
18
|
+
<slot name="start"></slot>
|
|
19
|
+
</span>
|
|
20
|
+
<span class="content" part="content" id="nimble-toggle-button-content">
|
|
21
|
+
<slot></slot>
|
|
22
|
+
</span>
|
|
23
|
+
</div>
|
|
24
|
+
`;
|
|
25
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/toggle-button/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAGpD,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAc;;;;wBAIlB,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO;yBAC7B,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ;yBAC/B,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ;;oBAEpC,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;qBAC3C,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,KAAsB,CAAC;kBACxD,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAmB,CAAC;yBACxC,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;qBACrD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;UAC1B,GAAG,CAAC,SAAS,CAAC;;;;;;;;;CASvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/toggle-button/types.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/esm/{nimble-components/src/button/behaviors.d.ts → utilities/style/appearance.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Behavior, ElementStyles } from '@microsoft/fast-element';
|
|
2
|
-
import type { ButtonAppearance } from '
|
|
2
|
+
import type { ButtonAppearance } from '../../patterns/button/types';
|
|
3
3
|
/**
|
|
4
4
|
* Behavior that will conditionally apply a stylesheet based on the element's
|
|
5
5
|
* appearance property
|
|
@@ -11,4 +11,4 @@ import { PropertyStyleSheetBehavior } from '@microsoft/fast-foundation';
|
|
|
11
11
|
export function appearanceBehavior(value, styles) {
|
|
12
12
|
return new PropertyStyleSheetBehavior('appearance', value, styles);
|
|
13
13
|
}
|
|
14
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=appearance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appearance.js","sourceRoot":"","sources":["../../../../src/utilities/style/appearance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAIxE;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAC9B,KAAuB,EACvB,MAAqB;IAErB,OAAO,IAAI,0BAA0B,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACvE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"behaviors.js","sourceRoot":"","sources":["../../../src/button/behaviors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAIxE;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAC9B,KAAuB,EACvB,MAAqB;IAErB,OAAO,IAAI,0BAA0B,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/button/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,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