@fluentui/react-progress 9.0.0-alpha.8 → 9.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +301 -1
- package/CHANGELOG.md +125 -2
- package/README.md +9 -17
- package/dist/index.d.ts +20 -11
- package/lib/components/ProgressBar/ProgressBar.js +0 -1
- package/lib/components/ProgressBar/ProgressBar.js.map +1 -1
- package/lib/components/ProgressBar/ProgressBar.types.js.map +1 -1
- package/lib/components/ProgressBar/renderProgressBar.js +4 -3
- package/lib/components/ProgressBar/renderProgressBar.js.map +1 -1
- package/lib/components/ProgressBar/useProgressBar.js +2 -3
- package/lib/components/ProgressBar/useProgressBar.js.map +1 -1
- package/lib/components/ProgressBar/useProgressBarStyles.js +75 -81
- package/lib/components/ProgressBar/useProgressBarStyles.js.map +1 -1
- package/lib/components/ProgressField/ProgressField.js +15 -15
- package/lib/components/ProgressField/ProgressField.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib-amd/ProgressBar.js +6 -0
- package/lib-amd/ProgressBar.js.map +1 -0
- package/lib-amd/ProgressField.js +6 -0
- package/lib-amd/ProgressField.js.map +1 -0
- package/lib-amd/components/ProgressBar/ProgressBar.js +15 -0
- package/lib-amd/components/ProgressBar/ProgressBar.js.map +1 -0
- package/lib-amd/components/ProgressBar/ProgressBar.types.js +5 -0
- package/lib-amd/components/ProgressBar/ProgressBar.types.js.map +1 -0
- package/lib-amd/components/ProgressBar/index.js +10 -0
- package/lib-amd/components/ProgressBar/index.js.map +1 -0
- package/lib-amd/components/ProgressBar/renderProgressBar.js +14 -0
- package/lib-amd/components/ProgressBar/renderProgressBar.js.map +1 -0
- package/lib-amd/components/ProgressBar/useProgressBar.js +38 -0
- package/lib-amd/components/ProgressBar/useProgressBar.js.map +1 -0
- package/lib-amd/components/ProgressBar/useProgressBarStyles.js +112 -0
- package/lib-amd/components/ProgressBar/useProgressBarStyles.js.map +1 -0
- package/lib-amd/components/ProgressField/ProgressField.js +13 -0
- package/lib-amd/components/ProgressField/ProgressField.js.map +1 -0
- package/lib-amd/components/ProgressField/index.js +6 -0
- package/lib-amd/components/ProgressField/index.js.map +1 -0
- package/lib-amd/index.js +13 -0
- package/lib-amd/index.js.map +1 -0
- package/lib-commonjs/ProgressBar.js +0 -2
- package/lib-commonjs/ProgressBar.js.map +1 -1
- package/lib-commonjs/ProgressField.js +0 -2
- package/lib-commonjs/ProgressField.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/ProgressBar.js +0 -6
- package/lib-commonjs/components/ProgressBar/ProgressBar.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/ProgressBar.types.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/index.js +0 -6
- package/lib-commonjs/components/ProgressBar/index.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/renderProgressBar.js +4 -7
- package/lib-commonjs/components/ProgressBar/renderProgressBar.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/useProgressBar.js +2 -6
- package/lib-commonjs/components/ProgressBar/useProgressBar.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/useProgressBarStyles.js +75 -86
- package/lib-commonjs/components/ProgressBar/useProgressBarStyles.js.map +1 -1
- package/lib-commonjs/components/ProgressField/ProgressField.js +13 -17
- package/lib-commonjs/components/ProgressField/ProgressField.js.map +1 -1
- package/lib-commonjs/components/ProgressField/index.js +0 -2
- package/lib-commonjs/components/ProgressField/index.js.map +1 -1
- package/lib-commonjs/index.js +1 -4
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +10 -10
@@ -0,0 +1,112 @@
|
|
1
|
+
define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-theme", "@fluentui/react-shared-contexts"], function (require, exports, tslib_1, react_1, react_theme_1, react_shared_contexts_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.useProgressBarStyles_unstable = exports.progressBarClassNames = void 0;
|
5
|
+
exports.progressBarClassNames = {
|
6
|
+
root: 'fui-ProgressBar',
|
7
|
+
bar: 'fui-ProgressBar__bar',
|
8
|
+
};
|
9
|
+
// If the percentComplete is near 0, don't animate it.
|
10
|
+
// This prevents animations on reset to 0 scenarios.
|
11
|
+
var ZERO_THRESHOLD = 0.01;
|
12
|
+
var barThicknessValues = {
|
13
|
+
medium: '2px',
|
14
|
+
large: '4px',
|
15
|
+
};
|
16
|
+
var indeterminateProgressBar = {
|
17
|
+
'0%': {
|
18
|
+
left: '-100% /* @noflip */',
|
19
|
+
},
|
20
|
+
'100%': {
|
21
|
+
left: '100% /* @noflip */',
|
22
|
+
},
|
23
|
+
};
|
24
|
+
var indeterminateProgressBarRTL = {
|
25
|
+
'100%': {
|
26
|
+
right: '-100% /* @noflip */',
|
27
|
+
},
|
28
|
+
'0%': {
|
29
|
+
right: '100% /* @noflip */',
|
30
|
+
},
|
31
|
+
};
|
32
|
+
/**
|
33
|
+
* Styles for the root slot
|
34
|
+
*/
|
35
|
+
var useRootStyles = react_1.makeStyles({
|
36
|
+
root: tslib_1.__assign(tslib_1.__assign({ display: 'block', backgroundColor: react_theme_1.tokens.colorNeutralBackground6, justifySelf: 'stretch' }, react_1.shorthands.overflow('hidden')), { '@media screen and (forced-colors: active)': tslib_1.__assign({}, react_1.shorthands.borderBottom('1px', 'solid', 'CanvasText')) }),
|
37
|
+
rounded: tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusMedium)),
|
38
|
+
square: tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusNone)),
|
39
|
+
medium: {
|
40
|
+
height: barThicknessValues.medium,
|
41
|
+
},
|
42
|
+
large: {
|
43
|
+
height: barThicknessValues.large,
|
44
|
+
},
|
45
|
+
});
|
46
|
+
/**
|
47
|
+
* Styles for the ProgressBar bar
|
48
|
+
*/
|
49
|
+
var useBarStyles = react_1.makeStyles({
|
50
|
+
base: tslib_1.__assign({}, react_1.shorthands.borderRadius('inherit')),
|
51
|
+
medium: {
|
52
|
+
height: barThicknessValues.medium,
|
53
|
+
},
|
54
|
+
large: {
|
55
|
+
height: barThicknessValues.large,
|
56
|
+
},
|
57
|
+
nonZeroDeterminate: {
|
58
|
+
transitionProperty: 'width',
|
59
|
+
transitionDuration: '0.3s',
|
60
|
+
transitionTimingFunction: 'ease',
|
61
|
+
},
|
62
|
+
indeterminate: {
|
63
|
+
maxWidth: '33%',
|
64
|
+
position: 'relative',
|
65
|
+
backgroundImage: "linear-gradient(\n to right,\n " + react_theme_1.tokens.colorNeutralBackground6 + " 0%,\n " + react_theme_1.tokens.colorTransparentBackground + " 50%,\n " + react_theme_1.tokens.colorNeutralBackground6 + " 100%\n )",
|
66
|
+
animationName: indeterminateProgressBar,
|
67
|
+
animationDuration: '3s',
|
68
|
+
animationIterationCount: 'infinite',
|
69
|
+
'@media screen and (prefers-reduced-motion: reduce)': {
|
70
|
+
animationDuration: '0.01ms',
|
71
|
+
animationIterationCount: '1',
|
72
|
+
},
|
73
|
+
},
|
74
|
+
rtl: {
|
75
|
+
animationName: indeterminateProgressBarRTL,
|
76
|
+
},
|
77
|
+
brand: {
|
78
|
+
backgroundColor: react_theme_1.tokens.colorCompoundBrandBackground,
|
79
|
+
'@media screen and (forced-colors: active)': {
|
80
|
+
backgroundColor: 'Highlight',
|
81
|
+
},
|
82
|
+
},
|
83
|
+
error: {
|
84
|
+
backgroundColor: react_theme_1.tokens.colorPaletteRedBackground3,
|
85
|
+
},
|
86
|
+
warning: {
|
87
|
+
backgroundColor: react_theme_1.tokens.colorPaletteDarkOrangeBackground3,
|
88
|
+
},
|
89
|
+
success: {
|
90
|
+
backgroundColor: react_theme_1.tokens.colorPaletteGreenBackground3,
|
91
|
+
},
|
92
|
+
});
|
93
|
+
/**
|
94
|
+
* Apply styling to the ProgressBar slots based on the state
|
95
|
+
*/
|
96
|
+
var useProgressBarStyles_unstable = function (state) {
|
97
|
+
var color = state.color, max = state.max, shape = state.shape, thickness = state.thickness, value = state.value;
|
98
|
+
var rootStyles = useRootStyles();
|
99
|
+
var barStyles = useBarStyles();
|
100
|
+
var dir = react_shared_contexts_1.useFluent_unstable().dir;
|
101
|
+
state.root.className = react_1.mergeClasses(exports.progressBarClassNames.root, rootStyles.root, rootStyles[shape], rootStyles[thickness], state.root.className);
|
102
|
+
if (state.bar) {
|
103
|
+
state.bar.className = react_1.mergeClasses(exports.progressBarClassNames.bar, barStyles.base, barStyles.brand, value === undefined && barStyles.indeterminate, value === undefined && dir === 'rtl' && barStyles.rtl, barStyles[thickness], value !== undefined && value > ZERO_THRESHOLD && barStyles.nonZeroDeterminate, color && value !== undefined && barStyles[color], state.bar.className);
|
104
|
+
}
|
105
|
+
if (state.bar && value !== undefined) {
|
106
|
+
state.bar.style = tslib_1.__assign({ width: Math.min(100, Math.max(0, (value / max) * 100)) + '%' }, state.bar.style);
|
107
|
+
}
|
108
|
+
return state;
|
109
|
+
};
|
110
|
+
exports.useProgressBarStyles_unstable = useProgressBarStyles_unstable;
|
111
|
+
});
|
112
|
+
//# sourceMappingURL=useProgressBarStyles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useProgressBarStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-progress/src/components/ProgressBar/useProgressBarStyles.ts"],"names":[],"mappings":";;;;IAMa,QAAA,qBAAqB,GAAqC;QACrE,IAAI,EAAE,iBAAiB;QACvB,GAAG,EAAE,sBAAsB;KAC5B,CAAC;IAEF,sDAAsD;IACtD,oDAAoD;IACpD,IAAM,cAAc,GAAG,IAAI,CAAC;IAE5B,IAAM,kBAAkB,GAAG;QACzB,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,KAAK;KACb,CAAC;IAEF,IAAM,wBAAwB,GAAG;QAC/B,IAAI,EAAE;YACJ,IAAI,EAAE,qBAAqB;SAC5B;QACD,MAAM,EAAE;YACN,IAAI,EAAE,oBAAoB;SAC3B;KACF,CAAC;IACF,IAAM,2BAA2B,GAAG;QAClC,MAAM,EAAE;YACN,KAAK,EAAE,qBAAq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AC,aAAa,EAC9C,KAAK,KAAK,SAAS,IAAI,GAAG,KAAK,KAAK,IAAI,SAAS,CAAC,GAAG,EACrD,SAAS,CAAC,SAAS,CAAC,EACpB,KAAK,KAAK,SAAS,IAAI,KAAK,GAAG,cAAc,IAAI,SAAS,CAAC,kBAAkB,EAC7E,KAAK,IAAI,KAAK,KAAK,SAAS,IAAI,SAAS,CAAC,KAAK,CAAC,EAChD,KAAK,CAAC,GAAG,CAAC,SAAS,CACpB,CAAC;SACH;QAED,IAAI,KAAK,CAAC,GAAG,IAAI,KAAK,KAAK,SAAS,EAAE;YACpC,KAAK,CAAC,GAAG,CAAC,KAAK,sBACb,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,IACzD,KAAK,CAAC,GAAG,CAAC,KAAK,CACnB,CAAC;SACH;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IApCW,QAAA,6BAA6B,iCAoCxC","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport type { ProgressBarState, ProgressBarSlots } from './ProgressBar.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const progressBarClassNames: SlotClassNames<ProgressBarSlots> = {\n root: 'fui-ProgressBar',\n bar: 'fui-ProgressBar__bar',\n};\n\n// If the percentComplete is near 0, don't animate it.\n// This prevents animations on reset to 0 scenarios.\nconst ZERO_THRESHOLD = 0.01;\n\nconst barThicknessValues = {\n medium: '2px',\n large: '4px',\n};\n\nconst indeterminateProgressBar = {\n '0%': {\n left: '-100% /* @noflip */',\n },\n '100%': {\n left: '100% /* @noflip */',\n },\n};\nconst indeterminateProgressBarRTL = {\n '100%': {\n right: '-100% /* @noflip */',\n },\n '0%': {\n right: '100% /* @noflip */',\n },\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n root: {\n display: 'block',\n backgroundColor: tokens.colorNeutralBackground6,\n justifySelf: 'stretch',\n ...shorthands.overflow('hidden'),\n\n '@media screen and (forced-colors: active)': {\n ...shorthands.borderBottom('1px', 'solid', 'CanvasText'),\n },\n },\n rounded: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n square: {\n ...shorthands.borderRadius(tokens.borderRadiusNone),\n },\n medium: {\n height: barThicknessValues.medium,\n },\n large: {\n height: barThicknessValues.large,\n },\n});\n\n/**\n * Styles for the ProgressBar bar\n */\nconst useBarStyles = makeStyles({\n base: {\n ...shorthands.borderRadius('inherit'),\n },\n medium: {\n height: barThicknessValues.medium,\n },\n large: {\n height: barThicknessValues.large,\n },\n nonZeroDeterminate: {\n transitionProperty: 'width',\n transitionDuration: '0.3s',\n transitionTimingFunction: 'ease',\n },\n indeterminate: {\n maxWidth: '33%',\n position: 'relative',\n backgroundImage: `linear-gradient(\n to right,\n ${tokens.colorNeutralBackground6} 0%,\n ${tokens.colorTransparentBackground} 50%,\n ${tokens.colorNeutralBackground6} 100%\n )`,\n animationName: indeterminateProgressBar,\n animationDuration: '3s',\n animationIterationCount: 'infinite',\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationDuration: '0.01ms',\n animationIterationCount: '1',\n },\n },\n\n rtl: {\n animationName: indeterminateProgressBarRTL,\n },\n\n brand: {\n backgroundColor: tokens.colorCompoundBrandBackground,\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'Highlight',\n },\n },\n\n error: {\n backgroundColor: tokens.colorPaletteRedBackground3,\n },\n warning: {\n backgroundColor: tokens.colorPaletteDarkOrangeBackground3,\n },\n success: {\n backgroundColor: tokens.colorPaletteGreenBackground3,\n },\n});\n\n/**\n * Apply styling to the ProgressBar slots based on the state\n */\nexport const useProgressBarStyles_unstable = (state: ProgressBarState): ProgressBarState => {\n const { color, max, shape, thickness, value } = state;\n const rootStyles = useRootStyles();\n const barStyles = useBarStyles();\n const { dir } = useFluent();\n\n state.root.className = mergeClasses(\n progressBarClassNames.root,\n rootStyles.root,\n rootStyles[shape],\n rootStyles[thickness],\n state.root.className,\n );\n\n if (state.bar) {\n state.bar.className = mergeClasses(\n progressBarClassNames.bar,\n barStyles.base,\n barStyles.brand,\n value === undefined && barStyles.indeterminate,\n value === undefined && dir === 'rtl' && barStyles.rtl,\n barStyles[thickness],\n value !== undefined && value > ZERO_THRESHOLD && barStyles.nonZeroDeterminate,\n color && value !== undefined && barStyles[color],\n state.bar.className,\n );\n }\n\n if (state.bar && value !== undefined) {\n state.bar.style = {\n width: Math.min(100, Math.max(0, (value / max) * 100)) + '%',\n ...state.bar.style,\n };\n }\n\n return state;\n};\n"]}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-field", "../../ProgressBar"], function (require, exports, tslib_1, react_field_1, ProgressBar_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.ProgressField = exports.progressFieldClassNames = void 0;
|
5
|
+
/** @deprecated Use Field with ProgressBar: `<Field><ProgressBar /></Field>` */
|
6
|
+
exports.progressFieldClassNames = react_field_1.getDeprecatedFieldClassNames(ProgressBar_1.progressBarClassNames.root);
|
7
|
+
/** @deprecated Use Field with ProgressBar: `<Field><ProgressBar /></Field>` */
|
8
|
+
exports.ProgressField = react_field_1.makeDeprecatedField(ProgressBar_1.ProgressBar, {
|
9
|
+
displayName: 'ProgressField',
|
10
|
+
mapProps: function (props) { return (tslib_1.__assign(tslib_1.__assign({}, props), { control: tslib_1.__assign(tslib_1.__assign({}, props.control), { validationState: props.validationState }) })); },
|
11
|
+
});
|
12
|
+
});
|
13
|
+
//# sourceMappingURL=ProgressField.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ProgressField.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-progress/src/components/ProgressField/ProgressField.tsx"],"names":[],"mappings":";;;;IAOA,+EAA+E;IAClE,QAAA,uBAAuB,GAAG,0CAA4B,CAAC,mCAAqB,CAAC,IAAI,CAAC,CAAC;IAChG,+EAA+E;IAClE,QAAA,aAAa,GAA4C,iCAAmB,CAAC,yBAAW,EAAE;QACrG,WAAW,EAAE,eAAe;QAC5B,QAAQ,EAAE,UAAC,KAAyB,IAAK,OAAA,uCACpC,KAAK,KACR,OAAO,wCAAO,KAAK,CAAC,OAAO,KAAE,eAAe,EAAE,KAAK,CAAC,eAAe,OACnE,EAHuC,CAGvC;KACH,CAAC,CAAC","sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport { DeprecatedFieldProps, getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { ProgressBar, progressBarClassNames, ProgressBarProps } from '../../ProgressBar';\n\n/** @deprecated Use Field with ProgressBar: `<Field><ProgressBar /></Field>` */\nexport type ProgressFieldProps = DeprecatedFieldProps<ProgressBarProps>;\n/** @deprecated Use Field with ProgressBar: `<Field><ProgressBar /></Field>` */\nexport const progressFieldClassNames = getDeprecatedFieldClassNames(progressBarClassNames.root);\n/** @deprecated Use Field with ProgressBar: `<Field><ProgressBar /></Field>` */\nexport const ProgressField: ForwardRefComponent<ProgressFieldProps> = makeDeprecatedField(ProgressBar, {\n displayName: 'ProgressField',\n mapProps: (props: ProgressFieldProps) => ({\n ...props,\n control: { ...props.control, validationState: props.validationState },\n }),\n});\n"]}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
define(["require", "exports", "tslib", "./ProgressField"], function (require, exports, tslib_1, ProgressField_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
tslib_1.__exportStar(ProgressField_1, exports);
|
5
|
+
});
|
6
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-progress/src/components/ProgressField/index.ts"],"names":[],"mappings":";;;IAAA,+CAAgC","sourcesContent":["export * from './ProgressField';\n"]}
|
package/lib-amd/index.js
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
define(["require", "exports", "./ProgressBar", "./ProgressField"], function (require, exports, ProgressBar_1, ProgressField_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.progressFieldClassNames = exports.ProgressField_unstable = exports.useProgressBarStyles_unstable = exports.useProgressBar_unstable = exports.renderProgressBar_unstable = exports.progressBarClassNames = exports.ProgressBar = void 0;
|
5
|
+
Object.defineProperty(exports, "ProgressBar", { enumerable: true, get: function () { return ProgressBar_1.ProgressBar; } });
|
6
|
+
Object.defineProperty(exports, "progressBarClassNames", { enumerable: true, get: function () { return ProgressBar_1.progressBarClassNames; } });
|
7
|
+
Object.defineProperty(exports, "renderProgressBar_unstable", { enumerable: true, get: function () { return ProgressBar_1.renderProgressBar_unstable; } });
|
8
|
+
Object.defineProperty(exports, "useProgressBar_unstable", { enumerable: true, get: function () { return ProgressBar_1.useProgressBar_unstable; } });
|
9
|
+
Object.defineProperty(exports, "useProgressBarStyles_unstable", { enumerable: true, get: function () { return ProgressBar_1.useProgressBarStyles_unstable; } });
|
10
|
+
Object.defineProperty(exports, "ProgressField_unstable", { enumerable: true, get: function () { return ProgressField_1.ProgressField; } });
|
11
|
+
Object.defineProperty(exports, "progressFieldClassNames", { enumerable: true, get: function () { return ProgressField_1.progressFieldClassNames; } });
|
12
|
+
});
|
13
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-progress/src/index.ts"],"names":[],"mappings":";;;;IACE,0GAAA,WAAW,OAAA;IACX,oHAAA,qBAAqB,OAAA;IACrB,yHAAA,0BAA0B,OAAA;IAC1B,sHAAA,uBAAuB,OAAA;IACvB,4HAAA,6BAA6B,OAAA;IAKtB,uHAAA,aAAa,OAA0B;IAAE,wHAAA,uBAAuB,OAAA","sourcesContent":["export {\n ProgressBar,\n progressBarClassNames,\n renderProgressBar_unstable,\n useProgressBar_unstable,\n useProgressBarStyles_unstable,\n} from './ProgressBar';\nexport type { ProgressBarProps, ProgressBarSlots, ProgressBarState } from './ProgressBar';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { ProgressField as ProgressField_unstable, progressFieldClassNames } from './ProgressField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { ProgressFieldProps as ProgressFieldProps_unstable } from './ProgressField';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-progress/src/ProgressBar.ts"],"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-progress/src/ProgressBar.ts"],"sourcesContent":["export * from './components/ProgressBar/index';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-progress/src/ProgressField.ts"],"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-progress/src/ProgressField.ts"],"sourcesContent":["export * from './components/ProgressField/index';\n"]}
|
@@ -4,19 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.ProgressBar = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const useProgressBar_1 = /*#__PURE__*/require("./useProgressBar");
|
11
|
-
|
12
9
|
const renderProgressBar_1 = /*#__PURE__*/require("./renderProgressBar");
|
13
|
-
|
14
10
|
const useProgressBarStyles_1 = /*#__PURE__*/require("./useProgressBarStyles");
|
15
11
|
/**
|
16
12
|
* A ProgressBar bar shows the progression of a task.
|
17
13
|
*/
|
18
|
-
|
19
|
-
|
20
14
|
exports.ProgressBar = /*#__PURE__*/React.forwardRef((props, ref) => {
|
21
15
|
const state = useProgressBar_1.useProgressBar_unstable(props, ref);
|
22
16
|
useProgressBarStyles_1.useProgressBarStyles_unstable(state);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAIA;;;AAGaA,mBAAW,gBAA0CC,KAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAChG,MAAMC,KAAK,GAAGC,wCAAuB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAEjDG,oDAA6B,CAACF,KAAK,CAAC;EACpC,OAAOG,8CAA0B,CAACH,KAAK,CAAC;AAC1C,CAAC,CAAC;AAEFL,mBAAW,CAACS,WAAW,GAAG,aAAa","names":["exports","React","forwardRef","props","ref","state","useProgressBar_1","useProgressBarStyles_1","renderProgressBar_1","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-progress/src/components/ProgressBar/ProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useProgressBar_unstable } from './useProgressBar';\nimport { renderProgressBar_unstable } from './renderProgressBar';\nimport { useProgressBarStyles_unstable } from './useProgressBarStyles';\nimport type { ProgressBarProps } from './ProgressBar.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * A ProgressBar bar shows the progression of a task.\n */\nexport const ProgressBar: ForwardRefComponent<ProgressBarProps> = React.forwardRef((props, ref) => {\n const state = useProgressBar_unstable(props, ref);\n\n useProgressBarStyles_unstable(state);\n return renderProgressBar_unstable(state);\n});\n\nProgressBar.displayName = 'ProgressBar';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
|
@@ -3,16 +3,10 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
|
7
6
|
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
|
-
|
9
7
|
tslib_1.__exportStar(require("./ProgressBar"), exports);
|
10
|
-
|
11
8
|
tslib_1.__exportStar(require("./ProgressBar.types"), exports);
|
12
|
-
|
13
9
|
tslib_1.__exportStar(require("./renderProgressBar"), exports);
|
14
|
-
|
15
10
|
tslib_1.__exportStar(require("./useProgressBar"), exports);
|
16
|
-
|
17
11
|
tslib_1.__exportStar(require("./useProgressBarStyles"), exports);
|
18
12
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-progress/src/components/ProgressBar/index.ts"],"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-progress/src/components/ProgressBar/index.ts"],"sourcesContent":["export * from './ProgressBar';\nexport * from './ProgressBar.types';\nexport * from './renderProgressBar';\nexport * from './useProgressBar';\nexport * from './useProgressBarStyles';\n"]}
|
@@ -4,24 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.renderProgressBar_unstable = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
9
|
/**
|
12
10
|
* Render the final JSX of ProgressBar
|
13
11
|
*/
|
14
|
-
|
15
|
-
|
16
12
|
const renderProgressBar_unstable = state => {
|
17
13
|
const {
|
18
14
|
slots,
|
19
15
|
slotProps
|
20
16
|
} = react_utilities_1.getSlots(state);
|
21
|
-
return React.createElement(slots.root, {
|
22
|
-
|
17
|
+
return React.createElement(slots.root, {
|
18
|
+
...slotProps.root
|
19
|
+
}, slots.bar && React.createElement(slots.bar, {
|
20
|
+
...slotProps.bar
|
23
21
|
}));
|
24
22
|
};
|
25
|
-
|
26
23
|
exports.renderProgressBar_unstable = renderProgressBar_unstable;
|
27
24
|
//# sourceMappingURL=renderProgressBar.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAGA;;;AAGO,MAAMA,0BAA0B,GAAIC,KAAuB,IAAI;EACpE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAmBH,KAAK,CAAC;EAC9D,OAAOI,oBAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAAGJ,KAAK,CAACK,GAAG,IAAIF,oBAACH,KAAK,CAACK,GAAG;IAAA,GAAKJ,SAAS,CAACI;EAAG,EAAI,CAAc;AACrG,CAAC;AAHYC,kCAA0B","names":["renderProgressBar_unstable","state","slots","slotProps","react_utilities_1","React","root","bar","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-progress/src/components/ProgressBar/renderProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { ProgressBarState, ProgressBarSlots } from './ProgressBar.types';\n\n/**\n * Render the final JSX of ProgressBar\n */\nexport const renderProgressBar_unstable = (state: ProgressBarState) => {\n const { slots, slotProps } = getSlots<ProgressBarSlots>(state);\n return <slots.root {...slotProps.root}>{slots.bar && <slots.bar {...slotProps.bar} />}</slots.root>;\n};\n"]}
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useProgressBar_unstable = void 0;
|
7
|
-
|
8
7
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
9
8
|
/**
|
10
9
|
* Create the state required to render ProgressBar.
|
@@ -15,15 +14,13 @@ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
15
14
|
* @param props - props from this instance of ProgressBar
|
16
15
|
* @param ref - reference to root HTMLElement of ProgressBar
|
17
16
|
*/
|
18
|
-
|
19
|
-
|
20
17
|
const useProgressBar_unstable = (props, ref) => {
|
21
18
|
// Props
|
22
19
|
const {
|
20
|
+
color = 'brand',
|
23
21
|
max = 1.0,
|
24
22
|
shape = 'rounded',
|
25
23
|
thickness = 'medium',
|
26
|
-
validationState,
|
27
24
|
value
|
28
25
|
} = props;
|
29
26
|
const root = react_utilities_1.getNativeElementProps('div', {
|
@@ -38,11 +35,11 @@ const useProgressBar_unstable = (props, ref) => {
|
|
38
35
|
required: true
|
39
36
|
});
|
40
37
|
const state = {
|
38
|
+
color,
|
41
39
|
max,
|
42
40
|
shape,
|
43
41
|
thickness,
|
44
42
|
value,
|
45
|
-
validationState,
|
46
43
|
components: {
|
47
44
|
root: 'div',
|
48
45
|
bar: 'div'
|
@@ -52,6 +49,5 @@ const useProgressBar_unstable = (props, ref) => {
|
|
52
49
|
};
|
53
50
|
return state;
|
54
51
|
};
|
55
|
-
|
56
52
|
exports.useProgressBar_unstable = useProgressBar_unstable;
|
57
53
|
//# sourceMappingURL=useProgressBar.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AACA;AAGA;;;;;;;;;AASO,MAAMA,uBAAuB,GAAG,CAACC,KAAuB,EAAEC,GAA2B,KAAsB;EAChH;EACA,MAAM;IAAEC,KAAK,GAAG,OAAO;IAAEC,GAAG,GAAG,GAAG;IAAEC,KAAK,GAAG,SAAS;IAAEC,SAAS,GAAG,QAAQ;IAAEC;EAAK,CAAE,GAAGN,KAAK;EAE5F,MAAMO,IAAI,GAAGC,uCAAqB,CAAC,KAAK,EAAE;IACxCP,GAAG;IACHQ,IAAI,EAAE,aAAa;IACnB,eAAe,EAAEH,KAAK,KAAKI,SAAS,GAAG,CAAC,GAAGA,SAAS;IACpD,eAAe,EAAEJ,KAAK,KAAKI,SAAS,GAAGP,GAAG,GAAGO,SAAS;IACtD,eAAe,EAAEJ,KAAK;IACtB,GAAGN;GACJ,CAAC;EAEF,MAAMW,GAAG,GAAGH,kCAAgB,CAACR,KAAK,CAACW,GAAG,EAAE;IACtCC,QAAQ,EAAE;GACX,CAAC;EAEF,MAAMC,KAAK,GAAqB;IAC9BX,KAAK;IACLC,GAAG;IACHC,KAAK;IACLC,SAAS;IACTC,KAAK;IACLQ,UAAU,EAAE;MACVP,IAAI,EAAE,KAAK;MACXI,GAAG,EAAE;KACN;IACDJ,IAAI;IACJI;GACD;EAED,OAAOE,KAAK;AACd,CAAC;AAhCYE,+BAAuB","names":["useProgressBar_unstable","props","ref","color","max","shape","thickness","value","root","react_utilities_1","role","undefined","bar","required","state","components","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-progress/src/components/ProgressBar/useProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport type { ProgressBarProps, ProgressBarState } from './ProgressBar.types';\n\n/**\n * Create the state required to render ProgressBar.\n *\n * The returned state can be modified with hooks such as useProgressBarStyles_unstable,\n * before being passed to renderProgressBar_unstable.\n *\n * @param props - props from this instance of ProgressBar\n * @param ref - reference to root HTMLElement of ProgressBar\n */\nexport const useProgressBar_unstable = (props: ProgressBarProps, ref: React.Ref<HTMLElement>): ProgressBarState => {\n // Props\n const { color = 'brand', max = 1.0, shape = 'rounded', thickness = 'medium', value } = props;\n\n const root = getNativeElementProps('div', {\n ref,\n role: 'progressbar',\n 'aria-valuemin': value !== undefined ? 0 : undefined,\n 'aria-valuemax': value !== undefined ? max : undefined,\n 'aria-valuenow': value,\n ...props,\n });\n\n const bar = resolveShorthand(props.bar, {\n required: true,\n });\n\n const state: ProgressBarState = {\n color,\n max,\n shape,\n thickness,\n value,\n components: {\n root: 'div',\n bar: 'div',\n },\n root,\n bar,\n };\n\n return state;\n};\n"]}
|