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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. package/CHANGELOG.json +266 -1
  2. package/CHANGELOG.md +114 -2
  3. package/README.md +9 -17
  4. package/dist/index.d.ts +20 -11
  5. package/lib/components/ProgressBar/ProgressBar.js +0 -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 +2 -3
  11. package/lib/components/ProgressBar/useProgressBar.js.map +1 -1
  12. package/lib/components/ProgressBar/useProgressBarStyles.js +75 -81
  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-amd/ProgressBar.js +6 -0
  19. package/lib-amd/ProgressBar.js.map +1 -0
  20. package/lib-amd/ProgressField.js +6 -0
  21. package/lib-amd/ProgressField.js.map +1 -0
  22. package/lib-amd/components/ProgressBar/ProgressBar.js +15 -0
  23. package/lib-amd/components/ProgressBar/ProgressBar.js.map +1 -0
  24. package/lib-amd/components/ProgressBar/ProgressBar.types.js +5 -0
  25. package/lib-amd/components/ProgressBar/ProgressBar.types.js.map +1 -0
  26. package/lib-amd/components/ProgressBar/index.js +10 -0
  27. package/lib-amd/components/ProgressBar/index.js.map +1 -0
  28. package/lib-amd/components/ProgressBar/renderProgressBar.js +14 -0
  29. package/lib-amd/components/ProgressBar/renderProgressBar.js.map +1 -0
  30. package/lib-amd/components/ProgressBar/useProgressBar.js +38 -0
  31. package/lib-amd/components/ProgressBar/useProgressBar.js.map +1 -0
  32. package/lib-amd/components/ProgressBar/useProgressBarStyles.js +112 -0
  33. package/lib-amd/components/ProgressBar/useProgressBarStyles.js.map +1 -0
  34. package/lib-amd/components/ProgressField/ProgressField.js +13 -0
  35. package/lib-amd/components/ProgressField/ProgressField.js.map +1 -0
  36. package/lib-amd/components/ProgressField/index.js +6 -0
  37. package/lib-amd/components/ProgressField/index.js.map +1 -0
  38. package/lib-amd/index.js +13 -0
  39. package/lib-amd/index.js.map +1 -0
  40. package/lib-commonjs/ProgressBar.js +0 -2
  41. package/lib-commonjs/ProgressBar.js.map +1 -1
  42. package/lib-commonjs/ProgressField.js +0 -2
  43. package/lib-commonjs/ProgressField.js.map +1 -1
  44. package/lib-commonjs/components/ProgressBar/ProgressBar.js +0 -6
  45. package/lib-commonjs/components/ProgressBar/ProgressBar.js.map +1 -1
  46. package/lib-commonjs/components/ProgressBar/ProgressBar.types.js.map +1 -1
  47. package/lib-commonjs/components/ProgressBar/index.js +0 -6
  48. package/lib-commonjs/components/ProgressBar/index.js.map +1 -1
  49. package/lib-commonjs/components/ProgressBar/renderProgressBar.js +4 -7
  50. package/lib-commonjs/components/ProgressBar/renderProgressBar.js.map +1 -1
  51. package/lib-commonjs/components/ProgressBar/useProgressBar.js +2 -6
  52. package/lib-commonjs/components/ProgressBar/useProgressBar.js.map +1 -1
  53. package/lib-commonjs/components/ProgressBar/useProgressBarStyles.js +75 -86
  54. package/lib-commonjs/components/ProgressBar/useProgressBarStyles.js.map +1 -1
  55. package/lib-commonjs/components/ProgressField/ProgressField.js +13 -17
  56. package/lib-commonjs/components/ProgressField/ProgressField.js.map +1 -1
  57. package/lib-commonjs/components/ProgressField/index.js +0 -2
  58. package/lib-commonjs/components/ProgressField/index.js.map +1 -1
  59. package/lib-commonjs/index.js +1 -4
  60. package/lib-commonjs/index.js.map +1 -1
  61. package/package.json +9 -9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useProgressBarStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-progress/src/components/ProgressBar/useProgressBarStyles.ts"],"names":[],"mappings":";;;;I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AAA,GAAG,GAAK,0CAAS,EAAE,IAAhB,CAAiB;QAE5B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,6BAAqB,CAAC,IAAI,EAC1B,UAAU,CAAC,IAAI,EACf,UAAU,CAAC,KAAK,CAAC,EACjB,UAAU,CAAC,SAAS,CAAC,EACrB,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QAEF,IAAI,KAAK,CAAC,GAAG,EAAE;YACb,KAAK,CAAC,GAAG,CAAC,SAAS,GAAG,oBAAY,CAChC,6BAAqB,CAAC,GAAG,EACzB,SAAS,CAAC,IAAI,EACd,SAAS,CAAC,KAAK,EACf,KAAK,KAAK,SAAS,IAAI,SAAS,CAAC,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"]}
@@ -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"]}
@@ -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,"mappings":";;;;;;AAAAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-progress/src/ProgressBar.ts"],"sourcesContent":["export * from './components/ProgressBar/index';\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/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,"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,"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,"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,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
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"],"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,"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, { ...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,"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,"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,"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"]}
@@ -4,19 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useProgressBarStyles_unstable = exports.progressBarClassNames = void 0;
7
-
8
7
  const react_1 = /*#__PURE__*/require("@griffel/react");
9
-
10
8
  const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
11
-
12
9
  const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
13
-
14
10
  exports.progressBarClassNames = {
15
11
  root: 'fui-ProgressBar',
16
12
  bar: 'fui-ProgressBar__bar'
17
- }; // If the percentComplete is near 0, don't animate it.
13
+ };
14
+ // If the percentComplete is near 0, don't animate it.
18
15
  // This prevents animations on reset to 0 scenarios.
19
-
20
16
  const ZERO_THRESHOLD = 0.01;
21
17
  const barThicknessValues = {
22
18
  medium: '2px',
@@ -24,7 +20,7 @@ const barThicknessValues = {
24
20
  };
25
21
  const indeterminateProgressBar = {
26
22
  '0%': {
27
- left: '0% /* @noflip */'
23
+ left: '-100% /* @noflip */'
28
24
  },
29
25
  '100%': {
30
26
  left: '100% /* @noflip */'
@@ -41,115 +37,112 @@ const indeterminateProgressBarRTL = {
41
37
  /**
42
38
  * Styles for the root slot
43
39
  */
44
-
45
40
  const useRootStyles = /*#__PURE__*/react_1.__styles({
46
- "root": {
47
- "mc9l5x": "ftgm304",
48
- "De3pzq": "f18f03hv",
49
- "Bdqf98w": "fhb5wj7",
50
- "B68tc82": "f1p9o1ba",
51
- "Bmxbyg5": "f1sil6mw",
52
- "I5kgcl": "fs8b23g",
53
- "tu2nte": "f1mcb20s",
54
- "y0r1ed": "fek7wd8"
41
+ root: {
42
+ mc9l5x: "ftgm304",
43
+ De3pzq: "f18f03hv",
44
+ Bdqf98w: "fhb5wj7",
45
+ B68tc82: "f1p9o1ba",
46
+ Bmxbyg5: "f1sil6mw",
47
+ I5kgcl: "fs8b23g",
48
+ tu2nte: "f1mcb20s",
49
+ y0r1ed: "fek7wd8"
55
50
  },
56
- "rounded": {
57
- "Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
58
- "Beyfa6y": ["f16jpd5f", "f1aa9q02"],
59
- "B7oj6ja": ["f1jar5jt", "fyu767a"],
60
- "Btl43ni": ["fyu767a", "f1jar5jt"]
51
+ rounded: {
52
+ Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
53
+ Beyfa6y: ["f16jpd5f", "f1aa9q02"],
54
+ B7oj6ja: ["f1jar5jt", "fyu767a"],
55
+ Btl43ni: ["fyu767a", "f1jar5jt"]
61
56
  },
62
- "rectangular": {
63
- "Bbmb7ep": ["fzi6hpg", "fyowgf4"],
64
- "Beyfa6y": ["fyowgf4", "fzi6hpg"],
65
- "B7oj6ja": ["f3fg2lr", "f13av6d4"],
66
- "Btl43ni": ["f13av6d4", "f3fg2lr"]
57
+ square: {
58
+ Bbmb7ep: ["fzi6hpg", "fyowgf4"],
59
+ Beyfa6y: ["fyowgf4", "fzi6hpg"],
60
+ B7oj6ja: ["f3fg2lr", "f13av6d4"],
61
+ Btl43ni: ["f13av6d4", "f3fg2lr"]
67
62
  },
68
- "medium": {
69
- "Bqenvij": "f4t8t6x"
63
+ medium: {
64
+ Bqenvij: "f4t8t6x"
70
65
  },
71
- "large": {
72
- "Bqenvij": "f6ywr7j"
66
+ large: {
67
+ Bqenvij: "f6ywr7j"
73
68
  }
74
69
  }, {
75
- "d": [".ftgm304{display:block;}", ".f18f03hv{background-color:var(--colorNeutralBackground6);}", ".fhb5wj7{justify-self:stretch;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".fzi6hpg{border-bottom-right-radius:var(--borderRadiusNone);}", ".fyowgf4{border-bottom-left-radius:var(--borderRadiusNone);}", ".f3fg2lr{border-top-right-radius:var(--borderRadiusNone);}", ".f13av6d4{border-top-left-radius:var(--borderRadiusNone);}", ".f4t8t6x{height:2px;}", ".f6ywr7j{height:4px;}"],
76
- "m": [["@media screen and (forced-colors: active){.fs8b23g{border-bottom-width:1px;}}", {
77
- "m": "screen and (forced-colors: active)"
70
+ d: [".ftgm304{display:block;}", ".f18f03hv{background-color:var(--colorNeutralBackground6);}", ".fhb5wj7{justify-self:stretch;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".fzi6hpg{border-bottom-right-radius:var(--borderRadiusNone);}", ".fyowgf4{border-bottom-left-radius:var(--borderRadiusNone);}", ".f3fg2lr{border-top-right-radius:var(--borderRadiusNone);}", ".f13av6d4{border-top-left-radius:var(--borderRadiusNone);}", ".f4t8t6x{height:2px;}", ".f6ywr7j{height:4px;}"],
71
+ m: [["@media screen and (forced-colors: active){.fs8b23g{border-bottom-width:1px;}}", {
72
+ m: "screen and (forced-colors: active)"
78
73
  }], ["@media screen and (forced-colors: active){.f1mcb20s{border-bottom-style:solid;}}", {
79
- "m": "screen and (forced-colors: active)"
74
+ m: "screen and (forced-colors: active)"
80
75
  }], ["@media screen and (forced-colors: active){.fek7wd8{border-bottom-color:CanvasText;}}", {
81
- "m": "screen and (forced-colors: active)"
76
+ m: "screen and (forced-colors: active)"
82
77
  }]]
83
78
  });
84
79
  /**
85
80
  * Styles for the ProgressBar bar
86
81
  */
87
-
88
-
89
82
  const useBarStyles = /*#__PURE__*/react_1.__styles({
90
- "base": {
91
- "De3pzq": "ftywsgz",
92
- "Bpep1pd": "f1neahkh",
93
- "Bbmb7ep": ["f1d9uwra", "fzibvwi"],
94
- "Beyfa6y": ["fzibvwi", "f1d9uwra"],
95
- "B7oj6ja": ["fuoumxm", "f1vtqnvc"],
96
- "Btl43ni": ["f1vtqnvc", "fuoumxm"]
83
+ base: {
84
+ Bbmb7ep: ["f1d9uwra", "fzibvwi"],
85
+ Beyfa6y: ["fzibvwi", "f1d9uwra"],
86
+ B7oj6ja: ["fuoumxm", "f1vtqnvc"],
87
+ Btl43ni: ["f1vtqnvc", "fuoumxm"]
97
88
  },
98
- "medium": {
99
- "Bqenvij": "f4t8t6x"
89
+ medium: {
90
+ Bqenvij: "f4t8t6x"
100
91
  },
101
- "large": {
102
- "Bqenvij": "f6ywr7j"
92
+ large: {
93
+ Bqenvij: "f6ywr7j"
103
94
  },
104
- "nonZeroDeterminate": {
105
- "Bmy1vo4": "fjt6zfz",
106
- "B3o57yi": "f1wofebd",
107
- "Bkqvd7p": "fv71qf3"
95
+ nonZeroDeterminate: {
96
+ Bmy1vo4: "fjt6zfz",
97
+ B3o57yi: "f1wofebd",
98
+ Bkqvd7p: "fv71qf3"
108
99
  },
109
- "indeterminate": {
110
- "B2u0y6b": "fa0wk36",
111
- "qhf8xq": "f10pi13n",
112
- "Bcmaq0h": ["fpo0yib", "f1u5hf6c"],
113
- "Bv12yb3": "f1h4fm7e",
114
- "vin17d": "f1a27w2r",
115
- "w3vfg9": "f1cpbl36",
116
- "Gqtpxc": "f4akx1t",
117
- "B3vm3ge": "f18p5put"
100
+ indeterminate: {
101
+ B2u0y6b: "fa0wk36",
102
+ qhf8xq: "f10pi13n",
103
+ Bcmaq0h: ["fpo0yib", "f1u5hf6c"],
104
+ Bv12yb3: "f1jk3tlg",
105
+ vin17d: "f1a27w2r",
106
+ w3vfg9: "f1cpbl36",
107
+ Gqtpxc: "f4akx1t",
108
+ B3vm3ge: "f18p5put"
118
109
  },
119
- "rtl": {
120
- "Bv12yb3": "fjhwsai"
110
+ rtl: {
111
+ Bv12yb3: "fjhwsai"
121
112
  },
122
- "error": {
123
- "De3pzq": "fdl5y0r"
113
+ brand: {
114
+ De3pzq: "ftywsgz",
115
+ Bpep1pd: "f1neahkh"
124
116
  },
125
- "warning": {
126
- "De3pzq": "f1s438gw"
117
+ error: {
118
+ De3pzq: "fdl5y0r"
127
119
  },
128
- "success": {
129
- "De3pzq": "flxk52p"
120
+ warning: {
121
+ De3pzq: "f1s438gw"
122
+ },
123
+ success: {
124
+ De3pzq: "flxk52p"
130
125
  }
131
126
  }, {
132
- "d": [".ftywsgz{background-color:var(--colorCompoundBrandBackground);}", ".f1d9uwra{border-bottom-right-radius:inherit;}", ".fzibvwi{border-bottom-left-radius:inherit;}", ".fuoumxm{border-top-right-radius:inherit;}", ".f1vtqnvc{border-top-left-radius:inherit;}", ".f4t8t6x{height:2px;}", ".f6ywr7j{height:4px;}", ".fjt6zfz{transition-property:width;}", ".f1wofebd{transition-duration:0.3s;}", ".fv71qf3{transition-timing-function:ease;}", ".fa0wk36{max-width:33%;}", ".f10pi13n{position:relative;}", ".fpo0yib{background-image:linear-gradient(\n to right,\n var(--colorNeutralBackground6) 0%,\n var(--colorTransparentBackground) 50%,\n var(--colorNeutralBackground6) 100%\n );}", ".f1u5hf6c{background-image:linear-gradient(\n to left,\n var(--colorNeutralBackground6) 0%,\n var(--colorTransparentBackground) 50%,\n var(--colorNeutralBackground6) 100%\n );}", ".f1h4fm7e{-webkit-animation-name:fd3k50f;animation-name:fd3k50f;}", ".f1a27w2r{-webkit-animation-duration:3s;animation-duration:3s;}", ".f1cpbl36{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;}", ".fjhwsai{-webkit-animation-name:f1kx06uz;animation-name:f1kx06uz;}", ".fdl5y0r{background-color:var(--colorPaletteRedBackground3);}", ".f1s438gw{background-color:var(--colorPaletteDarkOrangeBackground3);}", ".flxk52p{background-color:var(--colorPaletteGreenBackground3);}"],
133
- "m": [["@media screen and (forced-colors: active){.f1neahkh{background-color:Highlight;}}", {
134
- "m": "screen and (forced-colors: active)"
135
- }], ["@media screen and (prefers-reduced-motion: reduce){.f4akx1t{-webkit-animation-duration:0.01ms;animation-duration:0.01ms;}}", {
136
- "m": "screen and (prefers-reduced-motion: reduce)"
127
+ d: [".f1d9uwra{border-bottom-right-radius:inherit;}", ".fzibvwi{border-bottom-left-radius:inherit;}", ".fuoumxm{border-top-right-radius:inherit;}", ".f1vtqnvc{border-top-left-radius:inherit;}", ".f4t8t6x{height:2px;}", ".f6ywr7j{height:4px;}", ".fjt6zfz{transition-property:width;}", ".f1wofebd{transition-duration:0.3s;}", ".fv71qf3{transition-timing-function:ease;}", ".fa0wk36{max-width:33%;}", ".f10pi13n{position:relative;}", ".fpo0yib{background-image:linear-gradient(\n to right,\n var(--colorNeutralBackground6) 0%,\n var(--colorTransparentBackground) 50%,\n var(--colorNeutralBackground6) 100%\n );}", ".f1u5hf6c{background-image:linear-gradient(\n to left,\n var(--colorNeutralBackground6) 0%,\n var(--colorTransparentBackground) 50%,\n var(--colorNeutralBackground6) 100%\n );}", ".f1jk3tlg{-webkit-animation-name:fzkbrka;animation-name:fzkbrka;}", ".f1a27w2r{-webkit-animation-duration:3s;animation-duration:3s;}", ".f1cpbl36{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;}", ".fjhwsai{-webkit-animation-name:f1kx06uz;animation-name:f1kx06uz;}", ".ftywsgz{background-color:var(--colorCompoundBrandBackground);}", ".fdl5y0r{background-color:var(--colorPaletteRedBackground3);}", ".f1s438gw{background-color:var(--colorPaletteDarkOrangeBackground3);}", ".flxk52p{background-color:var(--colorPaletteGreenBackground3);}"],
128
+ k: ["@-webkit-keyframes fzkbrka{0%{left:-100%;}100%{left:100%;}}", "@keyframes fzkbrka{0%{left:-100%;}100%{left:100%;}}", "@-webkit-keyframes f1kx06uz{100%{right:-100%;}0%{right:100%;}}", "@keyframes f1kx06uz{100%{right:-100%;}0%{right:100%;}}"],
129
+ m: [["@media screen and (prefers-reduced-motion: reduce){.f4akx1t{-webkit-animation-duration:0.01ms;animation-duration:0.01ms;}}", {
130
+ m: "screen and (prefers-reduced-motion: reduce)"
137
131
  }], ["@media screen and (prefers-reduced-motion: reduce){.f18p5put{-webkit-animation-iteration-count:1;animation-iteration-count:1;}}", {
138
- "m": "screen and (prefers-reduced-motion: reduce)"
139
- }]],
140
- "k": ["@-webkit-keyframes fd3k50f{0%{left:0%;}100%{left:100%;}}", "@keyframes fd3k50f{0%{left:0%;}100%{left:100%;}}", "@-webkit-keyframes f1kx06uz{100%{right:-100%;}0%{right:100%;}}", "@keyframes f1kx06uz{100%{right:-100%;}0%{right:100%;}}"]
132
+ m: "screen and (prefers-reduced-motion: reduce)"
133
+ }], ["@media screen and (forced-colors: active){.f1neahkh{background-color:Highlight;}}", {
134
+ m: "screen and (forced-colors: active)"
135
+ }]]
141
136
  });
142
137
  /**
143
138
  * Apply styling to the ProgressBar slots based on the state
144
139
  */
145
-
146
-
147
140
  const useProgressBarStyles_unstable = state => {
148
141
  const {
142
+ color,
149
143
  max,
150
144
  shape,
151
145
  thickness,
152
- validationState,
153
146
  value
154
147
  } = state;
155
148
  const rootStyles = useRootStyles();
@@ -158,20 +151,16 @@ const useProgressBarStyles_unstable = state => {
158
151
  dir
159
152
  } = react_shared_contexts_1.useFluent_unstable();
160
153
  state.root.className = react_1.mergeClasses(exports.progressBarClassNames.root, rootStyles.root, rootStyles[shape], rootStyles[thickness], state.root.className);
161
-
162
154
  if (state.bar) {
163
- state.bar.className = react_1.mergeClasses(exports.progressBarClassNames.bar, barStyles.base, value === undefined && barStyles.indeterminate, value === undefined && dir === 'rtl' && barStyles.rtl, barStyles[thickness], value !== undefined && value > ZERO_THRESHOLD && barStyles.nonZeroDeterminate, validationState && barStyles[validationState], state.bar.className);
155
+ 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);
164
156
  }
165
-
166
157
  if (state.bar && value !== undefined) {
167
158
  state.bar.style = {
168
159
  width: Math.min(100, Math.max(0, value / max * 100)) + '%',
169
160
  ...state.bar.style
170
161
  };
171
162
  }
172
-
173
163
  return state;
174
164
  };
175
-
176
165
  exports.useProgressBarStyles_unstable = useProgressBarStyles_unstable;
177
166
  //# sourceMappingURL=useProgressBarStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-progress/src/components/ProgressBar/useProgressBarStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AAIa,OAAA,CAAA,qBAAA,GAA0D;EACrE,IAAI,EAAE,iBAD+D;EAErE,GAAG,EAAE;AAFgE,CAA1D,C,CAKb;AACA;;AACA,MAAM,cAAc,GAAG,IAAvB;AAE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AAA,kBAAA,EAAhB;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,qBAAA,CAAsB,IADD,EAErB,UAAU,CAAC,IAFU,EAGrB,UAAU,CAAC,KAAD,CAHW,EAIrB,UAAU,CAAC,SAAD,CAJW,EAKrB,KAAK,CAAC,IAAN,CAAW,SALU,CAAvB;;EAQA,IAAI,KAAK,CAAC,GAAV,EAAe;IACb,KAAK,CAAC,GAAN,CAAU,SAAV,GAAsB,OAAA,CAAA,YAAA,CACpB,OAAA,CAAA,qBAAA,CAAsB,GADF,EAEpB,SAAS,CAAC,IAFU,EAGpB,KAAK,KAAK,SAAV,IAAuB,SAAS,CAAC,aAHb,EAIpB,KAAK,KAAK,SAAV,IAAuB,GAAG,KAAK,KAA/B,IAAwC,SAAS,CAAC,GAJ9B,EAKpB,SAAS,CAAC,SAAD,CALW,EAMpB,KAAK,KAAK,SAAV,IAAuB,KAAK,GAAG,cAA/B,IAAiD,SAAS,CAAC,kBANvC,EAOpB,eAAe,IAAI,SAAS,CAAC,eAAD,CAPR,EAQpB,KAAK,CAAC,GAAN,CAAU,SARU,CAAtB;EAUD;;EAED,IAAI,KAAK,CAAC,GAAN,IAAa,KAAK,KAAK,SAA3B,EAAsC;IACpC,KAAK,CAAC,GAAN,CAAU,KAAV,GAAkB;MAChB,KAAK,EAAE,IAAI,CAAC,GAAL,CAAS,GAAT,EAAc,IAAI,CAAC,GAAL,CAAS,CAAT,EAAa,KAAK,GAAG,GAAT,GAAgB,GAA5B,CAAd,IAAkD,GADzC;MAEhB,GAAG,KAAK,CAAC,GAAN,CAAU;IAFG,CAAlB;EAID;;EAED,OAAO,KAAP;AACD,CAnCM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","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: '0% /* @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 rectangular: {\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 backgroundColor: tokens.colorCompoundBrandBackground,\n\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'Highlight',\n },\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 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 { max, shape, thickness, validationState, 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 value === undefined && barStyles.indeterminate,\n value === undefined && dir === 'rtl' && barStyles.rtl,\n barStyles[thickness],\n value !== undefined && value > ZERO_THRESHOLD && barStyles.nonZeroDeterminate,\n validationState && barStyles[validationState],\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"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AAIaA,6BAAqB,GAAqC;EACrEC,IAAI,EAAE,iBAAiB;EACvBC,GAAG,EAAE;CACN;AAED;AACA;AACA,MAAMC,cAAc,GAAG,IAAI;AAE3B,MAAMC,kBAAkB,GAAG;EACzBC,MAAM,EAAE,KAAK;EACbC,KAAK,EAAE;CACR;AAED,MAAMC,wBAAwB,GAAG;EAC/B,IAAI,EAAE;IACJC,IAAI,EAAE;GACP;EACD,MAAM,EAA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AAS,CAAC,EACrBJ,KAAK,CAACd,IAAI,CAACwB,SAAS,CACrB;EAED,IAAIV,KAAK,CAACb,GAAG,EAAE;IACba,KAAK,CAACb,GAAG,CAACuB,SAAS,GAAGb,oBAAY,CAChCZ,6BAAqB,CAACE,GAAG,EACzBoB,SAAS,CAACI,IAAI,EACdJ,SAAS,CAACK,KAAK,EACfP,KAAK,KAAKQ,SAAS,IAAIN,SAAS,CAACO,aAAa,EAC9CT,KAAK,KAAKQ,SAAS,IAAIL,GAAG,KAAK,KAAK,IAAID,SAAS,CAACQ,GAAG,EACrDR,SAAS,CAACH,SAAS,CAAC,EACpBC,KAAK,KAAKQ,SAAS,IAAIR,KAAK,GAAGjB,cAAc,IAAImB,SAAS,CAACS,kBAAkB,EAC7Ef,KAAK,IAAII,KAAK,KAAKQ,SAAS,IAAIN,SAAS,CAACN,KAAK,CAAC,EAChDD,KAAK,CAACb,GAAG,CAACuB,SAAS,CACpB;;EAGH,IAAIV,KAAK,CAACb,GAAG,IAAIkB,KAAK,KAAKQ,SAAS,EAAE;IACpCb,KAAK,CAACb,GAAG,CAAC8B,KAAK,GAAG;MAChBC,KAAK,EAAEC,IAAI,CAACC,GAAG,CAAC,GAAG,EAAED,IAAI,CAACjB,GAAG,CAAC,CAAC,EAAGG,KAAK,GAAGH,GAAG,GAAI,GAAG,CAAC,CAAC,GAAG,GAAG;MAC5D,GAAGF,KAAK,CAACb,GAAG,CAAC8B;KACd;;EAGH,OAAOjB,KAAK;AACd,CAAC;AApCYf,qCAA6B","names":["exports","root","bar","ZERO_THRESHOLD","barThicknessValues","medium","large","indeterminateProgressBar","left","indeterminateProgressBarRTL","right","useRootStyles","react_1","useBarStyles","useProgressBarStyles_unstable","state","color","max","shape","thickness","value","rootStyles","barStyles","dir","react_shared_contexts_1","className","base","brand","undefined","indeterminate","rtl","nonZeroDeterminate","style","width","Math","min"],"sourceRoot":"../src/","sources":["packages/react-components/react-progress/src/components/ProgressBar/useProgressBarStyles.ts"],"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"]}
@@ -4,24 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ProgressField = exports.progressFieldClassNames = void 0;
7
-
8
- const React = /*#__PURE__*/require("react");
9
-
7
+ /* eslint-disable deprecation/deprecation */
10
8
  const react_field_1 = /*#__PURE__*/require("@fluentui/react-field");
11
-
12
9
  const ProgressBar_1 = /*#__PURE__*/require("../../ProgressBar");
13
-
14
- exports.progressFieldClassNames = /*#__PURE__*/react_field_1.getFieldClassNames('ProgressField');
15
- exports.ProgressField = /*#__PURE__*/React.forwardRef((props, ref) => {
16
- const state = react_field_1.useField_unstable(props, ref, {
17
- component: ProgressBar_1.ProgressBar,
18
- classNames: exports.progressFieldClassNames,
19
- labelConnection: 'aria-labelledby',
20
- ariaInvalidOnError: false
21
- });
22
- state.control.validationState = state.validationState;
23
- react_field_1.useFieldStyles_unstable(state);
24
- return react_field_1.renderField_unstable(state);
10
+ /** @deprecated Use Field with ProgressBar: `<Field><ProgressBar /></Field>` */
11
+ exports.progressFieldClassNames = /*#__PURE__*/react_field_1.getDeprecatedFieldClassNames(ProgressBar_1.progressBarClassNames.root);
12
+ /** @deprecated Use Field with ProgressBar: `<Field><ProgressBar /></Field>` */
13
+ exports.ProgressField = /*#__PURE__*/react_field_1.makeDeprecatedField(ProgressBar_1.ProgressBar, {
14
+ displayName: 'ProgressField',
15
+ mapProps: props => ({
16
+ ...props,
17
+ control: {
18
+ ...props.control,
19
+ validationState: props.validationState
20
+ }
21
+ })
25
22
  });
26
- exports.ProgressField.displayName = 'ProgressField';
27
23
  //# sourceMappingURL=ProgressField.js.map