@fluentui/web-components 3.0.0-alpha.12 → 3.0.0-alpha.13
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.json +22 -1
- package/CHANGELOG.md +12 -2
- package/dist/dts/button/button.d.ts +55 -0
- package/dist/dts/button/button.definition.d.ts +10 -0
- package/dist/dts/button/button.options.d.ts +46 -0
- package/dist/dts/button/button.styles.d.ts +1 -0
- package/dist/dts/button/button.template.d.ts +7 -0
- package/dist/dts/button/define.d.ts +1 -0
- package/dist/dts/button/index.d.ts +5 -0
- package/dist/dts/index.d.ts +1 -0
- package/dist/esm/button/button.definition.js +21 -0
- package/dist/esm/button/button.definition.js.map +1 -0
- package/dist/esm/button/button.js +72 -0
- package/dist/esm/button/button.js.map +1 -0
- package/dist/esm/button/button.options.js +30 -0
- package/dist/esm/button/button.options.js.map +1 -0
- package/dist/esm/button/button.styles.js +253 -0
- package/dist/esm/button/button.styles.js.map +1 -0
- package/dist/esm/button/button.template.js +7 -0
- package/dist/esm/button/button.template.js.map +1 -0
- package/dist/esm/button/define.js +4 -0
- package/dist/esm/button/define.js.map +1 -0
- package/dist/esm/button/index.js +6 -0
- package/dist/esm/button/index.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/fluent-web-components.api.json +595 -0
- package/dist/web-components.d.ts +126 -0
- package/dist/web-components.js +361 -20
- package/dist/web-components.min.js +136 -132
- package/docs/api-report.md +60 -0
- package/package.json +7 -3
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,28 @@
|
|
|
2
2
|
"name": "@fluentui/web-components",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 31 Mar 2023 04:19:36 GMT",
|
|
6
|
+
"tag": "@fluentui/web-components_v3.0.0-alpha.13",
|
|
7
|
+
"version": "3.0.0-alpha.13",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "chhol@microsoft.com",
|
|
12
|
+
"package": "@fluentui/web-components",
|
|
13
|
+
"commit": "7f5a5e507a3902a9703d5198a13cc96335c82eaa",
|
|
14
|
+
"comment": "update fast-element and fast-foundation dependencies"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "chhol@microsoft.com",
|
|
18
|
+
"package": "@fluentui/web-components",
|
|
19
|
+
"commit": "d901fa95e8f90c1b5dabda8602a72ecb77288f0c",
|
|
20
|
+
"comment": "feat(button): add button web component"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"date": "Tue, 28 Mar 2023 04:20:01 GMT",
|
|
6
27
|
"tag": "@fluentui/web-components_v3.0.0-alpha.12",
|
|
7
28
|
"version": "3.0.0-alpha.12",
|
|
8
29
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
# Change Log - @fluentui/web-components
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 31 Mar 2023 04:19:36 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [3.0.0-alpha.13](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-alpha.13)
|
|
8
|
+
|
|
9
|
+
Fri, 31 Mar 2023 04:19:36 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-alpha.12..@fluentui/web-components_v3.0.0-alpha.13)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- update fast-element and fast-foundation dependencies ([PR #27392](https://github.com/microsoft/fluentui/pull/27392) by chhol@microsoft.com)
|
|
15
|
+
- feat(button): add button web component ([PR #27278](https://github.com/microsoft/fluentui/pull/27278) by chhol@microsoft.com)
|
|
16
|
+
|
|
7
17
|
## [3.0.0-alpha.12](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-alpha.12)
|
|
8
18
|
|
|
9
|
-
Tue, 28 Mar 2023 04:
|
|
19
|
+
Tue, 28 Mar 2023 04:20:01 GMT
|
|
10
20
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-alpha.11..@fluentui/web-components_v3.0.0-alpha.12)
|
|
11
21
|
|
|
12
22
|
### Changes
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { FASTButton } from '@microsoft/fast-foundation';
|
|
2
|
+
import { ButtonAppearance, ButtonShape, ButtonSize } from './button.options.js';
|
|
3
|
+
/**
|
|
4
|
+
* The base class used for constructing a fluent-button custom element
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare class Button extends FASTButton {
|
|
8
|
+
/**
|
|
9
|
+
* The appearance the button should have.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
* @remarks
|
|
13
|
+
* HTML Attribute: appearance
|
|
14
|
+
*/
|
|
15
|
+
appearance?: ButtonAppearance | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The shape the button should have.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
* @remarks
|
|
21
|
+
* HTML Attribute: shape
|
|
22
|
+
*/
|
|
23
|
+
shape?: ButtonShape | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* The size the button should have.
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
* @remarks
|
|
29
|
+
* HTML Attribute: size
|
|
30
|
+
*/
|
|
31
|
+
size?: ButtonSize;
|
|
32
|
+
/**
|
|
33
|
+
* The button has an icon only, no text content
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
* @remarks
|
|
37
|
+
* HTML Attribute: icon-only
|
|
38
|
+
*/
|
|
39
|
+
iconOnly: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* The button is disabled but focusable
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
* @remarks
|
|
45
|
+
* HTML Attribute: disabled-focusable
|
|
46
|
+
*/
|
|
47
|
+
disabledFocusable?: boolean;
|
|
48
|
+
protected disabledFocusableChanged(prev: boolean, next: boolean): void;
|
|
49
|
+
/**
|
|
50
|
+
* Prevents disabledFocusable click events
|
|
51
|
+
*/
|
|
52
|
+
private handleDisabledFocusableClick;
|
|
53
|
+
connectedCallback(): void;
|
|
54
|
+
disconnectedCallback(): void;
|
|
55
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Button } from './button.js';
|
|
2
|
+
/**
|
|
3
|
+
* The Fluent Button Element. Implements {@link @microsoft/fast-foundation#Button },
|
|
4
|
+
* {@link @microsoft/fast-foundation#buttonTemplate}
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
* @remarks
|
|
8
|
+
* HTML Element: \<fluent-button\>
|
|
9
|
+
*/
|
|
10
|
+
export declare const definition: import("@microsoft/fast-element").FASTElementDefinition<typeof Button>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ButtonOptions, ValuesOf } from '@microsoft/fast-foundation';
|
|
2
|
+
/**
|
|
3
|
+
* ButtonAppearance constants
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare const ButtonAppearance: {
|
|
7
|
+
readonly primary: "primary";
|
|
8
|
+
readonly outline: "outline";
|
|
9
|
+
readonly subtle: "subtle";
|
|
10
|
+
readonly secondary: "secondary";
|
|
11
|
+
readonly transparent: "transparent";
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A Button can be secondary, primary, outline, subtle, transparent
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export declare type ButtonAppearance = ValuesOf<typeof ButtonAppearance>;
|
|
18
|
+
/**
|
|
19
|
+
* A Button can be square, circular or rounded.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare const ButtonShape: {
|
|
23
|
+
readonly circular: "circular";
|
|
24
|
+
readonly rounded: "rounded";
|
|
25
|
+
readonly square: "square";
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* A Button can be square, circular or rounded
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export declare type ButtonShape = ValuesOf<typeof ButtonShape>;
|
|
32
|
+
/**
|
|
33
|
+
* A Button can be a size of small, medium or large.
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export declare const ButtonSize: {
|
|
37
|
+
readonly small: "small";
|
|
38
|
+
readonly medium: "medium";
|
|
39
|
+
readonly large: "large";
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* A Button can be on of several preset sizes.
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export declare type ButtonSize = ValuesOf<typeof ButtonSize>;
|
|
46
|
+
export { ButtonOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@microsoft/fast-element").ElementStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './button.js';
|
|
2
|
+
export * from './button.options.js';
|
|
3
|
+
export { template as ButtonTemplate } from './button.template.js';
|
|
4
|
+
export { styles as ButtonStyles } from './button.styles.js';
|
|
5
|
+
export { definition as ButtonDefinition } from './button.definition.js';
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './accordion/index.js';
|
|
|
2
2
|
export * from './accordion-item/index.js';
|
|
3
3
|
export * from './avatar/index.js';
|
|
4
4
|
export * from './badge/index.js';
|
|
5
|
+
export * from './button/index.js';
|
|
5
6
|
export * from './counter-badge/index.js';
|
|
6
7
|
export * from './divider/index.js';
|
|
7
8
|
export * from './image/index.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FluentDesignSystem } from '../fluent-design-system.js';
|
|
2
|
+
import { Button } from './button.js';
|
|
3
|
+
import { styles } from './button.styles.js';
|
|
4
|
+
import { template } from './button.template.js';
|
|
5
|
+
/**
|
|
6
|
+
* The Fluent Button Element. Implements {@link @microsoft/fast-foundation#Button },
|
|
7
|
+
* {@link @microsoft/fast-foundation#buttonTemplate}
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
* @remarks
|
|
11
|
+
* HTML Element: \<fluent-button\>
|
|
12
|
+
*/
|
|
13
|
+
export const definition = Button.compose({
|
|
14
|
+
name: `${FluentDesignSystem.prefix}-button`,
|
|
15
|
+
template,
|
|
16
|
+
styles,
|
|
17
|
+
shadowOptions: {
|
|
18
|
+
delegatesFocus: true,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=button.definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.definition.js","sourceRoot":"","sources":["../../../src/button/button.definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC;IACvC,IAAI,EAAE,GAAG,kBAAkB,CAAC,MAAM,SAAS;IAC3C,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACb,cAAc,EAAE,IAAI;KACrB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr } from '@microsoft/fast-element';
|
|
3
|
+
import { FASTButton } from '@microsoft/fast-foundation';
|
|
4
|
+
/**
|
|
5
|
+
* The base class used for constructing a fluent-button custom element
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export class Button extends FASTButton {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
/**
|
|
12
|
+
* The button has an icon only, no text content
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
* @remarks
|
|
16
|
+
* HTML Attribute: icon-only
|
|
17
|
+
*/
|
|
18
|
+
this.iconOnly = false;
|
|
19
|
+
/**
|
|
20
|
+
* The button is disabled but focusable
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
* @remarks
|
|
24
|
+
* HTML Attribute: disabled-focusable
|
|
25
|
+
*/
|
|
26
|
+
this.disabledFocusable = false;
|
|
27
|
+
/**
|
|
28
|
+
* Prevents disabledFocusable click events
|
|
29
|
+
*/
|
|
30
|
+
this.handleDisabledFocusableClick = (e) => {
|
|
31
|
+
if (e && this.disabledFocusable) {
|
|
32
|
+
e.stopImmediatePropagation();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
disabledFocusableChanged(prev, next) {
|
|
38
|
+
if (!this.$fastController.isConnected) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (this.disabledFocusable) {
|
|
42
|
+
this.setAttribute('aria-disabled', 'true');
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.removeAttribute('aria-disabled');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
connectedCallback() {
|
|
49
|
+
super.connectedCallback();
|
|
50
|
+
this.addEventListener('click', this.handleDisabledFocusableClick);
|
|
51
|
+
}
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
super.disconnectedCallback();
|
|
54
|
+
this.removeEventListener('click', this.handleDisabledFocusableClick);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
__decorate([
|
|
58
|
+
attr
|
|
59
|
+
], Button.prototype, "appearance", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
attr
|
|
62
|
+
], Button.prototype, "shape", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
attr
|
|
65
|
+
], Button.prototype, "size", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
attr({ attribute: 'icon-only', mode: 'boolean' })
|
|
68
|
+
], Button.prototype, "iconOnly", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
attr({ attribute: 'disabled-focusable', mode: 'boolean' })
|
|
71
|
+
], Button.prototype, "disabledFocusable", void 0);
|
|
72
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +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,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGxD;;;GAGG;AACH,MAAM,OAAO,MAAO,SAAQ,UAAU;IAAtC;;QA+BE;;;;;;WAMG;QAEI,aAAQ,GAAY,KAAK,CAAC;QAEjC;;;;;;WAMG;QAEI,sBAAiB,GAAa,KAAK,CAAC;QAa3C;;WAEG;QACK,iCAA4B,GAAG,CAAC,CAAa,EAAQ,EAAE;YAC7D,IAAI,CAAC,IAAI,IAAI,CAAC,iBAAiB,EAAE;gBAC/B,CAAC,CAAC,wBAAwB,EAAE,CAAC;gBAC7B,OAAO;aACR;QACH,CAAC,CAAC;IAaJ,CAAC;IAjCW,wBAAwB,CAAC,IAAa,EAAE,IAAa;QAC7D,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE;YACrC,OAAO;SACR;QAED,IAAI,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAgC,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;SAC1E;aAAM;YACH,IAAgC,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC;SACrE;IACH,CAAC;IAYM,iBAAiB;QACtB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAExB,IAAgC,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,4BAA4B,CAAC,CAAC;IAClG,CAAC;IAEM,oBAAoB;QACzB,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAE3B,IAAgC,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,4BAA4B,CAAC,CAAC;IACrG,CAAC;CACF;AA1EC;IADC,IAAI;0CAC4C;AAUjD;IADC,IAAI;qCACkC;AAUvC;IADC,IAAI;oCACoB;AAUzB;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;wCACjB;AAUjC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;iDAChB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ButtonAppearance constants
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export const ButtonAppearance = {
|
|
6
|
+
primary: 'primary',
|
|
7
|
+
outline: 'outline',
|
|
8
|
+
subtle: 'subtle',
|
|
9
|
+
secondary: 'secondary',
|
|
10
|
+
transparent: 'transparent',
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A Button can be square, circular or rounded.
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export const ButtonShape = {
|
|
17
|
+
circular: 'circular',
|
|
18
|
+
rounded: 'rounded',
|
|
19
|
+
square: 'square',
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A Button can be a size of small, medium or large.
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export const ButtonSize = {
|
|
26
|
+
small: 'small',
|
|
27
|
+
medium: 'medium',
|
|
28
|
+
large: 'large',
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=button.options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.options.js","sourceRoot":"","sources":["../../../src/button/button.options.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;CAClB,CAAC;AAQX;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACR,CAAC;AAQX;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;CACN,CAAC"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
import { display } from '@microsoft/fast-foundation';
|
|
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
|
+
// Need to support icon hover styles
|
|
5
|
+
export const styles = css `
|
|
6
|
+
${display('inline-flex')}
|
|
7
|
+
|
|
8
|
+
:host {
|
|
9
|
+
--icon-spacing: ${spacingHorizontalSNudge};
|
|
10
|
+
contain: layout style;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host .control {
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
text-decoration-line: none;
|
|
19
|
+
margin: 0;
|
|
20
|
+
min-height: 32px;
|
|
21
|
+
outline-style: none;
|
|
22
|
+
background-color: ${colorNeutralBackground1};
|
|
23
|
+
color: ${colorNeutralForeground1};
|
|
24
|
+
border: ${strokeWidthThin} solid ${colorNeutralStroke1};
|
|
25
|
+
padding: 0 ${spacingHorizontalM};
|
|
26
|
+
min-width: 96px;
|
|
27
|
+
border-radius: ${borderRadiusMedium};
|
|
28
|
+
font-size: ${fontSizeBase300};
|
|
29
|
+
font-family: ${fontFamilyBase};
|
|
30
|
+
font-weight: ${fontWeightSemibold};
|
|
31
|
+
line-height: ${lineHeightBase300};
|
|
32
|
+
transition-duration: ${durationFaster};
|
|
33
|
+
transition-property: background, border, color;
|
|
34
|
+
transition-timing-function: ${curveEasyEase};
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.content {
|
|
39
|
+
display: inherit;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host(:hover) .control {
|
|
43
|
+
background-color: ${colorNeutralBackground1Hover};
|
|
44
|
+
color: ${colorNeutralForeground1Hover};
|
|
45
|
+
border-color: ${colorNeutralStroke1Hover};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:host(:hover:active) .control {
|
|
49
|
+
background-color: ${colorNeutralBackground1Pressed};
|
|
50
|
+
border-color: ${colorNeutralStroke1Pressed};
|
|
51
|
+
color: ${colorNeutralForeground1Pressed};
|
|
52
|
+
outline-style: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:host .control:focus-visible {
|
|
56
|
+
border-color: ${colorTransparentStroke};
|
|
57
|
+
outline: ${strokeWidthThick} solid ${colorTransparentStroke};
|
|
58
|
+
box-shadow: ${shadow4}, 0 0 0 2px ${colorStrokeFocus2};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
62
|
+
transition-duration: 0.01ms;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
::slotted(svg) {
|
|
66
|
+
font-size: 20px;
|
|
67
|
+
height: 20px;
|
|
68
|
+
width: 20px;
|
|
69
|
+
fill: currentColor;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
::slotted([slot='start']) {
|
|
73
|
+
margin-inline-end: var(--icon-spacing);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
::slotted([slot='end']) {
|
|
77
|
+
margin-inline-start: var(--icon-spacing);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:host([icon-only]) .control {
|
|
81
|
+
min-width: 32px;
|
|
82
|
+
max-width: 32px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host([size='small']) {
|
|
86
|
+
--icon-spacing: ${spacingHorizontalXS};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host([size='small']) .control {
|
|
90
|
+
min-height: 24px;
|
|
91
|
+
min-width: 64px;
|
|
92
|
+
padding: 0 ${spacingHorizontalS};
|
|
93
|
+
border-radius: ${borderRadiusSmall};
|
|
94
|
+
font-size: ${fontSizeBase200};
|
|
95
|
+
line-height: ${lineHeightBase200};
|
|
96
|
+
font-weight: ${fontWeightRegular};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([size='small'][icon-only]) .control {
|
|
100
|
+
min-width: 24px;
|
|
101
|
+
max-width: 24px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host([size='large']) .control {
|
|
105
|
+
min-height: 40px;
|
|
106
|
+
border-radius: ${borderRadiusLarge};
|
|
107
|
+
padding: 0 ${spacingHorizontalL};
|
|
108
|
+
font-size: ${fontSizeBase400};
|
|
109
|
+
line-height: ${lineHeightBase400};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:host([size='large'][icon-only]) .control {
|
|
113
|
+
min-width: 40px;
|
|
114
|
+
max-width: 40px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:host([size='large']) ::slotted(svg) {
|
|
118
|
+
font-size: 24px;
|
|
119
|
+
height: 24px;
|
|
120
|
+
width: 24px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:host([shape='circular']) .control,
|
|
124
|
+
:host([shape='circular']) .control:focus-visible {
|
|
125
|
+
border-radius: ${borderRadiusCircular};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host([shape='square']) .control,
|
|
129
|
+
:host([shape='square']) .control:focus-visible {
|
|
130
|
+
border-radius: ${borderRadiusNone};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host([appearance='primary']) .control {
|
|
134
|
+
background-color: ${colorBrandBackground};
|
|
135
|
+
color: ${colorNeutralForegroundOnBrand};
|
|
136
|
+
border-color: transparent;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:host([appearance='primary']:hover) .control {
|
|
140
|
+
background-color: ${colorBrandBackgroundHover};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:host([appearance='primary']:hover) .control,
|
|
144
|
+
:host([appearance='primary']:hover:active) .control {
|
|
145
|
+
border-color: transparent;
|
|
146
|
+
color: ${colorNeutralForegroundOnBrand};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
:host([appearance='primary']:hover:active) .control {
|
|
150
|
+
background-color: ${colorBrandBackgroundPressed};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:host([appearance='primary']) .control:focus-visible {
|
|
154
|
+
border-color: ${colorNeutralForegroundOnBrand};
|
|
155
|
+
box-shadow: ${shadow2}, 0 0 0 2px ${colorStrokeFocus2};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
:host(is:([disabled][appearance='primary'], [disabled-focusabale][appearance="primary"])) .control,
|
|
159
|
+
:host(is:([disabled][appearance='primary'], [disabled-focusabale][appearance="primary"]):hover) .control,
|
|
160
|
+
:host(is:([disabled][appearance='primary'], [disabled-focusabale][appearance="primary"]):hover:active) .control {
|
|
161
|
+
border-color: transparent;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:host([appearance='outline']) .control {
|
|
165
|
+
background-color: ${colorTransparentBackground};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:host([appearance='outline']:hover) .control {
|
|
169
|
+
background-color: ${colorTransparentBackgroundHover};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
:host([appearance='outline']:hover:active) .control {
|
|
173
|
+
background-color: ${colorTransparentBackgroundPressed};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:host(is:([disabled][appearance='outline'], [disabled-focusabale][appearance="outline"])) .control,
|
|
177
|
+
:host(is:([disabled][appearance='outline'], [disabled-focusabale][appearance="outline"]):hover) .control,
|
|
178
|
+
:host(is:([disabled][appearance='outline'], [disabled-focusabale][appearance="outline"]):hover:active) .control {
|
|
179
|
+
background-color: ${colorTransparentBackground};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
:host([appearance='subtle']) .control {
|
|
183
|
+
background-color: ${colorSubtleBackground};
|
|
184
|
+
color: ${colorNeutralForeground2};
|
|
185
|
+
border-color: transparent;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
:host([appearance='subtle']:hover) .control {
|
|
189
|
+
background-color: ${colorSubtleBackgroundHover};
|
|
190
|
+
color: ${colorNeutralForeground2Hover};
|
|
191
|
+
border-color: transparent;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
:host([appearance='subtle']:hover:active) .control {
|
|
195
|
+
background-color: ${colorSubtleBackgroundPressed};
|
|
196
|
+
color: ${colorNeutralForeground2Pressed};
|
|
197
|
+
border-color: transparent;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
:host(is:([disabled][appearance='subtle'], [disabled-focusabale][appearance="subtle"])) .control,
|
|
201
|
+
:host(is:([disabled][appearance='subtle'], [disabled-focusabale][appearance="subtle"]):hover) .control,
|
|
202
|
+
:host(is:([disabled][appearance='subtle'], [disabled-focusabale][appearance="subtle"]):hover:active) .control {
|
|
203
|
+
background-color: ${colorTransparentBackground};
|
|
204
|
+
border-color: transparent;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
:host([appearance='subtle']:hover) ::slotted(svg) {
|
|
208
|
+
fill: ${colorNeutralForeground2BrandHover};
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
:host([appearance='subtle']:hover:active) ::slotted(svg) {
|
|
212
|
+
fill: ${colorNeutralForeground2BrandPressed};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
:host([appearance='transparent']) .control {
|
|
216
|
+
background-color: ${colorTransparentBackground};
|
|
217
|
+
color: ${colorNeutralForeground2};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:host([appearance='transparent']:hover) .control {
|
|
221
|
+
background-color: ${colorTransparentBackgroundHover};
|
|
222
|
+
color: ${colorNeutralForeground2BrandHover};
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
:host([appearance='transparent']:hover:active) .control {
|
|
226
|
+
background-color: ${colorTransparentBackgroundPressed};
|
|
227
|
+
color: ${colorNeutralForeground2BrandPressed};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
:host([appearance='transparent']) .control,
|
|
231
|
+
:host([appearance='transparent']:hover) .control,
|
|
232
|
+
:host([appearance='transparent']:hover:active) .control {
|
|
233
|
+
border-color: transparent;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
:host(is:([disabled][appearance='transparent'], [disabled-focusabale][appearance="transparent"])) .control,
|
|
237
|
+
:host(is:([disabled][appearance='transparent'], [disabled-focusabale][appearance="transparent"]):hover) .control,
|
|
238
|
+
:host(is:([disabled][appearance='transparent'], [disabled-focusabale][appearance="transparent"]):hover:active) .control {
|
|
239
|
+
border-color: transparent;
|
|
240
|
+
background-color: ${colorTransparentBackground};
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
:host(:is([disabled], [disabled-focusable], [appearance][disabled], [appearance][disabled-focusable])) .control,
|
|
244
|
+
:host(:is([disabled], [disabled-focusable], [appearance][disabled], [appearance][disabled-focusable]):hover) .control,
|
|
245
|
+
:host(:is([disabled], [disabled-focusable], [appearance][disabled], [appearance][disabled-focusable]):hover:active)
|
|
246
|
+
.control {
|
|
247
|
+
background-color: ${colorNeutralBackgroundDisabled};
|
|
248
|
+
border-color: ${colorNeutralStrokeDisabled};
|
|
249
|
+
color: ${colorNeutralForegroundDisabled};
|
|
250
|
+
cursor: not-allowed;
|
|
251
|
+
}
|
|
252
|
+
`;
|
|
253
|
+
//# sourceMappingURL=button.styles.js.map
|
|
@@ -0,0 +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,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,uBAAuB,EACvB,iCAAiC,EACjC,mCAAmC,EACnC,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,EACjC,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAEnC,oCAAoC;AACpC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,OAAO,CAAC,aAAa,CAAC;;;sBAGJ,uBAAuB;;;;;;;;;;;;;wBAarB,uBAAuB;aAClC,uBAAuB;cACtB,eAAe,UAAU,mBAAmB;iBACzC,kBAAkB;;qBAEd,kBAAkB;iBACtB,eAAe;mBACb,cAAc;mBACd,kBAAkB;mBAClB,iBAAiB;2BACT,cAAc;;kCAEP,aAAa;;;;;;;;;wBASvB,4BAA4B;aACvC,4BAA4B;oBACrB,wBAAwB;;;;wBAIpB,8BAA8B;oBAClC,0BAA0B;aACjC,8BAA8B;;;;;oBAKvB,sBAAsB;eAC3B,gBAAgB,UAAU,sBAAsB;kBAC7C,OAAO,eAAe,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA4BnC,mBAAmB;;;;;;iBAMxB,kBAAkB;qBACd,iBAAiB;iBACrB,eAAe;mBACb,iBAAiB;mBACjB,iBAAiB;;;;;;;;;;qBAUf,iBAAiB;iBACrB,kBAAkB;iBAClB,eAAe;mBACb,iBAAiB;;;;;;;;;;;;;;;;qBAgBf,oBAAoB;;;;;qBAKpB,gBAAgB;;;;wBAIb,oBAAoB;aAC/B,6BAA6B;;;;;wBAKlB,yBAAyB;;;;;;aAMpC,6BAA6B;;;;wBAIlB,2BAA2B;;;;oBAI/B,6BAA6B;kBAC/B,OAAO,eAAe,iBAAiB;;;;;;;;;;wBAUjC,0BAA0B;;;;wBAI1B,+BAA+B;;;;wBAI/B,iCAAiC;;;;;;wBAMjC,0BAA0B;;;;wBAI1B,qBAAqB;aAChC,uBAAuB;;;;;wBAKZ,0BAA0B;aACrC,4BAA4B;;;;;wBAKjB,4BAA4B;aACvC,8BAA8B;;;;;;;wBAOnB,0BAA0B;;;;;YAKtC,iCAAiC;;;;YAIjC,mCAAmC;;;;wBAIvB,0BAA0B;aACrC,uBAAuB;;;;wBAIZ,+BAA+B;aAC1C,iCAAiC;;;;wBAItB,iCAAiC;aAC5C,mCAAmC;;;;;;;;;;;;;wBAaxB,0BAA0B;;;;;;;wBAO1B,8BAA8B;oBAClC,0BAA0B;aACjC,8BAA8B;;;CAG1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.template.js","sourceRoot":"","sources":["../../../src/button/button.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG5D;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAgC,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.js","sourceRoot":"","sources":["../../../src/button/define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,UAAU,CAAC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './button.js';
|
|
2
|
+
export * from './button.options.js';
|
|
3
|
+
export { template as ButtonTemplate } from './button.template.js';
|
|
4
|
+
export { styles as ButtonStyles } from './button.styles.js';
|
|
5
|
+
export { definition as ButtonDefinition } from './button.definition.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from './accordion/index.js';
|
|
|
2
2
|
export * from './accordion-item/index.js';
|
|
3
3
|
export * from './avatar/index.js';
|
|
4
4
|
export * from './badge/index.js';
|
|
5
|
+
export * from './button/index.js';
|
|
5
6
|
export * from './counter-badge/index.js';
|
|
6
7
|
export * from './divider/index.js';
|
|
7
8
|
export * from './image/index.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,kBAAkB,CAAC"}
|