@fluentui/react-progress 9.0.0-alpha.9 → 9.1.0

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.
Files changed (79) hide show
  1. package/CHANGELOG.json +319 -1
  2. package/CHANGELOG.md +132 -2
  3. package/README.md +9 -17
  4. package/dist/index.d.ts +20 -11
  5. package/lib/components/ProgressBar/ProgressBar.js +5 -1
  6. package/lib/components/ProgressBar/ProgressBar.js.map +1 -1
  7. package/lib/components/ProgressBar/ProgressBar.types.js.map +1 -1
  8. package/lib/components/ProgressBar/renderProgressBar.js +4 -3
  9. package/lib/components/ProgressBar/renderProgressBar.js.map +1 -1
  10. package/lib/components/ProgressBar/useProgressBar.js +7 -6
  11. package/lib/components/ProgressBar/useProgressBar.js.map +1 -1
  12. package/lib/components/ProgressBar/useProgressBarStyles.js +65 -82
  13. package/lib/components/ProgressBar/useProgressBarStyles.js.map +1 -1
  14. package/lib/components/ProgressField/ProgressField.js +15 -15
  15. package/lib/components/ProgressField/ProgressField.js.map +1 -1
  16. package/lib/index.js +1 -0
  17. package/lib/index.js.map +1 -1
  18. package/lib/utils/clampMax.js +11 -0
  19. package/lib/utils/clampMax.js.map +1 -0
  20. package/lib/utils/clampValue.js +18 -0
  21. package/lib/utils/clampValue.js.map +1 -0
  22. package/lib/utils/index.js +3 -0
  23. package/lib/utils/index.js.map +1 -0
  24. package/lib-amd/ProgressBar.js +6 -0
  25. package/lib-amd/ProgressBar.js.map +1 -0
  26. package/lib-amd/ProgressField.js +6 -0
  27. package/lib-amd/ProgressField.js.map +1 -0
  28. package/lib-amd/components/ProgressBar/ProgressBar.js +17 -0
  29. package/lib-amd/components/ProgressBar/ProgressBar.js.map +1 -0
  30. package/lib-amd/components/ProgressBar/ProgressBar.types.js +5 -0
  31. package/lib-amd/components/ProgressBar/ProgressBar.types.js.map +1 -0
  32. package/lib-amd/components/ProgressBar/index.js +10 -0
  33. package/lib-amd/components/ProgressBar/index.js.map +1 -0
  34. package/lib-amd/components/ProgressBar/renderProgressBar.js +14 -0
  35. package/lib-amd/components/ProgressBar/renderProgressBar.js.map +1 -0
  36. package/lib-amd/components/ProgressBar/useProgressBar.js +41 -0
  37. package/lib-amd/components/ProgressBar/useProgressBar.js.map +1 -0
  38. package/lib-amd/components/ProgressBar/useProgressBarStyles.js +107 -0
  39. package/lib-amd/components/ProgressBar/useProgressBarStyles.js.map +1 -0
  40. package/lib-amd/components/ProgressField/ProgressField.js +13 -0
  41. package/lib-amd/components/ProgressField/ProgressField.js.map +1 -0
  42. package/lib-amd/components/ProgressField/index.js +6 -0
  43. package/lib-amd/components/ProgressField/index.js.map +1 -0
  44. package/lib-amd/index.js +13 -0
  45. package/lib-amd/index.js.map +1 -0
  46. package/lib-amd/utils/clampMax.js +17 -0
  47. package/lib-amd/utils/clampMax.js.map +1 -0
  48. package/lib-amd/utils/clampValue.js +24 -0
  49. package/lib-amd/utils/clampValue.js.map +1 -0
  50. package/lib-amd/utils/index.js +7 -0
  51. package/lib-amd/utils/index.js.map +1 -0
  52. package/lib-commonjs/ProgressBar.js +0 -2
  53. package/lib-commonjs/ProgressBar.js.map +1 -1
  54. package/lib-commonjs/ProgressField.js +0 -2
  55. package/lib-commonjs/ProgressField.js.map +1 -1
  56. package/lib-commonjs/components/ProgressBar/ProgressBar.js +5 -6
  57. package/lib-commonjs/components/ProgressBar/ProgressBar.js.map +1 -1
  58. package/lib-commonjs/components/ProgressBar/ProgressBar.types.js.map +1 -1
  59. package/lib-commonjs/components/ProgressBar/index.js +0 -6
  60. package/lib-commonjs/components/ProgressBar/index.js.map +1 -1
  61. package/lib-commonjs/components/ProgressBar/renderProgressBar.js +4 -7
  62. package/lib-commonjs/components/ProgressBar/renderProgressBar.js.map +1 -1
  63. package/lib-commonjs/components/ProgressBar/useProgressBar.js +7 -9
  64. package/lib-commonjs/components/ProgressBar/useProgressBar.js.map +1 -1
  65. package/lib-commonjs/components/ProgressBar/useProgressBarStyles.js +65 -87
  66. package/lib-commonjs/components/ProgressBar/useProgressBarStyles.js.map +1 -1
  67. package/lib-commonjs/components/ProgressField/ProgressField.js +13 -17
  68. package/lib-commonjs/components/ProgressField/ProgressField.js.map +1 -1
  69. package/lib-commonjs/components/ProgressField/index.js +0 -2
  70. package/lib-commonjs/components/ProgressField/index.js.map +1 -1
  71. package/lib-commonjs/index.js +1 -4
  72. package/lib-commonjs/index.js.map +1 -1
  73. package/lib-commonjs/utils/clampMax.js +18 -0
  74. package/lib-commonjs/utils/clampMax.js.map +1 -0
  75. package/lib-commonjs/utils/clampValue.js +25 -0
  76. package/lib-commonjs/utils/clampValue.js.map +1 -0
  77. package/lib-commonjs/utils/index.js +9 -0
  78. package/lib-commonjs/utils/index.js.map +1 -0
  79. package/package.json +9 -9
@@ -0,0 +1,107 @@
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, width: '100%' }, react_1.shorthands.overflow('hidden')), { '@media screen and (forced-colors: active)': {
37
+ backgroundColor: 'CanvasText',
38
+ } }),
39
+ rounded: tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusMedium)),
40
+ square: tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusNone)),
41
+ medium: {
42
+ height: barThicknessValues.medium,
43
+ },
44
+ large: {
45
+ height: barThicknessValues.large,
46
+ },
47
+ });
48
+ /**
49
+ * Styles for the ProgressBar bar
50
+ */
51
+ var useBarStyles = react_1.makeStyles({
52
+ base: tslib_1.__assign(tslib_1.__assign({ '@media screen and (forced-colors: active)': {
53
+ backgroundColor: 'Highlight',
54
+ } }, react_1.shorthands.borderRadius('inherit')), { height: '100%' }),
55
+ nonZeroDeterminate: {
56
+ transitionProperty: 'width',
57
+ transitionDuration: '0.3s',
58
+ transitionTimingFunction: 'ease',
59
+ },
60
+ indeterminate: {
61
+ maxWidth: '33%',
62
+ position: 'relative',
63
+ 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 )",
64
+ animationName: indeterminateProgressBar,
65
+ animationDuration: '3s',
66
+ animationIterationCount: 'infinite',
67
+ '@media screen and (prefers-reduced-motion: reduce)': {
68
+ animationDuration: '0.01ms',
69
+ animationIterationCount: '1',
70
+ },
71
+ },
72
+ rtl: {
73
+ animationName: indeterminateProgressBarRTL,
74
+ },
75
+ brand: {
76
+ backgroundColor: react_theme_1.tokens.colorCompoundBrandBackground,
77
+ },
78
+ error: {
79
+ backgroundColor: react_theme_1.tokens.colorPaletteRedBackground3,
80
+ },
81
+ warning: {
82
+ backgroundColor: react_theme_1.tokens.colorPaletteDarkOrangeBackground3,
83
+ },
84
+ success: {
85
+ backgroundColor: react_theme_1.tokens.colorPaletteGreenBackground3,
86
+ },
87
+ });
88
+ /**
89
+ * Apply styling to the ProgressBar slots based on the state
90
+ */
91
+ var useProgressBarStyles_unstable = function (state) {
92
+ var color = state.color, max = state.max, shape = state.shape, thickness = state.thickness, value = state.value;
93
+ var rootStyles = useRootStyles();
94
+ var barStyles = useBarStyles();
95
+ var dir = react_shared_contexts_1.useFluent_unstable().dir;
96
+ state.root.className = react_1.mergeClasses(exports.progressBarClassNames.root, rootStyles.root, rootStyles[shape], rootStyles[thickness], state.root.className);
97
+ if (state.bar) {
98
+ state.bar.className = react_1.mergeClasses(exports.progressBarClassNames.bar, barStyles.base, barStyles.brand, value === undefined && barStyles.indeterminate, value === undefined && dir === 'rtl' && barStyles.rtl, value !== undefined && value > ZERO_THRESHOLD && barStyles.nonZeroDeterminate, color && value !== undefined && barStyles[color], state.bar.className);
99
+ }
100
+ if (state.bar && value !== undefined) {
101
+ state.bar.style = tslib_1.__assign({ width: Math.min(100, Math.max(0, (value / max) * 100)) + '%' }, state.bar.style);
102
+ }
103
+ return state;
104
+ };
105
+ exports.useProgressBarStyles_unstable = useProgressBarStyles_unstable;
106
+ });
107
+ //# 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,MA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AC9C,KAAK,KAAK,SAAS,IAAI,GAAG,KAAK,KAAK,IAAI,SAAS,CAAC,GAAG,EACrD,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;IAnCW,QAAA,6BAA6B,iCAmCxC","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 width: '100%',\n ...shorthands.overflow('hidden'),\n\n '@media screen and (forced-colors: active)': {\n backgroundColor: '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 '@media screen and (forced-colors: active)': {\n backgroundColor: 'Highlight',\n },\n ...shorthands.borderRadius('inherit'),\n height: '100%',\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 },\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 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"]}
@@ -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"]}
@@ -0,0 +1,17 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.clampMax = void 0;
5
+ var clampMax = function (max) {
6
+ var internalMax = max <= 0 ? 1 : max;
7
+ if (process.env.NODE_ENV !== 'production') {
8
+ if (max <= 0) {
9
+ // eslint-disable-next-line no-console
10
+ console.error("The prop 'max' must be greater than 0. Received max: " + max);
11
+ }
12
+ }
13
+ return internalMax;
14
+ };
15
+ exports.clampMax = clampMax;
16
+ });
17
+ //# sourceMappingURL=clampMax.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clampMax.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-progress/src/utils/clampMax.ts"],"names":[],"mappings":";;;;IAAO,IAAM,QAAQ,GAAG,UAAC,GAAW;QAClC,IAAM,WAAW,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QAEvC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;YACzC,IAAI,GAAG,IAAI,CAAC,EAAE;gBACZ,sCAAsC;gBACtC,OAAO,CAAC,KAAK,CAAC,0DAAwD,GAAK,CAAC,CAAC;aAC9E;SACF;QACD,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC;IAVW,QAAA,QAAQ,YAUnB","sourcesContent":["export const clampMax = (max: number): number => {\n const internalMax = max <= 0 ? 1 : max;\n\n if (process.env.NODE_ENV !== 'production') {\n if (max <= 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'max' must be greater than 0. Received max: ${max}`);\n }\n }\n return internalMax;\n};\n"]}
@@ -0,0 +1,24 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.clampValue = void 0;
5
+ var clampValue = function (value, max) {
6
+ if (value === undefined) {
7
+ return value;
8
+ }
9
+ var internalValue = value < 0 ? 0 : value > max ? max : value;
10
+ if (process.env.NODE_ENV !== 'production') {
11
+ if (value < 0) {
12
+ // eslint-disable-next-line no-console
13
+ console.error("The prop 'value' must be greater than or equal to zero. Received value: " + value);
14
+ }
15
+ if (value > max) {
16
+ // eslint-disable-next-line no-console
17
+ console.error("The prop 'value' must be less than or equal to 'max'. Received value: " + value + ", max: " + max);
18
+ }
19
+ }
20
+ return internalValue;
21
+ };
22
+ exports.clampValue = clampValue;
23
+ });
24
+ //# sourceMappingURL=clampValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clampValue.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-progress/src/utils/clampValue.ts"],"names":[],"mappings":";;;;IAAO,IAAM,UAAU,GAAG,UAAC,KAAyB,EAAE,GAAW;QAC/D,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;QACD,IAAM,aAAa,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;QAEhE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;YACzC,IAAI,KAAK,GAAG,CAAC,EAAE;gBACb,sCAAsC;gBACtC,OAAO,CAAC,KAAK,CAAC,6EAA2E,KAAO,CAAC,CAAC;aACnG;YACD,IAAI,KAAK,GAAG,GAAG,EAAE;gBACf,sCAAsC;gBACtC,OAAO,CAAC,KAAK,CAAC,2EAAyE,KAAK,eAAU,GAAK,CAAC,CAAC;aAC9G;SACF;QACD,OAAO,aAAa,CAAC;IACvB,CAAC,CAAC;IAjBW,QAAA,UAAU,cAiBrB","sourcesContent":["export const clampValue = (value: number | undefined, max: number): number | undefined => {\n if (value === undefined) {\n return value;\n }\n const internalValue = value < 0 ? 0 : value > max ? max : value;\n\n if (process.env.NODE_ENV !== 'production') {\n if (value < 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be greater than or equal to zero. Received value: ${value}`);\n }\n if (value > max) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be less than or equal to 'max'. Received value: ${value}, max: ${max}`);\n }\n }\n return internalValue;\n};\n"]}
@@ -0,0 +1,7 @@
1
+ define(["require", "exports", "tslib", "./clampMax", "./clampValue"], function (require, exports, tslib_1, clampMax_1, clampValue_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(clampMax_1, exports);
5
+ tslib_1.__exportStar(clampValue_1, exports);
6
+ });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-progress/src/utils/index.ts"],"names":[],"mappings":";;;IAAA,0CAA2B;IAC3B,4CAA6B","sourcesContent":["export * from './clampMax';\nexport * from './clampValue';\n"]}
@@ -3,8 +3,6 @@
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("./components/ProgressBar/index"), exports);
10
8
  //# sourceMappingURL=ProgressBar.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-progress/src/ProgressBar.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/ProgressBar/index';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-progress/src/ProgressBar.ts"],"sourcesContent":["export * from './components/ProgressBar/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,oCAAAC,OAAA"}
@@ -3,8 +3,6 @@
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("./components/ProgressField/index"), exports);
10
8
  //# sourceMappingURL=ProgressField.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-progress/src/ProgressField.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/ProgressField/index';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-progress/src/ProgressField.ts"],"sourcesContent":["export * from './components/ProgressField/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,sCAAAC,OAAA"}
@@ -4,22 +4,21 @@ 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");
11
+ const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
15
12
  /**
16
13
  * A ProgressBar bar shows the progression of a task.
17
14
  */
18
-
19
-
20
15
  exports.ProgressBar = /*#__PURE__*/React.forwardRef((props, ref) => {
21
16
  const state = useProgressBar_1.useProgressBar_unstable(props, ref);
22
17
  useProgressBarStyles_1.useProgressBarStyles_unstable(state);
18
+ const {
19
+ useProgressBarStyles_unstable: useCustomStyles
20
+ } = react_shared_contexts_1.useCustomStyleHooks_unstable();
21
+ useCustomStyles(state);
23
22
  return renderProgressBar_1.renderProgressBar_unstable(state);
24
23
  });
25
24
  exports.ProgressBar.displayName = 'ProgressBar';
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-progress/src/components/ProgressBar/ProgressBar.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,WAAA,gBAAqD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAChG,MAAM,KAAK,GAAG,gBAAA,CAAA,uBAAA,CAAwB,KAAxB,EAA+B,GAA/B,CAAd;EAEA,sBAAA,CAAA,6BAAA,CAA8B,KAA9B;EACA,OAAO,mBAAA,CAAA,0BAAA,CAA2B,KAA3B,CAAP;AACD,CALiE,CAArD;AAOb,OAAA,CAAA,WAAA,CAAY,WAAZ,GAA0B,aAA1B","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"names":["React","require","useProgressBar_1","renderProgressBar_1","useProgressBarStyles_1","react_shared_contexts_1","exports","ProgressBar","forwardRef","props","ref","state","useProgressBar_unstable","useProgressBarStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderProgressBar_unstable","displayName"],"sources":["../src/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';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\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\n const { useProgressBarStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderProgressBar_unstable(state);\n});\n\nProgressBar.displayName = 'ProgressBar';\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,gBAAA,gBAAAD,OAAA;AACA,MAAAE,mBAAA,gBAAAF,OAAA;AACA,MAAAG,sBAAA,gBAAAH,OAAA;AAGA,MAAAI,uBAAA,gBAAAJ,OAAA;AAEA;;;AAGaK,OAAA,CAAAC,WAAW,gBAA0CP,KAAK,CAACQ,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAChG,MAAMC,KAAK,GAAGT,gBAAA,CAAAU,uBAAuB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAEjDN,sBAAA,CAAAS,6BAA6B,CAACF,KAAK,CAAC;EAEpC,MAAM;IAAEE,6BAA6B,EAAEC;EAAe,CAAE,GAAGT,uBAAA,CAAAU,4BAA4B,EAAE;EACzFD,eAAe,CAACH,KAAK,CAAC;EAEtB,OAAOR,mBAAA,CAAAa,0BAA0B,CAACL,KAAK,CAAC;AAC1C,CAAC,CAAC;AAEFL,OAAA,CAAAC,WAAW,CAACU,WAAW,GAAG,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
1
+ {"version":3,"names":[],"sources":["../src/packages/react-components/react-progress/src/components/ProgressBar/ProgressBar.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ProgressBarSlots = {\n /**\n * The track behind the ProgressBar bar\n */\n root: NonNullable<Slot<'div'>>;\n /**\n * The filled portion of the ProgressBar bar. Animated in the indeterminate state, when no value is provided.\n */\n bar?: NonNullable<Slot<'div'>>;\n};\n\n/**\n * ProgressBar Props\n */\nexport type ProgressBarProps = Omit<ComponentProps<ProgressBarSlots>, 'size'> & {\n /**\n * The shape of the bar and track.\n * @default rounded\n */\n shape?: 'rounded' | 'square';\n /**\n * A decimal number between `0` and `1` (or between `0` and `max` if given),\n * which specifies how much of the task has been completed.\n *\n * If `undefined` (default), the ProgressBar will display an **indeterminate** state.\n */\n value?: number;\n /**\n * The maximum value, which indicates the task is complete.\n * The ProgressBar bar will be full when `value` equals `max`.\n * @default 1\n */\n max?: number;\n /**\n * The thickness of the ProgressBar bar\n * @default medium\n */\n thickness?: 'medium' | 'large';\n\n /**\n * The status of the ProgressBar bar. Changes the color of the bar.\n * @default brand\n */\n color?: 'brand' | 'success' | 'warning' | 'error';\n};\n\n/**\n * State used in rendering ProgressBar\n */\nexport type ProgressBarState = ComponentState<ProgressBarSlots> &\n Required<Pick<ProgressBarProps, 'max' | 'shape' | 'thickness'>> &\n Pick<ProgressBarProps, 'value' | 'color'>;\n"],"mappings":""}
@@ -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"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './ProgressBar';\nexport * from './ProgressBar.types';\nexport * from './renderProgressBar';\nexport * from './useProgressBar';\nexport * from './useProgressBarStyles';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/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"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,mBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,yBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,yBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,sBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,4BAAAC,OAAA"}
@@ -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, { ...slotProps.root
22
- }, slots.bar && React.createElement(slots.bar, { ...slotProps.bar
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,"sources":["packages/react-components/react-progress/src/components/ProgressBar/renderProgressBar.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,0BAA0B,GAAI,KAAD,IAA4B;EACpE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAA2B,KAA3B,CAA7B;EACA,OAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EAAiC,KAAK,CAAC,GAAN,IAAa,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,GAAP,EAAU,EAAA,GAAK,SAAS,CAAC;EAAf,CAAV,CAA9C,CAAP;AACD,CAHM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"names":["React","require","react_utilities_1","renderProgressBar_unstable","state","slots","slotProps","getSlots","createElement","root","bar","exports"],"sources":["../src/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"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,0BAA0B,GAAIC,KAAuB,IAAI;EACpE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,iBAAA,CAAAK,QAAQ,CAAmBH,KAAK,CAAC;EAC9D,OAAOJ,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAAGJ,KAAK,CAACK,GAAG,IAAIV,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACK,GAAG;IAAA,GAAKJ,SAAS,CAACI;EAAG,EAAI,CAAc;AACrG,CAAC;AAHYC,OAAA,CAAAR,0BAA0B,GAAAA,0BAAA"}
@@ -4,8 +4,8 @@ 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");
8
+ const index_1 = /*#__PURE__*/require("../../utils/index");
9
9
  /**
10
10
  * Create the state required to render ProgressBar.
11
11
  *
@@ -15,17 +15,16 @@ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
15
15
  * @param props - props from this instance of ProgressBar
16
16
  * @param ref - reference to root HTMLElement of ProgressBar
17
17
  */
18
-
19
-
20
18
  const useProgressBar_unstable = (props, ref) => {
19
+ var _a;
21
20
  // Props
22
21
  const {
23
- max = 1.0,
22
+ color = 'brand',
24
23
  shape = 'rounded',
25
- thickness = 'medium',
26
- validationState,
27
- value
24
+ thickness = 'medium'
28
25
  } = props;
26
+ const max = index_1.clampMax((_a = props.max) !== null && _a !== void 0 ? _a : 1);
27
+ const value = index_1.clampValue(props.value, max);
29
28
  const root = react_utilities_1.getNativeElementProps('div', {
30
29
  ref,
31
30
  role: 'progressbar',
@@ -38,11 +37,11 @@ const useProgressBar_unstable = (props, ref) => {
38
37
  required: true
39
38
  });
40
39
  const state = {
40
+ color,
41
41
  max,
42
42
  shape,
43
43
  thickness,
44
44
  value,
45
- validationState,
46
45
  components: {
47
46
  root: 'div',
48
47
  bar: 'div'
@@ -52,6 +51,5 @@ const useProgressBar_unstable = (props, ref) => {
52
51
  };
53
52
  return state;
54
53
  };
55
-
56
54
  exports.useProgressBar_unstable = useProgressBar_unstable;
57
55
  //# sourceMappingURL=useProgressBar.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-progress/src/components/ProgressBar/useProgressBar.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,uBAAuB,GAAG,CAAC,KAAD,EAA0B,GAA1B,KAA2E;EAChH;EACA,MAAM;IAAE,GAAG,GAAG,GAAR;IAAa,KAAK,GAAG,SAArB;IAAgC,SAAS,GAAG,QAA5C;IAAsD,eAAtD;IAAuE;EAAvE,IAAiF,KAAvF;EAEA,MAAM,IAAI,GAAG,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;IACxC,GADwC;IAExC,IAAI,EAAE,aAFkC;IAGxC,iBAAiB,KAAK,KAAK,SAAV,GAAsB,CAAtB,GAA0B,SAHH;IAIxC,iBAAiB,KAAK,KAAK,SAAV,GAAsB,GAAtB,GAA4B,SAJL;IAKxC,iBAAiB,KALuB;IAMxC,GAAG;EANqC,CAA7B,CAAb;EASA,MAAM,GAAG,GAAG,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,GAAvB,EAA4B;IACtC,QAAQ,EAAE;EAD4B,CAA5B,CAAZ;EAIA,MAAM,KAAK,GAAqB;IAC9B,GAD8B;IAE9B,KAF8B;IAG9B,SAH8B;IAI9B,KAJ8B;IAK9B,eAL8B;IAM9B,UAAU,EAAE;MACV,IAAI,EAAE,KADI;MAEV,GAAG,EAAE;IAFK,CANkB;IAU9B,IAV8B;IAW9B;EAX8B,CAAhC;EAcA,OAAO,KAAP;AACD,CAhCM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","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 { max = 1.0, shape = 'rounded', thickness = 'medium', validationState, 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 max,\n shape,\n thickness,\n value,\n validationState,\n components: {\n root: 'div',\n bar: 'div',\n },\n root,\n bar,\n };\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"names":["react_utilities_1","require","index_1","useProgressBar_unstable","props","ref","color","shape","thickness","max","clampMax","_a","value","clampValue","root","getNativeElementProps","role","undefined","bar","resolveShorthand","required","state","components","exports"],"sources":["../src/packages/react-components/react-progress/src/components/ProgressBar/useProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { clampValue, clampMax } from '../../utils/index';\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', shape = 'rounded', thickness = 'medium' } = props;\n const max = clampMax(props.max ?? 1);\n const value = clampValue(props.value, max);\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"],"mappings":";;;;;;AACA,MAAAA,iBAAA,gBAAAC,OAAA;AACA,MAAAC,OAAA,gBAAAD,OAAA;AAGA;;;;;;;;;AASO,MAAME,uBAAuB,GAAGA,CAACC,KAAuB,EAAEC,GAA2B,KAAsB;;EAChH;EACA,MAAM;IAAEC,KAAK,GAAG,OAAO;IAAEC,KAAK,GAAG,SAAS;IAAEC,SAAS,GAAG;EAAQ,CAAE,GAAGJ,KAAK;EAC1E,MAAMK,GAAG,GAAGP,OAAA,CAAAQ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