@fluentui/web-components 3.0.0-alpha.2 → 3.0.0-alpha.4
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 +168 -4
- package/CHANGELOG.md +153 -98
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/spinner/define.d.ts +1 -0
- package/dist/dts/spinner/index.d.ts +5 -0
- package/dist/dts/spinner/spinner.d.ts +25 -0
- package/dist/dts/spinner/spinner.definition.d.ts +11 -0
- package/dist/dts/spinner/spinner.options.d.ts +32 -0
- package/dist/dts/spinner/spinner.styles.d.ts +1 -0
- package/dist/dts/spinner/spinner.template.d.ts +3 -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 +2 -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 +4 -0
- package/dist/esm/spinner/define.js.map +1 -0
- package/dist/esm/spinner/index.js +6 -0
- package/dist/esm/spinner/index.js.map +1 -0
- package/dist/esm/spinner/spinner.definition.js +19 -0
- package/dist/esm/spinner/spinner.definition.js.map +1 -0
- package/dist/esm/spinner/spinner.js +16 -0
- package/dist/esm/spinner/spinner.js.map +1 -0
- package/dist/esm/spinner/spinner.options.js +22 -0
- package/dist/esm/spinner/spinner.options.js.map +1 -0
- package/dist/esm/spinner/spinner.styles.js +96 -0
- package/dist/esm/spinner/spinner.styles.js.map +1 -0
- package/dist/esm/spinner/spinner.template.js +22 -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 +322 -7
- package/dist/web-components.d.ts +79 -3
- package/dist/web-components.js +247 -1228
- package/dist/web-components.min.js +65 -76
- package/docs/api-report.md +43 -3
- package/package.json +15 -14
- 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/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/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
|
@@ -10,6 +10,7 @@ import { ElementViewTemplate } from '@microsoft/fast-element';
|
|
|
10
10
|
import { FASTElement } from '@microsoft/fast-element';
|
|
11
11
|
import { FASTElementDefinition } from '@microsoft/fast-element';
|
|
12
12
|
import { FASTProgress } from '@microsoft/fast-foundation';
|
|
13
|
+
import { FASTProgressRing } from '@microsoft/fast-foundation';
|
|
13
14
|
import { StartEnd } from '@microsoft/fast-foundation';
|
|
14
15
|
import { StartEndOptions } from '@microsoft/fast-foundation';
|
|
15
16
|
import { StaticallyComposableHTML } from '@microsoft/fast-foundation';
|
|
@@ -1203,14 +1204,15 @@ export const lineHeightHero800: CSSDesignToken<string>;
|
|
|
1203
1204
|
export const lineHeightHero900: CSSDesignToken<string>;
|
|
1204
1205
|
|
|
1205
1206
|
// @public
|
|
1206
|
-
|
|
1207
|
+
class ProgressBar_2 extends FASTProgress {
|
|
1207
1208
|
shape: ProgressBarShape;
|
|
1208
1209
|
thickness: ProgressBarThickness;
|
|
1209
1210
|
validationState: ProgressBarValidationState | null;
|
|
1210
1211
|
}
|
|
1212
|
+
export { ProgressBar_2 as ProgressBar }
|
|
1211
1213
|
|
|
1212
1214
|
// @public
|
|
1213
|
-
export const ProgressBarDefinition: FASTElementDefinition<typeof
|
|
1215
|
+
export const ProgressBarDefinition: FASTElementDefinition<typeof ProgressBar_2>;
|
|
1214
1216
|
|
|
1215
1217
|
// @public
|
|
1216
1218
|
export const ProgressBarShape: {
|
|
@@ -1225,7 +1227,7 @@ export type ProgressBarShape = ValuesOf<typeof ProgressBarShape>;
|
|
|
1225
1227
|
export const ProgressBarStyles: ElementStyles;
|
|
1226
1228
|
|
|
1227
1229
|
// @public (undocumented)
|
|
1228
|
-
export const ProgressBarTemplate: ElementViewTemplate<
|
|
1230
|
+
export const ProgressBarTemplate: ElementViewTemplate<ProgressBar_2>;
|
|
1229
1231
|
|
|
1230
1232
|
// @public
|
|
1231
1233
|
export const ProgressBarThickness: {
|
|
@@ -1351,6 +1353,44 @@ export const spacingVerticalXXS: CSSDesignToken<string>;
|
|
|
1351
1353
|
// @public (undocumented)
|
|
1352
1354
|
export const spacingVerticalXXXL: CSSDesignToken<string>;
|
|
1353
1355
|
|
|
1356
|
+
// @public
|
|
1357
|
+
export class Spinner extends FASTProgressRing {
|
|
1358
|
+
appearance: SpinnerAppearance;
|
|
1359
|
+
size: SpinnerSize;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
// @public
|
|
1363
|
+
export const SpinnerAppearance: {
|
|
1364
|
+
readonly primary: "primary";
|
|
1365
|
+
readonly inverted: "inverted";
|
|
1366
|
+
};
|
|
1367
|
+
|
|
1368
|
+
// @public
|
|
1369
|
+
export type SpinnerAppearance = ValuesOf<typeof SpinnerAppearance>;
|
|
1370
|
+
|
|
1371
|
+
// @public
|
|
1372
|
+
export const SpinnerDefinition: FASTElementDefinition<typeof Spinner>;
|
|
1373
|
+
|
|
1374
|
+
// @public
|
|
1375
|
+
export const SpinnerSize: {
|
|
1376
|
+
readonly tiny: "tiny";
|
|
1377
|
+
readonly extraSmall: "extra-small";
|
|
1378
|
+
readonly small: "small";
|
|
1379
|
+
readonly medium: "medium";
|
|
1380
|
+
readonly large: "large";
|
|
1381
|
+
readonly extraLarge: "extra-large";
|
|
1382
|
+
readonly huge: "huge";
|
|
1383
|
+
};
|
|
1384
|
+
|
|
1385
|
+
// @public
|
|
1386
|
+
export type SpinnerSize = ValuesOf<typeof SpinnerSize>;
|
|
1387
|
+
|
|
1388
|
+
// @public (undocumented)
|
|
1389
|
+
export const SpinnerStyles: ElementStyles;
|
|
1390
|
+
|
|
1391
|
+
// @public (undocumented)
|
|
1392
|
+
export const SpinnerTemplate: ElementViewTemplate<Spinner>;
|
|
1393
|
+
|
|
1354
1394
|
// @public (undocumented)
|
|
1355
1395
|
export const strokeWidthThick: CSSDesignToken<string>;
|
|
1356
1396
|
|
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.4",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Microsoft",
|
|
8
8
|
"url": "https://discord.gg/FcSNfg4"
|
|
@@ -39,27 +39,28 @@
|
|
|
39
39
|
"./progress-bar": {
|
|
40
40
|
"types": "./dist/esm/progress-bar/define.d.ts",
|
|
41
41
|
"default": "./dist/esm/progress-bar/define.js"
|
|
42
|
+
},
|
|
43
|
+
"./spinner": {
|
|
44
|
+
"types": "./dist/esm/spinner/define.d.ts",
|
|
45
|
+
"default": "./dist/esm/spinner/define.js"
|
|
42
46
|
}
|
|
43
47
|
},
|
|
44
48
|
"scripts": {
|
|
45
49
|
"tsc": "tsc",
|
|
46
50
|
"api-extractor": "api-extractor",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"build": "
|
|
51
|
-
"dev": "tsc -p ./tsconfig.json -w",
|
|
52
|
-
"tdd": "yarn dev & yarn test-chrome:watch",
|
|
53
|
-
"prepare": "yarn clean && yarn build",
|
|
51
|
+
"compile": "node ./scripts/compile",
|
|
52
|
+
"clean": "node ./scripts/clean dist",
|
|
53
|
+
"generate-api": "api-extractor run --local",
|
|
54
|
+
"build": "yarn compile && rollup -c && yarn generate-api",
|
|
54
55
|
"lint": "eslint . --ext .ts",
|
|
55
56
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
56
57
|
"format": "prettier -w 'src/**/(*.ts|*.html)' --ignore-path ../../.prettierignore",
|
|
57
58
|
"format:check": "yarn format -c",
|
|
58
59
|
"code-style": "yarn format:check && yarn lint",
|
|
59
|
-
"start": "yarn start-storybook -p 6006 --docs",
|
|
60
|
+
"start": "yarn start-storybook -p 6006 --docs --no-manager-cache",
|
|
60
61
|
"start-storybook": "node node_modules/@storybook/html/bin/index",
|
|
61
62
|
"build-storybook": "node node_modules/@storybook/html/bin/build -o ./dist/storybook --docs",
|
|
62
|
-
"test": "yarn
|
|
63
|
+
"test": "yarn test-chrome:verbose",
|
|
63
64
|
"test-node": "mocha --reporter min --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'",
|
|
64
65
|
"test-node:verbose": "mocha --reporter spec --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'",
|
|
65
66
|
"test-chrome": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --single-run --coverage",
|
|
@@ -72,7 +73,7 @@
|
|
|
72
73
|
"test-firefox:verbose": "karma start karma.conf.cjs --browsers=FirefoxHeadless --single-run --coverage --reporter=mocha"
|
|
73
74
|
},
|
|
74
75
|
"devDependencies": {
|
|
75
|
-
"@storybook/html": "6.5.
|
|
76
|
+
"@storybook/html": "6.5.15",
|
|
76
77
|
"@types/chai": "4.3.3",
|
|
77
78
|
"@types/chai-spies": "1.0.3",
|
|
78
79
|
"@types/karma": "6.3.3",
|
|
@@ -100,11 +101,11 @@
|
|
|
100
101
|
"typescript": "4.7.4"
|
|
101
102
|
},
|
|
102
103
|
"dependencies": {
|
|
103
|
-
"@microsoft/fast-element": "^2.0.0-beta.
|
|
104
|
-
"@microsoft/fast-foundation": "^3.0.0-alpha.
|
|
104
|
+
"@microsoft/fast-element": "^2.0.0-beta.21",
|
|
105
|
+
"@microsoft/fast-foundation": "^3.0.0-alpha.25",
|
|
105
106
|
"@microsoft/fast-web-utilities": "^6.0.0",
|
|
106
107
|
"@fluentui/tokens": "1.0.0-alpha.2",
|
|
107
|
-
"tslib": "^1.
|
|
108
|
+
"tslib": "^2.1.0"
|
|
108
109
|
},
|
|
109
110
|
"beachball": {
|
|
110
111
|
"disallowedChangeTypes": [
|
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 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
|
-
`);
|