@fluentui/web-components 3.0.0-alpha.2 → 3.0.0-alpha.3

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.
@@ -1,5 +1,6 @@
1
1
  export * from './badge/index.js';
2
2
  export * from './counter-badge/index.js';
3
3
  export * from './progress-bar/index.js';
4
+ export * from './spinner/index.js';
4
5
  export * from './text/index.js';
5
6
  export * from './theme/index.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from './spinner.js';
2
+ export * from './spinner.options.js';
3
+ export { template as SpinnerTemplate } from './spinner.template.js';
4
+ export { styles as SpinnerStyles } from './spinner.styles.js';
5
+ export { definition as SpinnerDefinition } from './spinner.definition.js';
@@ -0,0 +1,25 @@
1
+ import { FASTProgressRing } from '@microsoft/fast-foundation';
2
+ import type { SpinnerAppearance, SpinnerSize } from './spinner.options.js';
3
+ /**
4
+ * The base class used for constructing a fluent-spinner custom element
5
+ * @public
6
+ */
7
+ export declare class Spinner extends FASTProgressRing {
8
+ /**
9
+ * The size of the spinner
10
+ *
11
+ * @public
12
+ * @default 'medium'
13
+ * @remarks
14
+ * HTML Attribute: size
15
+ */
16
+ size: SpinnerSize;
17
+ /**
18
+ * The appearance of the spinner
19
+ * @public
20
+ * @default 'primary'
21
+ * @remarks
22
+ * HTML Attribute: appearance
23
+ */
24
+ appearance: SpinnerAppearance;
25
+ }
@@ -0,0 +1,11 @@
1
+ import { Spinner } from './spinner.js';
2
+ /**
3
+ * The Fluent Spinner Element. Implements {@link @microsoft/fast-foundation#ProgressRing },
4
+ * {@link @microsoft/fast-foundation#progress-ringTemplate}
5
+ *
6
+ *
7
+ * @public
8
+ * @remarks
9
+ * HTML Element: \<fluent-spinner\>
10
+ */
11
+ export declare const definition: import("@microsoft/fast-element").FASTElementDefinition<typeof Spinner>;
@@ -0,0 +1,32 @@
1
+ import { ValuesOf } from '@microsoft/fast-foundation';
2
+ /**
3
+ * SpinnerAppearance constants
4
+ * @public
5
+ */
6
+ export declare const SpinnerAppearance: {
7
+ readonly primary: "primary";
8
+ readonly inverted: "inverted";
9
+ };
10
+ /**
11
+ * A Spinner's appearance can be either primary or inverted
12
+ * @public
13
+ */
14
+ export declare type SpinnerAppearance = ValuesOf<typeof SpinnerAppearance>;
15
+ /**
16
+ * SpinnerSize constants
17
+ * @public
18
+ */
19
+ export declare const SpinnerSize: {
20
+ readonly tiny: "tiny";
21
+ readonly extraSmall: "extra-small";
22
+ readonly small: "small";
23
+ readonly medium: "medium";
24
+ readonly large: "large";
25
+ readonly extraLarge: "extra-large";
26
+ readonly huge: "huge";
27
+ };
28
+ /**
29
+ * A Spinner's size can be either small, tiny, extra-small, medium, large, extra-large, or huge
30
+ * @public
31
+ */
32
+ export declare type SpinnerSize = ValuesOf<typeof SpinnerSize>;
@@ -0,0 +1,8 @@
1
+ import type { Args, Meta } from '@storybook/html';
2
+ import './define.js';
3
+ declare type SpinnerStoryArgs = Args;
4
+ declare type SpinnerStoryMeta = Meta<SpinnerStoryArgs>;
5
+ declare const _default: SpinnerStoryMeta;
6
+ export default _default;
7
+ export declare const Spinner: any;
8
+ export declare const SpinnerInverted: (args: Args) => Element | DocumentFragment | null;
@@ -0,0 +1 @@
1
+ export declare const styles: import("@microsoft/fast-element").ElementStyles;
@@ -0,0 +1,3 @@
1
+ import type { ElementViewTemplate } from '@microsoft/fast-element';
2
+ import { Spinner } from './spinner.js';
3
+ export declare const template: ElementViewTemplate<Spinner>;
package/dist/esm/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './badge/index.js';
2
2
  export * from './counter-badge/index.js';
3
3
  export * from './progress-bar/index.js';
4
+ export * from './spinner/index.js';
4
5
  export * from './text/index.js';
5
6
  export * from './theme/index.js';
@@ -0,0 +1,3 @@
1
+ import { FluentDesignSystem } from '../fluent-design-system.js';
2
+ import { definition } from './spinner.definition.js';
3
+ definition.define(FluentDesignSystem.registry);
@@ -0,0 +1,5 @@
1
+ export * from './spinner.js';
2
+ export * from './spinner.options.js';
3
+ export { template as SpinnerTemplate } from './spinner.template.js';
4
+ export { styles as SpinnerStyles } from './spinner.styles.js';
5
+ export { definition as SpinnerDefinition } from './spinner.definition.js';
@@ -0,0 +1,18 @@
1
+ import { FluentDesignSystem } from '../fluent-design-system.js';
2
+ import { Spinner } from './spinner.js';
3
+ import { styles } from './spinner.styles.js';
4
+ import { template } from './spinner.template.js';
5
+ /**
6
+ * The Fluent Spinner Element. Implements {@link @microsoft/fast-foundation#ProgressRing },
7
+ * {@link @microsoft/fast-foundation#progress-ringTemplate}
8
+ *
9
+ *
10
+ * @public
11
+ * @remarks
12
+ * HTML Element: \<fluent-spinner\>
13
+ */
14
+ export const definition = Spinner.compose({
15
+ name: `${FluentDesignSystem.prefix}-spinner`,
16
+ template,
17
+ styles,
18
+ });
@@ -0,0 +1,15 @@
1
+ import { __decorate } from "tslib";
2
+ import { attr } from '@microsoft/fast-element';
3
+ import { FASTProgressRing } from '@microsoft/fast-foundation';
4
+ /**
5
+ * The base class used for constructing a fluent-spinner custom element
6
+ * @public
7
+ */
8
+ export class Spinner extends FASTProgressRing {
9
+ }
10
+ __decorate([
11
+ attr
12
+ ], Spinner.prototype, "size", void 0);
13
+ __decorate([
14
+ attr
15
+ ], Spinner.prototype, "appearance", void 0);
@@ -0,0 +1,21 @@
1
+ /**
2
+ * SpinnerAppearance constants
3
+ * @public
4
+ */
5
+ export const SpinnerAppearance = {
6
+ primary: 'primary',
7
+ inverted: 'inverted',
8
+ };
9
+ /**
10
+ * SpinnerSize constants
11
+ * @public
12
+ */
13
+ export const SpinnerSize = {
14
+ tiny: 'tiny',
15
+ extraSmall: 'extra-small',
16
+ small: 'small',
17
+ medium: 'medium',
18
+ large: 'large',
19
+ extraLarge: 'extra-large',
20
+ huge: 'huge',
21
+ };
@@ -0,0 +1,45 @@
1
+ import { html } from '@microsoft/fast-element';
2
+ import { renderComponent } from '../__test__/helpers.js';
3
+ import { SpinnerAppearance, SpinnerSize } from './spinner.options.js';
4
+ import './define.js';
5
+ const storyTemplate = html `
6
+ <fluent-spinner appearance=${x => x.appearance} size=${x => x.size}></fluent-spinner>
7
+ `;
8
+ export default {
9
+ title: 'Components/Spinner',
10
+ argTypes: {
11
+ appearance: {
12
+ description: 'The appearance of the spinner',
13
+ table: {
14
+ defaultValue: { summary: 'primary' },
15
+ },
16
+ control: {
17
+ type: 'select',
18
+ options: Object.values(SpinnerAppearance),
19
+ },
20
+ defaultValue: 'primary',
21
+ },
22
+ size: {
23
+ description: 'The size of the spinner',
24
+ table: {
25
+ defaultValue: { summary: 'medium' },
26
+ },
27
+ control: {
28
+ type: 'select',
29
+ options: Object.values(SpinnerSize),
30
+ },
31
+ defaultValue: 'medium',
32
+ },
33
+ },
34
+ parameters: {
35
+ status: {
36
+ type: 'experimental',
37
+ },
38
+ },
39
+ };
40
+ export const Spinner = renderComponent(storyTemplate).bind({});
41
+ export const SpinnerInverted = renderComponent(html `
42
+ <div style="background-color: #0f6cbd; padding: 20px;">
43
+ <fluent-spinner appearance="inverted" size="medium"></fluent-spinner>
44
+ </div>
45
+ `);
@@ -0,0 +1,95 @@
1
+ import { css } from '@microsoft/fast-element';
2
+ import { display } from '@microsoft/fast-foundation';
3
+ import { colorBrandStroke1, colorBrandStroke2, colorNeutralStrokeOnBrand2 } from '../theme/design-tokens.js';
4
+ export const styles = css `
5
+ ${display('flex')}
6
+
7
+ :host {
8
+ display: flex;
9
+ align-items: center;
10
+ height: 32px;
11
+ width: 32px;
12
+ }
13
+ :host([size='tiny']) {
14
+ height: 20px;
15
+ width: 20px;
16
+ }
17
+ :host([size='extra-small']) {
18
+ height: 24px;
19
+ width: 24px;
20
+ }
21
+ :host([size='small']) {
22
+ height: 28px;
23
+ width: 28px;
24
+ }
25
+ :host([size='large']) {
26
+ height: 36px;
27
+ width: 36px;
28
+ }
29
+ :host([size='extra-large']) {
30
+ height: 40px;
31
+ width: 40px;
32
+ }
33
+ :host([size='huge']) {
34
+ height: 44px;
35
+ width: 44px;
36
+ }
37
+ .progress {
38
+ height: 100%;
39
+ width: 100%;
40
+ }
41
+
42
+ .background {
43
+ fill: none;
44
+ stroke: ${colorBrandStroke2};
45
+ stroke-width: 1.5px;
46
+ }
47
+
48
+ :host([appearance='inverted']) .background {
49
+ stroke: rgba(255, 255, 255, 0.2);
50
+ }
51
+
52
+ .determinate {
53
+ stroke: ${colorBrandStroke1};
54
+ fill: none;
55
+ stroke-width: 1.5px;
56
+ stroke-linecap: round;
57
+ transform-origin: 50% 50%;
58
+ transform: rotate(-90deg);
59
+ transition: all 0.2s ease-in-out;
60
+ }
61
+
62
+ :host([appearance='inverted']) .determinite {
63
+ stroke: ${colorNeutralStrokeOnBrand2};
64
+ }
65
+
66
+ .indeterminate-indicator-1 {
67
+ stroke: ${colorBrandStroke1};
68
+ fill: none;
69
+ stroke-width: 1.5px;
70
+ stroke-linecap: round;
71
+ transform-origin: 50% 50%;
72
+ transform: rotate(-90deg);
73
+ transition: all 0.2s ease-in-out;
74
+ animation: spin-infinite 3s cubic-bezier(0.53, 0.21, 0.29, 0.67) infinite;
75
+ }
76
+
77
+ :host([appearance='inverted']) .indeterminate-indicator-1 {
78
+ stroke: ${colorNeutralStrokeOnBrand2};
79
+ }
80
+
81
+ @keyframes spin-infinite {
82
+ 0% {
83
+ stroke-dasharray: 0.01px 43.97px;
84
+ transform: rotate(0deg);
85
+ }
86
+ 50% {
87
+ stroke-dasharray: 21.99px 21.99px;
88
+ transform: rotate(450deg);
89
+ }
90
+ 100% {
91
+ stroke-dasharray: 0.01px 43.97px;
92
+ transform: rotate(1080deg);
93
+ }
94
+ }
95
+ `;
@@ -0,0 +1,21 @@
1
+ import { progressRingTemplate } from '@microsoft/fast-foundation';
2
+ export const template = progressRingTemplate({
3
+ indeterminateIndicator: `
4
+ <svg class="progress" part="progress" viewBox="0 0 16 16">
5
+ <circle
6
+ class="background"
7
+ part="background"
8
+ cx="8px"
9
+ cy="8px"
10
+ r="7px"
11
+ ></circle>
12
+ <circle
13
+ class="indeterminate-indicator-1"
14
+ part="indeterminate-indicator-1"
15
+ cx="8px"
16
+ cy="8px"
17
+ r="7px"
18
+ ></circle>
19
+ </svg>
20
+ `,
21
+ });
@@ -13434,6 +13434,321 @@
13434
13434
  "endIndex": 4
13435
13435
  }
13436
13436
  },
13437
+ {
13438
+ "kind": "Class",
13439
+ "canonicalReference": "@fluentui/web-components!Spinner:class",
13440
+ "docComment": "/**\n * The base class used for constructing a fluent-spinner custom element\n *\n * @public\n */\n",
13441
+ "excerptTokens": [
13442
+ {
13443
+ "kind": "Content",
13444
+ "text": "export declare class Spinner extends "
13445
+ },
13446
+ {
13447
+ "kind": "Reference",
13448
+ "text": "FASTProgressRing",
13449
+ "canonicalReference": "@microsoft/fast-foundation!FASTProgressRing:class"
13450
+ },
13451
+ {
13452
+ "kind": "Content",
13453
+ "text": " "
13454
+ }
13455
+ ],
13456
+ "releaseTag": "Public",
13457
+ "name": "Spinner",
13458
+ "preserveMemberOrder": false,
13459
+ "members": [
13460
+ {
13461
+ "kind": "Property",
13462
+ "canonicalReference": "@fluentui/web-components!Spinner#appearance:member",
13463
+ "docComment": "/**\n * The appearance of the spinner\n *\n * @default 'primary'\n *\n * @remarks\n *\n * HTML Attribute: appearance\n *\n * @public\n */\n",
13464
+ "excerptTokens": [
13465
+ {
13466
+ "kind": "Content",
13467
+ "text": "appearance: "
13468
+ },
13469
+ {
13470
+ "kind": "Reference",
13471
+ "text": "SpinnerAppearance",
13472
+ "canonicalReference": "@fluentui/web-components!SpinnerAppearance:type"
13473
+ },
13474
+ {
13475
+ "kind": "Content",
13476
+ "text": ";"
13477
+ }
13478
+ ],
13479
+ "isReadonly": false,
13480
+ "isOptional": false,
13481
+ "releaseTag": "Public",
13482
+ "name": "appearance",
13483
+ "propertyTypeTokenRange": {
13484
+ "startIndex": 1,
13485
+ "endIndex": 2
13486
+ },
13487
+ "isStatic": false,
13488
+ "isProtected": false
13489
+ },
13490
+ {
13491
+ "kind": "Property",
13492
+ "canonicalReference": "@fluentui/web-components!Spinner#size:member",
13493
+ "docComment": "/**\n * The size of the spinner\n *\n * @default 'medium'\n *\n * @remarks\n *\n * HTML Attribute: size\n *\n * @public\n */\n",
13494
+ "excerptTokens": [
13495
+ {
13496
+ "kind": "Content",
13497
+ "text": "size: "
13498
+ },
13499
+ {
13500
+ "kind": "Reference",
13501
+ "text": "SpinnerSize",
13502
+ "canonicalReference": "@fluentui/web-components!SpinnerSize:type"
13503
+ },
13504
+ {
13505
+ "kind": "Content",
13506
+ "text": ";"
13507
+ }
13508
+ ],
13509
+ "isReadonly": false,
13510
+ "isOptional": false,
13511
+ "releaseTag": "Public",
13512
+ "name": "size",
13513
+ "propertyTypeTokenRange": {
13514
+ "startIndex": 1,
13515
+ "endIndex": 2
13516
+ },
13517
+ "isStatic": false,
13518
+ "isProtected": false
13519
+ }
13520
+ ],
13521
+ "extendsTokenRange": {
13522
+ "startIndex": 1,
13523
+ "endIndex": 2
13524
+ },
13525
+ "implementsTokenRanges": []
13526
+ },
13527
+ {
13528
+ "kind": "TypeAlias",
13529
+ "canonicalReference": "@fluentui/web-components!SpinnerAppearance:type",
13530
+ "docComment": "/**\n * A Spinner's appearance can be either primary or inverted\n *\n * @public\n */\n",
13531
+ "excerptTokens": [
13532
+ {
13533
+ "kind": "Content",
13534
+ "text": "export declare type SpinnerAppearance = "
13535
+ },
13536
+ {
13537
+ "kind": "Reference",
13538
+ "text": "ValuesOf",
13539
+ "canonicalReference": "@microsoft/fast-foundation!ValuesOf:type"
13540
+ },
13541
+ {
13542
+ "kind": "Content",
13543
+ "text": "<typeof "
13544
+ },
13545
+ {
13546
+ "kind": "Reference",
13547
+ "text": "SpinnerAppearance",
13548
+ "canonicalReference": "@fluentui/web-components!SpinnerAppearance:var"
13549
+ },
13550
+ {
13551
+ "kind": "Content",
13552
+ "text": ">"
13553
+ },
13554
+ {
13555
+ "kind": "Content",
13556
+ "text": ";"
13557
+ }
13558
+ ],
13559
+ "releaseTag": "Public",
13560
+ "name": "SpinnerAppearance",
13561
+ "typeTokenRange": {
13562
+ "startIndex": 1,
13563
+ "endIndex": 5
13564
+ }
13565
+ },
13566
+ {
13567
+ "kind": "Variable",
13568
+ "canonicalReference": "@fluentui/web-components!SpinnerAppearance:var",
13569
+ "docComment": "/**\n * SpinnerAppearance constants\n *\n * @public\n */\n",
13570
+ "excerptTokens": [
13571
+ {
13572
+ "kind": "Content",
13573
+ "text": "SpinnerAppearance: "
13574
+ },
13575
+ {
13576
+ "kind": "Content",
13577
+ "text": "{\n readonly primary: \"primary\";\n readonly inverted: \"inverted\";\n}"
13578
+ }
13579
+ ],
13580
+ "isReadonly": true,
13581
+ "releaseTag": "Public",
13582
+ "name": "SpinnerAppearance",
13583
+ "variableTypeTokenRange": {
13584
+ "startIndex": 1,
13585
+ "endIndex": 2
13586
+ }
13587
+ },
13588
+ {
13589
+ "kind": "Variable",
13590
+ "canonicalReference": "@fluentui/web-components!SpinnerDefinition:var",
13591
+ "docComment": "/**\n * The Fluent Spinner Element. Implements {@link @microsoft/fast-foundation#ProgressRing}, {@link @microsoft/fast-foundation#progress-ringTemplate}\n *\n * @remarks\n *\n * HTML Element: \\<fluent-spinner\\>\n *\n * @public\n */\n",
13592
+ "excerptTokens": [
13593
+ {
13594
+ "kind": "Content",
13595
+ "text": "definition: "
13596
+ },
13597
+ {
13598
+ "kind": "Content",
13599
+ "text": "import(\"@microsoft/fast-element\")."
13600
+ },
13601
+ {
13602
+ "kind": "Reference",
13603
+ "text": "FASTElementDefinition",
13604
+ "canonicalReference": "@microsoft/fast-element!FASTElementDefinition:class"
13605
+ },
13606
+ {
13607
+ "kind": "Content",
13608
+ "text": "<typeof "
13609
+ },
13610
+ {
13611
+ "kind": "Reference",
13612
+ "text": "Spinner",
13613
+ "canonicalReference": "@fluentui/web-components!Spinner:class"
13614
+ },
13615
+ {
13616
+ "kind": "Content",
13617
+ "text": ">"
13618
+ }
13619
+ ],
13620
+ "isReadonly": true,
13621
+ "releaseTag": "Public",
13622
+ "name": "SpinnerDefinition",
13623
+ "variableTypeTokenRange": {
13624
+ "startIndex": 1,
13625
+ "endIndex": 6
13626
+ }
13627
+ },
13628
+ {
13629
+ "kind": "TypeAlias",
13630
+ "canonicalReference": "@fluentui/web-components!SpinnerSize:type",
13631
+ "docComment": "/**\n * A Spinner's size can be either small, tiny, extra-small, medium, large, extra-large, or huge\n *\n * @public\n */\n",
13632
+ "excerptTokens": [
13633
+ {
13634
+ "kind": "Content",
13635
+ "text": "export declare type SpinnerSize = "
13636
+ },
13637
+ {
13638
+ "kind": "Reference",
13639
+ "text": "ValuesOf",
13640
+ "canonicalReference": "@microsoft/fast-foundation!ValuesOf:type"
13641
+ },
13642
+ {
13643
+ "kind": "Content",
13644
+ "text": "<typeof "
13645
+ },
13646
+ {
13647
+ "kind": "Reference",
13648
+ "text": "SpinnerSize",
13649
+ "canonicalReference": "@fluentui/web-components!SpinnerSize:var"
13650
+ },
13651
+ {
13652
+ "kind": "Content",
13653
+ "text": ">"
13654
+ },
13655
+ {
13656
+ "kind": "Content",
13657
+ "text": ";"
13658
+ }
13659
+ ],
13660
+ "releaseTag": "Public",
13661
+ "name": "SpinnerSize",
13662
+ "typeTokenRange": {
13663
+ "startIndex": 1,
13664
+ "endIndex": 5
13665
+ }
13666
+ },
13667
+ {
13668
+ "kind": "Variable",
13669
+ "canonicalReference": "@fluentui/web-components!SpinnerSize:var",
13670
+ "docComment": "/**\n * SpinnerSize constants\n *\n * @public\n */\n",
13671
+ "excerptTokens": [
13672
+ {
13673
+ "kind": "Content",
13674
+ "text": "SpinnerSize: "
13675
+ },
13676
+ {
13677
+ "kind": "Content",
13678
+ "text": "{\n readonly tiny: \"tiny\";\n readonly extraSmall: \"extra-small\";\n readonly small: \"small\";\n readonly medium: \"medium\";\n readonly large: \"large\";\n readonly extraLarge: \"extra-large\";\n readonly huge: \"huge\";\n}"
13679
+ }
13680
+ ],
13681
+ "isReadonly": true,
13682
+ "releaseTag": "Public",
13683
+ "name": "SpinnerSize",
13684
+ "variableTypeTokenRange": {
13685
+ "startIndex": 1,
13686
+ "endIndex": 2
13687
+ }
13688
+ },
13689
+ {
13690
+ "kind": "Variable",
13691
+ "canonicalReference": "@fluentui/web-components!SpinnerStyles:var",
13692
+ "docComment": "",
13693
+ "excerptTokens": [
13694
+ {
13695
+ "kind": "Content",
13696
+ "text": "styles: "
13697
+ },
13698
+ {
13699
+ "kind": "Content",
13700
+ "text": "import(\"@microsoft/fast-element\")."
13701
+ },
13702
+ {
13703
+ "kind": "Reference",
13704
+ "text": "ElementStyles",
13705
+ "canonicalReference": "@microsoft/fast-element!ElementStyles:class"
13706
+ }
13707
+ ],
13708
+ "isReadonly": true,
13709
+ "releaseTag": "Public",
13710
+ "name": "SpinnerStyles",
13711
+ "variableTypeTokenRange": {
13712
+ "startIndex": 1,
13713
+ "endIndex": 3
13714
+ }
13715
+ },
13716
+ {
13717
+ "kind": "Variable",
13718
+ "canonicalReference": "@fluentui/web-components!SpinnerTemplate:var",
13719
+ "docComment": "",
13720
+ "excerptTokens": [
13721
+ {
13722
+ "kind": "Content",
13723
+ "text": "template: "
13724
+ },
13725
+ {
13726
+ "kind": "Reference",
13727
+ "text": "ElementViewTemplate",
13728
+ "canonicalReference": "@microsoft/fast-element!ElementViewTemplate:interface"
13729
+ },
13730
+ {
13731
+ "kind": "Content",
13732
+ "text": "<"
13733
+ },
13734
+ {
13735
+ "kind": "Reference",
13736
+ "text": "Spinner",
13737
+ "canonicalReference": "@fluentui/web-components!Spinner:class"
13738
+ },
13739
+ {
13740
+ "kind": "Content",
13741
+ "text": ">"
13742
+ }
13743
+ ],
13744
+ "isReadonly": true,
13745
+ "releaseTag": "Public",
13746
+ "name": "SpinnerTemplate",
13747
+ "variableTypeTokenRange": {
13748
+ "startIndex": 1,
13749
+ "endIndex": 5
13750
+ }
13751
+ },
13437
13752
  {
13438
13753
  "kind": "Variable",
13439
13754
  "canonicalReference": "@fluentui/web-components!strokeWidthThick:var",