@fluentui/web-components 3.0.0-alpha.3 → 3.0.0-alpha.5
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 +69 -1
- package/CHANGELOG.md +20 -2
- package/dist/dts/accordion/accordion.d.ts +7 -0
- package/dist/dts/accordion/accordion.definition.d.ts +11 -0
- package/dist/dts/accordion/accordion.styles.d.ts +1 -0
- package/dist/dts/accordion/accordion.template.d.ts +3 -0
- package/dist/dts/accordion/define.d.ts +1 -0
- package/dist/dts/accordion/index.d.ts +4 -0
- package/dist/dts/accordion-item/accordion-item.d.ts +33 -0
- package/dist/dts/accordion-item/accordion-item.definition.d.ts +11 -0
- package/dist/dts/accordion-item/accordion-item.options.d.ts +27 -0
- package/dist/dts/accordion-item/accordion-item.styles.d.ts +1 -0
- package/dist/dts/accordion-item/accordion-item.template.d.ts +7 -0
- package/dist/dts/accordion-item/define.d.ts +1 -0
- package/dist/dts/accordion-item/index.d.ts +5 -0
- package/dist/dts/index.d.ts +2 -0
- package/dist/esm/accordion/accordion.definition.js +19 -0
- package/dist/esm/accordion/accordion.definition.js.map +1 -0
- package/dist/esm/accordion/accordion.js +8 -0
- package/dist/esm/accordion/accordion.js.map +1 -0
- package/dist/esm/accordion/accordion.styles.js +11 -0
- package/dist/esm/accordion/accordion.styles.js.map +1 -0
- package/dist/esm/accordion/accordion.template.js +3 -0
- package/dist/esm/accordion/accordion.template.js.map +1 -0
- package/dist/esm/accordion/define.js +4 -0
- package/dist/esm/accordion/define.js.map +1 -0
- package/dist/esm/accordion/index.js +5 -0
- package/dist/esm/accordion/index.js.map +1 -0
- package/dist/esm/accordion-item/accordion-item.definition.js +19 -0
- package/dist/esm/accordion-item/accordion-item.definition.js.map +1 -0
- package/dist/esm/accordion-item/accordion-item.js +29 -0
- package/dist/esm/accordion-item/accordion-item.js.map +1 -0
- package/dist/esm/accordion-item/accordion-item.options.js +17 -0
- package/dist/esm/accordion-item/accordion-item.options.js.map +1 -0
- package/dist/esm/accordion-item/accordion-item.styles.js +197 -0
- package/dist/esm/accordion-item/accordion-item.styles.js.map +1 -0
- package/dist/esm/accordion-item/accordion-item.template.js +37 -0
- package/dist/esm/accordion-item/accordion-item.template.js.map +1 -0
- package/dist/esm/accordion-item/define.js +4 -0
- package/dist/esm/accordion-item/define.js.map +1 -0
- package/dist/esm/accordion-item/index.js +6 -0
- package/dist/esm/accordion-item/index.js.map +1 -0
- package/dist/esm/badge/badge.definition.js +1 -0
- package/dist/esm/badge/badge.definition.js.map +1 -0
- package/dist/esm/badge/badge.js +1 -0
- package/dist/esm/badge/badge.js.map +1 -0
- package/dist/esm/badge/badge.options.js +1 -0
- package/dist/esm/badge/badge.options.js.map +1 -0
- package/dist/esm/badge/badge.styles.js +1 -0
- package/dist/esm/badge/badge.styles.js.map +1 -0
- package/dist/esm/badge/badge.template.js +1 -0
- package/dist/esm/badge/badge.template.js.map +1 -0
- package/dist/esm/badge/define.js +1 -0
- package/dist/esm/badge/define.js.map +1 -0
- package/dist/esm/badge/index.js +1 -0
- package/dist/esm/badge/index.js.map +1 -0
- package/dist/esm/counter-badge/counter-badge.definition.js +1 -0
- package/dist/esm/counter-badge/counter-badge.definition.js.map +1 -0
- package/dist/esm/counter-badge/counter-badge.js +1 -0
- package/dist/esm/counter-badge/counter-badge.js.map +1 -0
- package/dist/esm/counter-badge/counter-badge.options.js +1 -0
- package/dist/esm/counter-badge/counter-badge.options.js.map +1 -0
- package/dist/esm/counter-badge/counter-badge.styles.js +1 -0
- package/dist/esm/counter-badge/counter-badge.styles.js.map +1 -0
- package/dist/esm/counter-badge/counter-badge.template.js +1 -0
- package/dist/esm/counter-badge/counter-badge.template.js.map +1 -0
- package/dist/esm/counter-badge/define.js +1 -0
- package/dist/esm/counter-badge/define.js.map +1 -0
- package/dist/esm/counter-badge/index.js +1 -0
- package/dist/esm/counter-badge/index.js.map +1 -0
- package/dist/esm/fluent-design-system.js +1 -0
- package/dist/esm/fluent-design-system.js.map +1 -0
- package/dist/esm/index-rollup.js +1 -0
- package/dist/esm/index-rollup.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/progress-bar/define.js +1 -0
- package/dist/esm/progress-bar/define.js.map +1 -0
- package/dist/esm/progress-bar/index.js +1 -0
- package/dist/esm/progress-bar/index.js.map +1 -0
- package/dist/esm/progress-bar/progress-bar.definition.js +1 -0
- package/dist/esm/progress-bar/progress-bar.definition.js.map +1 -0
- package/dist/esm/progress-bar/progress-bar.js +1 -0
- package/dist/esm/progress-bar/progress-bar.js.map +1 -0
- package/dist/esm/progress-bar/progress-bar.options.js +1 -0
- package/dist/esm/progress-bar/progress-bar.options.js.map +1 -0
- package/dist/esm/progress-bar/progress-bar.styles.js +1 -0
- package/dist/esm/progress-bar/progress-bar.styles.js.map +1 -0
- package/dist/esm/progress-bar/progress-bar.template.js +1 -0
- package/dist/esm/progress-bar/progress-bar.template.js.map +1 -0
- package/dist/esm/spinner/define.js +1 -0
- package/dist/esm/spinner/define.js.map +1 -0
- package/dist/esm/spinner/index.js +1 -0
- package/dist/esm/spinner/index.js.map +1 -0
- package/dist/esm/spinner/spinner.definition.js +1 -0
- package/dist/esm/spinner/spinner.definition.js.map +1 -0
- package/dist/esm/spinner/spinner.js +1 -0
- package/dist/esm/spinner/spinner.js.map +1 -0
- package/dist/esm/spinner/spinner.options.js +1 -0
- package/dist/esm/spinner/spinner.options.js.map +1 -0
- package/dist/esm/spinner/spinner.styles.js +1 -0
- package/dist/esm/spinner/spinner.styles.js.map +1 -0
- package/dist/esm/spinner/spinner.template.js +1 -0
- package/dist/esm/spinner/spinner.template.js.map +1 -0
- package/dist/esm/styles/index.js +1 -0
- package/dist/esm/styles/index.js.map +1 -0
- package/dist/esm/styles/partials/badge.partials.js +1 -0
- package/dist/esm/styles/partials/badge.partials.js.map +1 -0
- package/dist/esm/styles/partials/index.js +1 -0
- package/dist/esm/styles/partials/index.js.map +1 -0
- package/dist/esm/text/define.js +1 -0
- package/dist/esm/text/define.js.map +1 -0
- package/dist/esm/text/index.js +1 -0
- package/dist/esm/text/index.js.map +1 -0
- package/dist/esm/text/text.definition.js +1 -0
- package/dist/esm/text/text.definition.js.map +1 -0
- package/dist/esm/text/text.js +1 -0
- package/dist/esm/text/text.js.map +1 -0
- package/dist/esm/text/text.options.js +1 -0
- package/dist/esm/text/text.options.js.map +1 -0
- package/dist/esm/text/text.styles.js +1 -0
- package/dist/esm/text/text.styles.js.map +1 -0
- package/dist/esm/text/text.template.js +1 -0
- package/dist/esm/text/text.template.js.map +1 -0
- package/dist/esm/theme/design-tokens.js +1 -0
- package/dist/esm/theme/design-tokens.js.map +1 -0
- package/dist/esm/theme/index.js +1 -0
- package/dist/esm/theme/index.js.map +1 -0
- package/dist/esm/theme/set-theme.js +1 -0
- package/dist/esm/theme/set-theme.js.map +1 -0
- package/dist/fluent-web-components.api.json +364 -7
- package/dist/web-components.d.ts +109 -3
- package/dist/web-components.js +1077 -474
- package/dist/web-components.min.js +119 -113
- package/docs/api-report.md +64 -3
- package/package.json +15 -10
- package/.eslintrc.json +0 -62
- package/build/clean.cjs +0 -29
- package/build/transform-fragments.js +0 -29
- package/dist/dts/badge/badge.stories.d.ts +0 -12
- package/dist/dts/counter-badge/counter-badge.stories.d.ts +0 -14
- package/dist/dts/progress-bar/progress-bar.stories.d.ts +0 -9
- package/dist/dts/spinner/spinner.stories.d.ts +0 -8
- package/dist/dts/text/text.stories.d.ts +0 -8
- package/dist/dts/theme/theme.stories.d.ts +0 -5
- package/dist/esm/badge/badge.stories.js +0 -108
- package/dist/esm/counter-badge/counter-badge.stories.js +0 -102
- package/dist/esm/progress-bar/progress-bar.stories.js +0 -60
- package/dist/esm/spinner/spinner.stories.js +0 -45
- package/dist/esm/text/text.stories.js +0 -111
- package/dist/esm/theme/theme.stories.js +0 -21
- package/public/SegoeUI-VF.ttf +0 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.png +0 -0
- package/public/theme-switch.ts +0 -13
- package/rollup.config.js +0 -58
- package/storybook-typings.d.ts +0 -4
package/docs/api-report.md
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
import { CSSDesignToken } from '@microsoft/fast-foundation';
|
|
8
8
|
import { ElementStyles } from '@microsoft/fast-element';
|
|
9
9
|
import { ElementViewTemplate } from '@microsoft/fast-element';
|
|
10
|
+
import { FASTAccordion } from '@microsoft/fast-foundation';
|
|
11
|
+
import { FASTAccordionItem } from '@microsoft/fast-foundation';
|
|
10
12
|
import { FASTElement } from '@microsoft/fast-element';
|
|
11
13
|
import { FASTElementDefinition } from '@microsoft/fast-element';
|
|
12
14
|
import { FASTProgress } from '@microsoft/fast-foundation';
|
|
@@ -17,6 +19,64 @@ import { StaticallyComposableHTML } from '@microsoft/fast-foundation';
|
|
|
17
19
|
import type { Theme } from '@fluentui/tokens';
|
|
18
20
|
import { ValuesOf } from '@microsoft/fast-foundation';
|
|
19
21
|
|
|
22
|
+
// @public
|
|
23
|
+
export class Accordion extends FASTAccordion {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// @public
|
|
27
|
+
export const accordionDefinition: FASTElementDefinition<typeof Accordion>;
|
|
28
|
+
|
|
29
|
+
// Warning: (ae-internal-missing-underscore) The name "AccordionItem" should be prefixed with an underscore because the declaration is marked as @internal
|
|
30
|
+
//
|
|
31
|
+
// @internal (undocumented)
|
|
32
|
+
export class AccordionItem extends FASTAccordionItem {
|
|
33
|
+
// @public
|
|
34
|
+
block: boolean;
|
|
35
|
+
// @public
|
|
36
|
+
expandIconPosition: AccordionItemExpandIconPosition;
|
|
37
|
+
// @public
|
|
38
|
+
size: AccordionItemSize;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Warning: (ae-incompatible-release-tags) The symbol "definition" is marked as @public, but its signature references "AccordionItem" which is marked as @internal
|
|
42
|
+
//
|
|
43
|
+
// @public
|
|
44
|
+
export const accordionItemDefinition: FASTElementDefinition<typeof AccordionItem>;
|
|
45
|
+
|
|
46
|
+
// @public
|
|
47
|
+
export const AccordionItemExpandIconPosition: {
|
|
48
|
+
readonly start: "start";
|
|
49
|
+
readonly end: "end";
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// @public
|
|
53
|
+
export type AccordionItemExpandIconPosition = ValuesOf<typeof AccordionItemExpandIconPosition>;
|
|
54
|
+
|
|
55
|
+
// @public
|
|
56
|
+
export const AccordionItemSize: {
|
|
57
|
+
readonly small: "small";
|
|
58
|
+
readonly medium: "medium";
|
|
59
|
+
readonly large: "large";
|
|
60
|
+
readonly extraLarge: "extra-large";
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// @public
|
|
64
|
+
export type AccordionItemSize = ValuesOf<typeof AccordionItemSize>;
|
|
65
|
+
|
|
66
|
+
// @public (undocumented)
|
|
67
|
+
export const accordionItemStyles: ElementStyles;
|
|
68
|
+
|
|
69
|
+
// Warning: (ae-incompatible-release-tags) The symbol "template" is marked as @public, but its signature references "AccordionItem" which is marked as @internal
|
|
70
|
+
//
|
|
71
|
+
// @public
|
|
72
|
+
export const accordionItemTemplate: ElementViewTemplate<AccordionItem>;
|
|
73
|
+
|
|
74
|
+
// @public (undocumented)
|
|
75
|
+
export const accordionStyles: ElementStyles;
|
|
76
|
+
|
|
77
|
+
// @public (undocumented)
|
|
78
|
+
export const accordionTemplate: ElementViewTemplate<Accordion>;
|
|
79
|
+
|
|
20
80
|
// Warning: (ae-internal-mixed-release-tag) Mixed release tags are not allowed for "Badge" because one of its declarations is marked as @internal
|
|
21
81
|
//
|
|
22
82
|
// @public
|
|
@@ -1204,14 +1264,15 @@ export const lineHeightHero800: CSSDesignToken<string>;
|
|
|
1204
1264
|
export const lineHeightHero900: CSSDesignToken<string>;
|
|
1205
1265
|
|
|
1206
1266
|
// @public
|
|
1207
|
-
|
|
1267
|
+
class ProgressBar_2 extends FASTProgress {
|
|
1208
1268
|
shape: ProgressBarShape;
|
|
1209
1269
|
thickness: ProgressBarThickness;
|
|
1210
1270
|
validationState: ProgressBarValidationState | null;
|
|
1211
1271
|
}
|
|
1272
|
+
export { ProgressBar_2 as ProgressBar }
|
|
1212
1273
|
|
|
1213
1274
|
// @public
|
|
1214
|
-
export const ProgressBarDefinition: FASTElementDefinition<typeof
|
|
1275
|
+
export const ProgressBarDefinition: FASTElementDefinition<typeof ProgressBar_2>;
|
|
1215
1276
|
|
|
1216
1277
|
// @public
|
|
1217
1278
|
export const ProgressBarShape: {
|
|
@@ -1226,7 +1287,7 @@ export type ProgressBarShape = ValuesOf<typeof ProgressBarShape>;
|
|
|
1226
1287
|
export const ProgressBarStyles: ElementStyles;
|
|
1227
1288
|
|
|
1228
1289
|
// @public (undocumented)
|
|
1229
|
-
export const ProgressBarTemplate: ElementViewTemplate<
|
|
1290
|
+
export const ProgressBarTemplate: ElementViewTemplate<ProgressBar_2>;
|
|
1230
1291
|
|
|
1231
1292
|
// @public
|
|
1232
1293
|
export const ProgressBarThickness: {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fluentui/web-components",
|
|
3
3
|
"description": "A library of Fluent Web Components",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "3.0.0-alpha.
|
|
5
|
+
"version": "3.0.0-alpha.5",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Microsoft",
|
|
8
8
|
"url": "https://discord.gg/FcSNfg4"
|
|
@@ -24,6 +24,14 @@
|
|
|
24
24
|
"types": "./dist/dts/index.d.ts",
|
|
25
25
|
"default": "./dist/esm/index.js"
|
|
26
26
|
},
|
|
27
|
+
"./accordion": {
|
|
28
|
+
"types": "./dist/esm/accordion/define.d.ts",
|
|
29
|
+
"default": "./dist/esm/accordion/define.js"
|
|
30
|
+
},
|
|
31
|
+
"./accordion-item": {
|
|
32
|
+
"types": "./dist/esm/accordion-item/define.d.ts",
|
|
33
|
+
"default": "./dist/esm/accordion-item/define.js"
|
|
34
|
+
},
|
|
27
35
|
"./badge": {
|
|
28
36
|
"types": "./dist/esm/badge/define.d.ts",
|
|
29
37
|
"default": "./dist/esm/badge/define.js"
|
|
@@ -48,22 +56,19 @@
|
|
|
48
56
|
"scripts": {
|
|
49
57
|
"tsc": "tsc",
|
|
50
58
|
"api-extractor": "api-extractor",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"build": "
|
|
55
|
-
"dev": "tsc -p ./tsconfig.json -w",
|
|
56
|
-
"tdd": "yarn dev & yarn test-chrome:watch",
|
|
57
|
-
"prepare": "yarn clean && yarn build",
|
|
59
|
+
"compile": "node ./scripts/compile",
|
|
60
|
+
"clean": "node ./scripts/clean dist",
|
|
61
|
+
"generate-api": "api-extractor run --local",
|
|
62
|
+
"build": "yarn compile && rollup -c && yarn generate-api",
|
|
58
63
|
"lint": "eslint . --ext .ts",
|
|
59
64
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
60
65
|
"format": "prettier -w 'src/**/(*.ts|*.html)' --ignore-path ../../.prettierignore",
|
|
61
66
|
"format:check": "yarn format -c",
|
|
62
67
|
"code-style": "yarn format:check && yarn lint",
|
|
63
|
-
"start": "yarn start-storybook -p 6006 --docs",
|
|
68
|
+
"start": "yarn start-storybook -p 6006 --docs --no-manager-cache",
|
|
64
69
|
"start-storybook": "node node_modules/@storybook/html/bin/index",
|
|
65
70
|
"build-storybook": "node node_modules/@storybook/html/bin/build -o ./dist/storybook --docs",
|
|
66
|
-
"test": "yarn
|
|
71
|
+
"test": "yarn test-chrome:verbose",
|
|
67
72
|
"test-node": "mocha --reporter min --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'",
|
|
68
73
|
"test-node:verbose": "mocha --reporter spec --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'",
|
|
69
74
|
"test-chrome": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --single-run --coverage",
|
package/.eslintrc.json
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": true,
|
|
3
|
-
"parser": "@typescript-eslint/parser",
|
|
4
|
-
"plugins": ["@typescript-eslint", "import"],
|
|
5
|
-
"extends": [
|
|
6
|
-
"eslint:recommended",
|
|
7
|
-
"plugin:@typescript-eslint/eslint-recommended",
|
|
8
|
-
"plugin:@typescript-eslint/recommended",
|
|
9
|
-
"prettier"
|
|
10
|
-
],
|
|
11
|
-
"settings": {
|
|
12
|
-
"react": {
|
|
13
|
-
"version": "latest"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"rules": {
|
|
17
|
-
"no-extra-boolean-cast": "off",
|
|
18
|
-
"no-prototype-builtins": "off",
|
|
19
|
-
"no-fallthrough": "off",
|
|
20
|
-
"no-unexpected-multiline": "off",
|
|
21
|
-
"import/order": "error",
|
|
22
|
-
"sort-imports": [
|
|
23
|
-
"error",
|
|
24
|
-
{
|
|
25
|
-
"ignoreCase": true,
|
|
26
|
-
"ignoreDeclarationSort": true
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
"comma-dangle": "off",
|
|
30
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
31
|
-
"@typescript-eslint/no-use-before-define": "off",
|
|
32
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
33
|
-
"@typescript-eslint/explicit-function-return-type": "off",
|
|
34
|
-
"@typescript-eslint/camelcase": "off",
|
|
35
|
-
"@typescript-eslint/no-inferrable-types": "off",
|
|
36
|
-
"@typescript-eslint/no-unused-vars": [
|
|
37
|
-
"warn",
|
|
38
|
-
{
|
|
39
|
-
"args": "none"
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
43
|
-
"@typescript-eslint/naming-convention": [
|
|
44
|
-
"error",
|
|
45
|
-
{
|
|
46
|
-
"selector": "default",
|
|
47
|
-
"format": ["UPPER_CASE", "camelCase", "PascalCase"],
|
|
48
|
-
"leadingUnderscore": "allow"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"selector": "property",
|
|
52
|
-
"format": null // disable for property names because of our foo__expanded convention for JSS
|
|
53
|
-
// TODO: I think we can come up with a regex that ignores variables with __ in them
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"selector": "variable",
|
|
57
|
-
"format": null // disable for variable names because of our foo__expanded convention for JSS
|
|
58
|
-
// TODO: I think we can come up with a regex that ignores variables with __ in them
|
|
59
|
-
}
|
|
60
|
-
]
|
|
61
|
-
}
|
|
62
|
-
}
|
package/build/clean.cjs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility for cleaning directories.
|
|
3
|
-
* Usage: node build/clean.js %path%
|
|
4
|
-
*/
|
|
5
|
-
const path = require('path');
|
|
6
|
-
const rimraf = require('rimraf');
|
|
7
|
-
const argv = require('yargs').argv;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* All paths passed to the clean script
|
|
11
|
-
*/
|
|
12
|
-
const paths = argv._;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Function to remove a given path
|
|
16
|
-
*/
|
|
17
|
-
function cleanPath(cleanPath) {
|
|
18
|
-
const removePath = path.resolve(process.cwd(), cleanPath);
|
|
19
|
-
rimraf(removePath, () => {
|
|
20
|
-
console.log(removePath, 'cleaned');
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Clean all paths
|
|
26
|
-
*/
|
|
27
|
-
if (Array.isArray(paths)) {
|
|
28
|
-
paths.forEach(cleanPath);
|
|
29
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/explicit-function-return-type, @typescript-eslint/typedef */
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Reduces extra spaces in HTML tagged templates.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} data - the fragment value
|
|
7
|
-
* @returns string
|
|
8
|
-
*/
|
|
9
|
-
export function transformHTMLFragment(data) {
|
|
10
|
-
data = data.replace(/\s*([<>])\s*/g, '$1'); // remove spaces before and after angle brackets
|
|
11
|
-
return data.replace(/\s{2,}/g, ' '); // Collapse all sequences to 1 space
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Reduces extra spaces in CSS tagged templates.
|
|
16
|
-
*
|
|
17
|
-
* Breakdown of this regex:
|
|
18
|
-
* (?:\s*\/\*(?:.|\s)+?\*\/\s*) Remove comments (non-capturing)
|
|
19
|
-
* (?:;)\s+(?=\}) Remove semicolons and spaces followed by property list end (non-capturing)
|
|
20
|
-
* \s+(?=\{) Remove spaces before property list start (non-capturing)
|
|
21
|
-
* (?<=:)\s+ Remove spaces after property declarations (non-capturing)
|
|
22
|
-
* \s*([{};,])\s* Remove extra spaces before and after braces, semicolons, and commas (captures)
|
|
23
|
-
*
|
|
24
|
-
* @param {string} data - the fragment value
|
|
25
|
-
* @returns string
|
|
26
|
-
*/
|
|
27
|
-
export function transformCSSFragment(data) {
|
|
28
|
-
return data.replace(/(?:\s*\/\*(?:.|\s)+?\*\/\s*)|(?:;)\s+(?=\})|\s+(?=\{)|(?<=:)\s+|\s*([{};,])\s*/g, '$1');
|
|
29
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Args, Meta } from '@storybook/html';
|
|
2
|
-
import type { Badge as FluentBadge } from './badge.js';
|
|
3
|
-
import './define.js';
|
|
4
|
-
declare type BadgeStoryArgs = Args & FluentBadge;
|
|
5
|
-
declare type BadgeStoryMeta = Meta<BadgeStoryArgs>;
|
|
6
|
-
declare const _default: BadgeStoryMeta;
|
|
7
|
-
export default _default;
|
|
8
|
-
export declare const Badge: any;
|
|
9
|
-
export declare const Appearance: (args: Args) => Element | DocumentFragment | null;
|
|
10
|
-
export declare const Color: (args: Args) => Element | DocumentFragment | null;
|
|
11
|
-
export declare const Shape: (args: Args) => Element | DocumentFragment | null;
|
|
12
|
-
export declare const Size: BadgeStoryMeta;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Args, Meta } from '@storybook/html';
|
|
2
|
-
import type { CounterBadge as FluentCounterBadge } from './counter-badge.js';
|
|
3
|
-
import './define.js';
|
|
4
|
-
declare type CounterBadgeStoryArgs = Args & FluentCounterBadge;
|
|
5
|
-
declare type CounterBadgeStoryMeta = Meta<CounterBadgeStoryArgs>;
|
|
6
|
-
declare const _default: CounterBadgeStoryMeta;
|
|
7
|
-
export default _default;
|
|
8
|
-
export declare const CounterBadge: any;
|
|
9
|
-
export declare const Appearance: (args: Args) => Element | DocumentFragment | null;
|
|
10
|
-
export declare const Color: (args: Args) => Element | DocumentFragment | null;
|
|
11
|
-
export declare const Shape: (args: Args) => Element | DocumentFragment | null;
|
|
12
|
-
export declare const Size: CounterBadgeStoryMeta;
|
|
13
|
-
export declare const Dot: (args: Args) => Element | DocumentFragment | null;
|
|
14
|
-
export declare const ShowZero: (args: Args) => Element | DocumentFragment | null;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Args, Meta } from '@storybook/html';
|
|
2
|
-
import type { ProgressBar as FluentProgressBar } from './progress-bar.js';
|
|
3
|
-
import './define.js';
|
|
4
|
-
declare type ProgressStoryArgs = Args & FluentProgressBar;
|
|
5
|
-
declare type ProgressStoryMeta = Meta<ProgressStoryArgs>;
|
|
6
|
-
declare const _default: ProgressStoryMeta;
|
|
7
|
-
export default _default;
|
|
8
|
-
export declare const Progress: any;
|
|
9
|
-
export declare const ProgressIndeterminate: (args: Args) => Element | DocumentFragment | null;
|
|
@@ -1,8 +0,0 @@
|
|
|
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;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Args, Meta } from '@storybook/html';
|
|
2
|
-
import type { Text as FluentText } from './text.js';
|
|
3
|
-
import './define.js';
|
|
4
|
-
declare type TextStoryArgs = Args & FluentText;
|
|
5
|
-
declare type TextStoryMeta = Meta<TextStoryArgs>;
|
|
6
|
-
declare const _default: TextStoryMeta;
|
|
7
|
-
export default _default;
|
|
8
|
-
export declare const Text: any;
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { html, when } from '@microsoft/fast-element';
|
|
2
|
-
import { renderComponent } from '../__test__/helpers.js';
|
|
3
|
-
import { BadgeAppearance, BadgeColor, BadgeShape, BadgeSize } from './badge.options.js';
|
|
4
|
-
import './define.js';
|
|
5
|
-
const storyTemplate = html `
|
|
6
|
-
<fluent-badge appearance="${x => x.appearance}" color="${x => x.color}" shape="${x => x.shape}" size="${x => x.size}">
|
|
7
|
-
${when(x => x.iconPosition === 'start', html `<svg
|
|
8
|
-
slot="start"
|
|
9
|
-
aria-hidden="true"
|
|
10
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
-
width="1em"
|
|
12
|
-
height="1em"
|
|
13
|
-
preserveAspectRatio="xMidYMid meet"
|
|
14
|
-
viewBox="0 0 20 20"
|
|
15
|
-
>
|
|
16
|
-
<path
|
|
17
|
-
fill="currentColor"
|
|
18
|
-
d="M14.69 11.503c1 0 1.81.81 1.81 1.81v.689h-.005c-.034.78-.248 1.757-1.123 2.555C14.416 17.43 12.765 18 10 18c-2.766 0-4.416-.57-5.372-1.443c-.875-.798-1.089-1.776-1.123-2.555H3.5v-.69c0-.999.81-1.809 1.81-1.809h9.38ZM6.5 3A1.5 1.5 0 0 0 5 4.5v4A1.5 1.5 0 0 0 6.5 10h7A1.5 1.5 0 0 0 15 8.5v-4A1.5 1.5 0 0 0 13.5 3h-3v-.5A.48.48 0 0 0 10 2c-.276 0-.5.23-.5.5V3h-3ZM7 6.5a1 1 0 1 1 2 0a1 1 0 0 1-2 0Zm4 0a1 1 0 1 1 2 0a1 1 0 0 1-2 0Z"
|
|
19
|
-
/>
|
|
20
|
-
</svg>`)}
|
|
21
|
-
${x => x.content}
|
|
22
|
-
${when(x => x.iconPosition === 'end', html `<svg
|
|
23
|
-
slot="start"
|
|
24
|
-
aria-hidden="true"
|
|
25
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
26
|
-
width="1em"
|
|
27
|
-
height="1em"
|
|
28
|
-
preserveAspectRatio="xMidYMid meet"
|
|
29
|
-
viewBox="0 0 20 20"
|
|
30
|
-
>
|
|
31
|
-
<path
|
|
32
|
-
fill="currentColor"
|
|
33
|
-
d="M14.69 11.503c1 0 1.81.81 1.81 1.81v.689h-.005c-.034.78-.248 1.757-1.123 2.555C14.416 17.43 12.765 18 10 18c-2.766 0-4.416-.57-5.372-1.443c-.875-.798-1.089-1.776-1.123-2.555H3.5v-.69c0-.999.81-1.809 1.81-1.809h9.38ZM6.5 3A1.5 1.5 0 0 0 5 4.5v4A1.5 1.5 0 0 0 6.5 10h7A1.5 1.5 0 0 0 15 8.5v-4A1.5 1.5 0 0 0 13.5 3h-3v-.5A.48.48 0 0 0 10 2c-.276 0-.5.23-.5.5V3h-3ZM7 6.5a1 1 0 1 1 2 0a1 1 0 0 1-2 0Zm4 0a1 1 0 1 1 2 0a1 1 0 0 1-2 0Z"
|
|
34
|
-
/>
|
|
35
|
-
</svg>`)}
|
|
36
|
-
</fluent-badge>
|
|
37
|
-
`;
|
|
38
|
-
export default {
|
|
39
|
-
title: 'Components/Badge/Badge',
|
|
40
|
-
args: {
|
|
41
|
-
content: null,
|
|
42
|
-
},
|
|
43
|
-
argTypes: {
|
|
44
|
-
appearance: {
|
|
45
|
-
options: Object.values(BadgeAppearance),
|
|
46
|
-
control: {
|
|
47
|
-
type: 'select',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
color: {
|
|
51
|
-
options: Object.values(BadgeColor),
|
|
52
|
-
control: {
|
|
53
|
-
type: 'select',
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
shape: {
|
|
57
|
-
options: Object.values(BadgeShape),
|
|
58
|
-
control: {
|
|
59
|
-
type: 'select',
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
size: {
|
|
63
|
-
options: Object.values(BadgeSize),
|
|
64
|
-
control: {
|
|
65
|
-
type: 'select',
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
iconPosition: {
|
|
69
|
-
options: ['none', 'start', 'end'],
|
|
70
|
-
control: {
|
|
71
|
-
type: 'select',
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
content: {
|
|
75
|
-
control: 'text',
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
export const Badge = renderComponent(storyTemplate).bind({});
|
|
80
|
-
export const Appearance = renderComponent(html `
|
|
81
|
-
<fluent-badge appearance="filled">filled</fluent-badge>
|
|
82
|
-
<fluent-badge appearance="ghost">ghost</fluent-badge>
|
|
83
|
-
<fluent-badge appearance="outline">outline</fluent-badge>
|
|
84
|
-
<fluent-badge appearance="tint">tint</fluent-badge>
|
|
85
|
-
`);
|
|
86
|
-
export const Color = renderComponent(html `
|
|
87
|
-
<fluent-badge color="brand">brand</fluent-badge>
|
|
88
|
-
<fluent-badge color="danger">danger</fluent-badge>
|
|
89
|
-
<fluent-badge color="important">important</fluent-badge>
|
|
90
|
-
<fluent-badge color="informative">informative</fluent-badge>
|
|
91
|
-
<fluent-badge color="severe">severe</fluent-badge>
|
|
92
|
-
<fluent-badge color="subtle">subtle</fluent-badge>
|
|
93
|
-
<fluent-badge color="success">success</fluent-badge>
|
|
94
|
-
<fluent-badge color="warning">warning</fluent-badge>
|
|
95
|
-
`);
|
|
96
|
-
export const Shape = renderComponent(html `
|
|
97
|
-
<fluent-badge shape="circular"></fluent-badge>
|
|
98
|
-
<fluent-badge shape="rounded"></fluent-badge>
|
|
99
|
-
<fluent-badge shape="square"></fluent-badge>
|
|
100
|
-
`);
|
|
101
|
-
export const Size = renderComponent(html `
|
|
102
|
-
<fluent-badge size="tiny"></fluent-badge>
|
|
103
|
-
<fluent-badge size="extra-small"></fluent-badge>
|
|
104
|
-
<fluent-badge size="small"></fluent-badge>
|
|
105
|
-
<fluent-badge size="medium"></fluent-badge>
|
|
106
|
-
<fluent-badge size="large"></fluent-badge>
|
|
107
|
-
<fluent-badge size="extra-large"></fluent-badge>
|
|
108
|
-
`);
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { html } from '@microsoft/fast-element';
|
|
2
|
-
import { renderComponent } from '../__test__/helpers.js';
|
|
3
|
-
import { CounterBadgeAppearance, CounterBadgeColor, CounterBadgeShape, CounterBadgeSize, } from './counter-badge.options.js';
|
|
4
|
-
import './define.js';
|
|
5
|
-
// TODO: Currently cannot show icon or content
|
|
6
|
-
// in the counter badge stories because it projects as slotted content
|
|
7
|
-
const storyTemplate = html `
|
|
8
|
-
<fluent-counter-badge
|
|
9
|
-
appearance="${x => x.appearance}"
|
|
10
|
-
color="${x => x.color}"
|
|
11
|
-
shape="${x => x.shape}"
|
|
12
|
-
size="${x => x.size}"
|
|
13
|
-
count="${x => x.count}"
|
|
14
|
-
overflow-count="${x => x.overflowCount}"
|
|
15
|
-
?show-zero="${x => x.showZero}"
|
|
16
|
-
?dot="${x => x.dot}"
|
|
17
|
-
></fluent-counter-badge>
|
|
18
|
-
`;
|
|
19
|
-
export default {
|
|
20
|
-
title: 'Components/Badge/Counter Badge',
|
|
21
|
-
args: {
|
|
22
|
-
dot: false,
|
|
23
|
-
showZero: false,
|
|
24
|
-
appearance: CounterBadgeAppearance.filled,
|
|
25
|
-
color: CounterBadgeColor.brand,
|
|
26
|
-
shape: CounterBadgeShape.circular,
|
|
27
|
-
count: 5,
|
|
28
|
-
},
|
|
29
|
-
argTypes: {
|
|
30
|
-
appearance: {
|
|
31
|
-
options: Object.values(CounterBadgeAppearance),
|
|
32
|
-
control: {
|
|
33
|
-
type: 'select',
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
color: {
|
|
37
|
-
options: Object.values(CounterBadgeColor),
|
|
38
|
-
control: {
|
|
39
|
-
type: 'select',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
shape: {
|
|
43
|
-
options: Object.values(CounterBadgeShape),
|
|
44
|
-
control: {
|
|
45
|
-
type: 'select',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
size: {
|
|
49
|
-
options: Object.values(CounterBadgeSize),
|
|
50
|
-
control: {
|
|
51
|
-
type: 'select',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
iconPosition: {
|
|
55
|
-
options: ['none', 'start', 'end'],
|
|
56
|
-
control: {
|
|
57
|
-
type: 'select',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
dot: {
|
|
61
|
-
control: 'boolean',
|
|
62
|
-
},
|
|
63
|
-
showZero: {
|
|
64
|
-
control: 'boolean',
|
|
65
|
-
},
|
|
66
|
-
count: {
|
|
67
|
-
control: 'number',
|
|
68
|
-
},
|
|
69
|
-
overflowCount: {
|
|
70
|
-
control: 'text',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
export const CounterBadge = renderComponent(storyTemplate).bind({});
|
|
75
|
-
export const Appearance = renderComponent(html `
|
|
76
|
-
<fluent-counter-badge count="5" appearance="filled"></fluent-counter-badge>
|
|
77
|
-
<fluent-counter-badge count="5" appearance="ghost"></fluent-counter-badge>
|
|
78
|
-
`);
|
|
79
|
-
export const Color = renderComponent(html `
|
|
80
|
-
<fluent-counter-badge count="5" color="brand"></fluent-counter-badge>
|
|
81
|
-
<fluent-counter-badge count="5" color="danger"></fluent-counter-badge>
|
|
82
|
-
<fluent-counter-badge count="5" color="important"></fluent-counter-badge>
|
|
83
|
-
<fluent-counter-badge count="5" color="informative"></fluent-counter-badge>
|
|
84
|
-
<fluent-counter-badge count="5" color="severe"></fluent-counter-badge>
|
|
85
|
-
<fluent-counter-badge count="5" color="subtle"></fluent-counter-badge>
|
|
86
|
-
<fluent-counter-badge count="5" color="success"></fluent-counter-badge>
|
|
87
|
-
<fluent-counter-badge count="5" color="warning"></fluent-counter-badge>
|
|
88
|
-
`);
|
|
89
|
-
export const Shape = renderComponent(html `
|
|
90
|
-
<fluent-counter-badge count="5" shape="circular"></fluent-counter-badge>
|
|
91
|
-
<fluent-counter-badge count="5" shape="rounded"></fluent-counter-badge>
|
|
92
|
-
`);
|
|
93
|
-
export const Size = renderComponent(html `
|
|
94
|
-
<fluent-counter-badge size="tiny"></fluent-counter-badge>
|
|
95
|
-
<fluent-counter-badge size="extra-small"></fluent-counter-badge>
|
|
96
|
-
<fluent-counter-badge size="small"></fluent-counter-badge>
|
|
97
|
-
<fluent-counter-badge size="medium"></fluent-counter-badge>
|
|
98
|
-
<fluent-counter-badge size="large"></fluent-counter-badge>
|
|
99
|
-
<fluent-counter-badge size="extra-large"></fluent-counter-badge>
|
|
100
|
-
`);
|
|
101
|
-
export const Dot = renderComponent(html `<fluent-counter-badge dot></fluent-counter-badge>`);
|
|
102
|
-
export const ShowZero = renderComponent(html `<fluent-counter-badge show-zero></fluent-counter-badge>`);
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { html } from '@microsoft/fast-element';
|
|
2
|
-
import { renderComponent } from '../__test__/helpers.js';
|
|
3
|
-
import { ProgressBarShape, ProgressBarThickness, ProgressBarValidationState } from './progress-bar.options.js';
|
|
4
|
-
import './define.js';
|
|
5
|
-
const storyTemplate = html `
|
|
6
|
-
<fluent-progress-bar
|
|
7
|
-
thickness=${x => x.thickness}
|
|
8
|
-
shape=${x => x.shape}
|
|
9
|
-
max=${x => x.max}
|
|
10
|
-
aria-valuemax=${x => x.max}
|
|
11
|
-
aria-valuenow=${x => x.value}
|
|
12
|
-
value=${x => x.value}
|
|
13
|
-
validation-state=${x => x.validationState}
|
|
14
|
-
></fluent-progress-bar>
|
|
15
|
-
`;
|
|
16
|
-
export default {
|
|
17
|
-
title: 'Components/ProgressBar',
|
|
18
|
-
args: {
|
|
19
|
-
max: 100,
|
|
20
|
-
value: 15,
|
|
21
|
-
thickness: 'medium',
|
|
22
|
-
shape: 'rounded',
|
|
23
|
-
validationState: null,
|
|
24
|
-
},
|
|
25
|
-
argTypes: {
|
|
26
|
-
max: {
|
|
27
|
-
control: 'number',
|
|
28
|
-
defaultValue: 100,
|
|
29
|
-
},
|
|
30
|
-
value: {
|
|
31
|
-
control: 'number',
|
|
32
|
-
defaultValue: 15,
|
|
33
|
-
},
|
|
34
|
-
thickness: {
|
|
35
|
-
control: {
|
|
36
|
-
type: 'select',
|
|
37
|
-
},
|
|
38
|
-
options: Object.values(ProgressBarThickness),
|
|
39
|
-
defaultValue: 'medium',
|
|
40
|
-
},
|
|
41
|
-
shape: {
|
|
42
|
-
options: Object.values(ProgressBarShape),
|
|
43
|
-
control: {
|
|
44
|
-
type: 'select',
|
|
45
|
-
},
|
|
46
|
-
defaultValue: 'rounded',
|
|
47
|
-
},
|
|
48
|
-
validationState: {
|
|
49
|
-
options: Object.values(ProgressBarValidationState),
|
|
50
|
-
control: {
|
|
51
|
-
type: 'select',
|
|
52
|
-
},
|
|
53
|
-
defaultValue: null,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
export const Progress = renderComponent(storyTemplate).bind({});
|
|
58
|
-
export const ProgressIndeterminate = renderComponent(html `
|
|
59
|
-
<fluent-progress-bar title="Indeterminate Bar" aria-label="Indeterminate progress bar"></fluent-progress-bar>
|
|
60
|
-
`);
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
`);
|