@fluentui/react-progress 0.0.0-nightly-20230317-1454.1 → 0.0.0-nightly-20230321-0440.1

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 (59) hide show
  1. package/CHANGELOG.json +13 -13
  2. package/CHANGELOG.md +9 -9
  3. package/lib/ProgressBar.js +1 -1
  4. package/lib/ProgressBar.js.map +1 -1
  5. package/lib/ProgressField.js +1 -1
  6. package/lib/ProgressField.js.map +1 -1
  7. package/lib/components/ProgressBar/ProgressBar.js +6 -6
  8. package/lib/components/ProgressBar/ProgressBar.js.map +1 -1
  9. package/lib/components/ProgressBar/ProgressBar.types.js.map +1 -1
  10. package/lib/components/ProgressBar/index.js +5 -5
  11. package/lib/components/ProgressBar/index.js.map +1 -1
  12. package/lib/components/ProgressBar/renderProgressBar.js +7 -3
  13. package/lib/components/ProgressBar/renderProgressBar.js.map +1 -1
  14. package/lib/components/ProgressBar/useProgressBar.js +14 -14
  15. package/lib/components/ProgressBar/useProgressBar.js.map +1 -1
  16. package/lib/components/ProgressBar/useProgressBarStyles.js +12 -11
  17. package/lib/components/ProgressBar/useProgressBarStyles.js.map +1 -1
  18. package/lib/components/ProgressField/ProgressField.js +4 -3
  19. package/lib/components/ProgressField/ProgressField.js.map +1 -1
  20. package/lib/components/ProgressField/index.js +1 -1
  21. package/lib/components/ProgressField/index.js.map +1 -1
  22. package/lib/index.js +2 -2
  23. package/lib/index.js.map +1 -1
  24. package/lib/utils/clampMax.js +1 -1
  25. package/lib/utils/clampMax.js.map +1 -1
  26. package/lib/utils/clampValue.js +1 -1
  27. package/lib/utils/clampValue.js.map +1 -1
  28. package/lib/utils/index.js +2 -2
  29. package/lib/utils/index.js.map +1 -1
  30. package/lib-commonjs/ProgressBar.js +4 -5
  31. package/lib-commonjs/ProgressBar.js.map +1 -1
  32. package/lib-commonjs/ProgressField.js +4 -5
  33. package/lib-commonjs/ProgressField.js.map +1 -1
  34. package/lib-commonjs/components/ProgressBar/ProgressBar.js +20 -19
  35. package/lib-commonjs/components/ProgressBar/ProgressBar.js.map +1 -1
  36. package/lib-commonjs/components/ProgressBar/ProgressBar.types.js +2 -3
  37. package/lib-commonjs/components/ProgressBar/ProgressBar.types.js.map +1 -1
  38. package/lib-commonjs/components/ProgressBar/index.js +8 -9
  39. package/lib-commonjs/components/ProgressBar/index.js.map +1 -1
  40. package/lib-commonjs/components/ProgressBar/renderProgressBar.js +20 -13
  41. package/lib-commonjs/components/ProgressBar/renderProgressBar.js.map +1 -1
  42. package/lib-commonjs/components/ProgressBar/useProgressBar.js +51 -41
  43. package/lib-commonjs/components/ProgressBar/useProgressBar.js.map +1 -1
  44. package/lib-commonjs/components/ProgressBar/useProgressBarStyles.js +122 -220
  45. package/lib-commonjs/components/ProgressBar/useProgressBarStyles.js.map +1 -1
  46. package/lib-commonjs/components/ProgressField/ProgressField.js +19 -25
  47. package/lib-commonjs/components/ProgressField/ProgressField.js.map +1 -1
  48. package/lib-commonjs/components/ProgressField/index.js +4 -5
  49. package/lib-commonjs/components/ProgressField/index.js.map +1 -1
  50. package/lib-commonjs/index.js +49 -21
  51. package/lib-commonjs/index.js.map +1 -1
  52. package/lib-commonjs/utils/clampMax.js +13 -15
  53. package/lib-commonjs/utils/clampMax.js.map +1 -1
  54. package/lib-commonjs/utils/clampValue.js +19 -21
  55. package/lib-commonjs/utils/clampValue.js.map +1 -1
  56. package/lib-commonjs/utils/index.js +5 -6
  57. package/lib-commonjs/utils/index.js.map +1 -1
  58. package/package.json +9 -8
  59. package/.swcrc +0 -39
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/ProgressBar/ProgressBar.js"],"sourcesContent":["import * as React from \"react\";\nimport { useProgressBar_unstable } from \"./useProgressBar\";\nimport { renderProgressBar_unstable } from \"./renderProgressBar\";\nimport { useProgressBarStyles_unstable } from \"./useProgressBarStyles\";\nimport { useCustomStyleHooks_unstable } from \"@fluentui/react-shared-contexts\";\n/**\n * A ProgressBar bar shows the progression of a task.\n */\nexport const ProgressBar = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useProgressBar_unstable(props, ref);\n useProgressBarStyles_unstable(state);\n const {\n useProgressBarStyles_unstable: useCustomStyles\n } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n return renderProgressBar_unstable(state);\n});\nProgressBar.displayName = \"ProgressBar\";\n//# sourceMappingURL=ProgressBar.js.map"],"names":["ProgressBar","React","forwardRef","props","ref","state","useProgressBar_unstable","useProgressBarStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderProgressBar_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;gCACiB;mCACG;sCACG;qCACD;AAItC,MAAMA,cAAc,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACvE,MAAMC,QAAQC,IAAAA,uCAAuB,EAACH,OAAOC;IAC7CG,IAAAA,mDAA6B,EAACF;IAC9B,MAAM,EACJE,+BAA+BC,gBAAe,EAC/C,GAAGC,IAAAA,iDAA4B;IAChCD,gBAAgBH;IAChB,OAAOK,IAAAA,6CAA0B,EAACL;AACpC;AACAL,YAAYW,WAAW,GAAG,eAC1B,uCAAuC"}
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":["../../../../../../../../../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,7 +1,6 @@
1
1
  "use strict";
2
+
2
3
  Object.defineProperty(exports, "__esModule", {
3
- value: true
4
+ value: true
4
5
  });
5
- //# sourceMappingURL=ProgressBar.types.js.map
6
-
7
6
  //# sourceMappingURL=ProgressBar.types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/ProgressBar/ProgressBar.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=ProgressBar.types.js.map"],"names":[],"mappings":";;;;CACA,6CAA6C"}
1
+ {"version":3,"names":[],"sources":["../../../../../../../../../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":""}
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
+
2
3
  Object.defineProperty(exports, "__esModule", {
3
- value: true
4
+ value: true
4
5
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./ProgressBar"), exports);
7
- _exportStar(require("./ProgressBar.types"), exports);
8
- _exportStar(require("./renderProgressBar"), exports);
9
- _exportStar(require("./useProgressBar"), exports);
10
- _exportStar(require("./useProgressBarStyles"), exports);
11
- //# sourceMappingURL=index.js.map
12
-
6
+ const tslib_1 = /*#__PURE__*/require("tslib");
7
+ tslib_1.__exportStar(require("./ProgressBar"), exports);
8
+ tslib_1.__exportStar(require("./ProgressBar.types"), exports);
9
+ tslib_1.__exportStar(require("./renderProgressBar"), exports);
10
+ tslib_1.__exportStar(require("./useProgressBar"), exports);
11
+ tslib_1.__exportStar(require("./useProgressBarStyles"), exports);
13
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/ProgressBar/index.js"],"sourcesContent":["export * from \"./ProgressBar\";\nexport * from \"./ProgressBar.types\";\nexport * from \"./renderProgressBar\";\nexport * from \"./useProgressBar\";\nexport * from \"./useProgressBarStyles\";\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
1
+ {"version":3,"names":["tslib_1","__exportStar","require","exports"],"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"],"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"}
@@ -1,17 +1,24 @@
1
1
  "use strict";
2
+
2
3
  Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "renderProgressBar_unstable", {
6
- enumerable: true,
7
- get: ()=>renderProgressBar_unstable
4
+ value: true
8
5
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
- const _reactUtilities = require("@fluentui/react-utilities");
12
- const renderProgressBar_unstable = (state)=>{
13
- const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
14
- return /*#__PURE__*/ _react.createElement(slots.root, slotProps.root, slots.bar && /*#__PURE__*/ _react.createElement(slots.bar, slotProps.bar));
15
- }; //# sourceMappingURL=renderProgressBar.js.map
16
-
6
+ exports.renderProgressBar_unstable = void 0;
7
+ const React = /*#__PURE__*/require("react");
8
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
+ /**
10
+ * Render the final JSX of ProgressBar
11
+ */
12
+ const renderProgressBar_unstable = state => {
13
+ const {
14
+ slots,
15
+ slotProps
16
+ } = react_utilities_1.getSlots(state);
17
+ return React.createElement(slots.root, {
18
+ ...slotProps.root
19
+ }, slots.bar && React.createElement(slots.bar, {
20
+ ...slotProps.bar
21
+ }));
22
+ };
23
+ exports.renderProgressBar_unstable = renderProgressBar_unstable;
17
24
  //# sourceMappingURL=renderProgressBar.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/ProgressBar/renderProgressBar.js"],"sourcesContent":["import * as React from \"react\";\nimport { getSlots } from \"@fluentui/react-utilities\";\n/**\n * Render the final JSX of ProgressBar\n */\nexport const renderProgressBar_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root, slots.bar && /*#__PURE__*/React.createElement(slots.bar, slotProps.bar));\n};\n//# sourceMappingURL=renderProgressBar.js.map"],"names":["renderProgressBar_unstable","state","slots","slotProps","getSlots","React","createElement","root","bar"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,6BAA6BC,CAAAA,QAAS;IACjD,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,IAAI,EAAEJ,UAAUI,IAAI,EAAEL,MAAMM,GAAG,IAAI,WAAW,GAAEH,OAAMC,aAAa,CAACJ,MAAMM,GAAG,EAAEL,UAAUK,GAAG;AAC5I,GACA,6CAA6C"}
1
+ {"version":3,"names":["React","require","react_utilities_1","renderProgressBar_unstable","state","slots","slotProps","getSlots","createElement","root","bar","exports"],"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"],"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"}
@@ -1,45 +1,55 @@
1
1
  "use strict";
2
+
2
3
  Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "useProgressBar_unstable", {
6
- enumerable: true,
7
- get: ()=>useProgressBar_unstable
4
+ value: true
8
5
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
- const _reactUtilities = require("@fluentui/react-utilities");
12
- const _index = require("../../utils/index");
13
- const useProgressBar_unstable = (props, ref)=>{
14
- // Props
15
- const { color ="brand" , shape ="rounded" , thickness ="medium" } = props;
16
- const max = (0, _index.clampMax)(props.max ?? 1);
17
- const value = (0, _index.clampValue)(props.value, max);
18
- const root = (0, _reactUtilities.getNativeElementProps)("div", {
19
- ref,
20
- role: "progressbar",
21
- "aria-valuemin": value !== undefined ? 0 : undefined,
22
- "aria-valuemax": value !== undefined ? max : undefined,
23
- "aria-valuenow": value,
24
- ...props
25
- });
26
- const bar = (0, _reactUtilities.resolveShorthand)(props.bar, {
27
- required: true
28
- });
29
- const state = {
30
- color,
31
- max,
32
- shape,
33
- thickness,
34
- value,
35
- components: {
36
- root: "div",
37
- bar: "div"
38
- },
39
- root,
40
- bar
41
- };
42
- return state;
43
- }; //# sourceMappingURL=useProgressBar.js.map
44
-
6
+ exports.useProgressBar_unstable = void 0;
7
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
8
+ const index_1 = /*#__PURE__*/require("../../utils/index");
9
+ /**
10
+ * Create the state required to render ProgressBar.
11
+ *
12
+ * The returned state can be modified with hooks such as useProgressBarStyles_unstable,
13
+ * before being passed to renderProgressBar_unstable.
14
+ *
15
+ * @param props - props from this instance of ProgressBar
16
+ * @param ref - reference to root HTMLElement of ProgressBar
17
+ */
18
+ const useProgressBar_unstable = (props, ref) => {
19
+ var _a;
20
+ // Props
21
+ const {
22
+ color = 'brand',
23
+ shape = 'rounded',
24
+ thickness = 'medium'
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);
28
+ const root = react_utilities_1.getNativeElementProps('div', {
29
+ ref,
30
+ role: 'progressbar',
31
+ 'aria-valuemin': value !== undefined ? 0 : undefined,
32
+ 'aria-valuemax': value !== undefined ? max : undefined,
33
+ 'aria-valuenow': value,
34
+ ...props
35
+ });
36
+ const bar = react_utilities_1.resolveShorthand(props.bar, {
37
+ required: true
38
+ });
39
+ const state = {
40
+ color,
41
+ max,
42
+ shape,
43
+ thickness,
44
+ value,
45
+ components: {
46
+ root: 'div',
47
+ bar: 'div'
48
+ },
49
+ root,
50
+ bar
51
+ };
52
+ return state;
53
+ };
54
+ exports.useProgressBar_unstable = useProgressBar_unstable;
45
55
  //# sourceMappingURL=useProgressBar.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/ProgressBar/useProgressBar.js"],"sourcesContent":["import * as React from \"react\";\nimport { getNativeElementProps, resolveShorthand } from \"@fluentui/react-utilities\";\nimport { clampValue, clampMax } from \"../../utils/index\";\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, ref) => {\n // Props\n const {\n color = \"brand\",\n shape = \"rounded\",\n thickness = \"medium\"\n } = props;\n const max = clampMax(props.max ?? 1);\n const value = clampValue(props.value, max);\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 const bar = resolveShorthand(props.bar, {\n required: true\n });\n const state = {\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 return state;\n};\n//# sourceMappingURL=useProgressBar.js.map"],"names":["useProgressBar_unstable","props","ref","color","shape","thickness","max","clampMax","value","clampValue","root","getNativeElementProps","role","undefined","bar","resolveShorthand","required","state","components"],"mappings":";;;;+BAYaA;;aAAAA;;;6DAZU;gCACiC;uBACnB;AAU9B,MAAMA,0BAA0B,CAACC,OAAOC,MAAQ;IACrD,QAAQ;IACR,MAAM,EACJC,OAAQ,QAAO,EACfC,OAAQ,UAAS,EACjBC,WAAY,SAAQ,EACrB,GAAGJ;IACJ,MAAMK,MAAMC,IAAAA,eAAQ,EAACN,MAAMK,GAAG,IAAI;IAClC,MAAME,QAAQC,IAAAA,iBAAU,EAACR,MAAMO,KAAK,EAAEF;IACtC,MAAMI,OAAOC,IAAAA,qCAAqB,EAAC,OAAO;QACxCT;QACAU,MAAM;QACN,iBAAiBJ,UAAUK,YAAY,IAAIA,SAAS;QACpD,iBAAiBL,UAAUK,YAAYP,MAAMO,SAAS;QACtD,iBAAiBL;QACjB,GAAGP,KAAK;IACV;IACA,MAAMa,MAAMC,IAAAA,gCAAgB,EAACd,MAAMa,GAAG,EAAE;QACtCE,UAAU,IAAI;IAChB;IACA,MAAMC,QAAQ;QACZd;QACAG;QACAF;QACAC;QACAG;QACAU,YAAY;YACVR,MAAM;YACNI,KAAK;QACP;QACAJ;QACAI;IACF;IACA,OAAOG;AACT,GACA,0CAA0C"}
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":["../../../../../../../../../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,QAAQ,CAAC,CAAAC,EAAA,GAAAP,KAAK,CAACK,GAAG,cAAAE,EAAA,cAAAA,EAAA,GAAI,CAAC,CAAC;EACpC,MAAMC,KAAK,GAAGV,OAAA,CAAAW,UAAU,CAACT,KAAK,CAACQ,KAAK,EAAEH,GAAG,CAAC;EAE1C,MAAMK,IAAI,GAAGd,iBAAA,CAAAe,qBAAqB,CAAC,KAAK,EAAE;IACxCV,GAAG;IACHW,IAAI,EAAE,aAAa;IACnB,eAAe,EAAEJ,KAAK,KAAKK,SAAS,GAAG,CAAC,GAAGA,SAAS;IACpD,eAAe,EAAEL,KAAK,KAAKK,SAAS,GAAGR,GAAG,GAAGQ,SAAS;IACtD,eAAe,EAAEL,KAAK;IACtB,GAAGR;GACJ,CAAC;EAEF,MAAMc,GAAG,GAAGlB,iBAAA,CAAAmB,gBAAgB,CAACf,KAAK,CAACc,GAAG,EAAE;IACtCE,QAAQ,EAAE;GACX,CAAC;EAEF,MAAMC,KAAK,GAAqB;IAC9Bf,KAAK;IACLG,GAAG;IACHF,KAAK;IACLC,SAAS;IACTI,KAAK;IACLU,UAAU,EAAE;MACVR,IAAI,EAAE,KAAK;MACXI,GAAG,EAAE;KACN;IACDJ,IAAI;IACJI;GACD;EAED,OAAOG,KAAK;AACd,CAAC;AAlCYE,OAAA,CAAApB,uBAAuB,GAAAA,uBAAA"}
@@ -1,240 +1,142 @@
1
1
  "use strict";
2
+
2
3
  Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- progressBarClassNames: ()=>progressBarClassNames,
13
- useProgressBarStyles_unstable: ()=>useProgressBarStyles_unstable
4
+ value: true
14
5
  });
15
- const _react = require("@griffel/react");
16
- const progressBarClassNames = {
17
- root: "fui-ProgressBar",
18
- bar: "fui-ProgressBar__bar"
6
+ exports.useProgressBarStyles_unstable = exports.progressBarClassNames = void 0;
7
+ const react_1 = /*#__PURE__*/require("@griffel/react");
8
+ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
9
+ exports.progressBarClassNames = {
10
+ root: 'fui-ProgressBar',
11
+ bar: 'fui-ProgressBar__bar'
19
12
  };
20
13
  // If the percentComplete is near 0, don't animate it.
21
14
  // This prevents animations on reset to 0 scenarios.
22
15
  const ZERO_THRESHOLD = 0.01;
23
16
  const barThicknessValues = {
24
- medium: "2px",
25
- large: "4px"
17
+ medium: '2px',
18
+ large: '4px'
26
19
  };
27
20
  const indeterminateProgressBar = {
28
- "0%": {
29
- left: "-33%"
30
- },
31
- "100%": {
32
- left: "100%"
33
- }
21
+ '0%': {
22
+ left: '-33%' // matches indeterminate bar width
23
+ },
24
+
25
+ '100%': {
26
+ left: '100%'
27
+ }
34
28
  };
35
29
  /**
36
30
  * Styles for the root slot
37
- */ const useRootStyles = /*#__PURE__*/ (0, _react["__styles"])({
38
- root: {
39
- mc9l5x: "ftgm304",
40
- De3pzq: "f18f03hv",
41
- a9b677: "fly5x3f",
42
- B68tc82: "f1p9o1ba",
43
- Bmxbyg5: "f1sil6mw",
44
- Bpep1pd: "fu42dvn"
45
- },
46
- rounded: {
47
- Bbmb7ep: [
48
- "f1aa9q02",
49
- "f16jpd5f"
50
- ],
51
- Beyfa6y: [
52
- "f16jpd5f",
53
- "f1aa9q02"
54
- ],
55
- B7oj6ja: [
56
- "f1jar5jt",
57
- "fyu767a"
58
- ],
59
- Btl43ni: [
60
- "fyu767a",
61
- "f1jar5jt"
62
- ]
63
- },
64
- square: {
65
- Bbmb7ep: [
66
- "fzi6hpg",
67
- "fyowgf4"
68
- ],
69
- Beyfa6y: [
70
- "fyowgf4",
71
- "fzi6hpg"
72
- ],
73
- B7oj6ja: [
74
- "f3fg2lr",
75
- "f13av6d4"
76
- ],
77
- Btl43ni: [
78
- "f13av6d4",
79
- "f3fg2lr"
80
- ]
81
- },
82
- medium: {
83
- Bqenvij: "f4t8t6x"
84
- },
85
- large: {
86
- Bqenvij: "f6ywr7j"
87
- }
31
+ */
32
+ const useRootStyles = /*#__PURE__*/react_1.__styles({
33
+ root: {
34
+ mc9l5x: "ftgm304",
35
+ De3pzq: "f18f03hv",
36
+ a9b677: "fly5x3f",
37
+ B68tc82: "f1p9o1ba",
38
+ Bmxbyg5: "f1sil6mw",
39
+ Bpep1pd: "fu42dvn"
40
+ },
41
+ rounded: {
42
+ Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
43
+ Beyfa6y: ["f16jpd5f", "f1aa9q02"],
44
+ B7oj6ja: ["f1jar5jt", "fyu767a"],
45
+ Btl43ni: ["fyu767a", "f1jar5jt"]
46
+ },
47
+ square: {
48
+ Bbmb7ep: ["fzi6hpg", "fyowgf4"],
49
+ Beyfa6y: ["fyowgf4", "fzi6hpg"],
50
+ B7oj6ja: ["f3fg2lr", "f13av6d4"],
51
+ Btl43ni: ["f13av6d4", "f3fg2lr"]
52
+ },
53
+ medium: {
54
+ Bqenvij: "f4t8t6x"
55
+ },
56
+ large: {
57
+ Bqenvij: "f6ywr7j"
58
+ }
88
59
  }, {
89
- d: [
90
- ".ftgm304{display:block;}",
91
- ".f18f03hv{background-color:var(--colorNeutralBackground6);}",
92
- ".fly5x3f{width:100%;}",
93
- ".f1p9o1ba{overflow-x:hidden;}",
94
- ".f1sil6mw{overflow-y:hidden;}",
95
- ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}",
96
- ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}",
97
- ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}",
98
- ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}",
99
- ".fzi6hpg{border-bottom-right-radius:var(--borderRadiusNone);}",
100
- ".fyowgf4{border-bottom-left-radius:var(--borderRadiusNone);}",
101
- ".f3fg2lr{border-top-right-radius:var(--borderRadiusNone);}",
102
- ".f13av6d4{border-top-left-radius:var(--borderRadiusNone);}",
103
- ".f4t8t6x{height:2px;}",
104
- ".f6ywr7j{height:4px;}"
105
- ],
106
- m: [
107
- [
108
- "@media screen and (forced-colors: active){.fu42dvn{background-color:CanvasText;}}",
109
- {
110
- m: "screen and (forced-colors: active)"
111
- }
112
- ]
113
- ]
60
+ d: [".ftgm304{display:block;}", ".f18f03hv{background-color:var(--colorNeutralBackground6);}", ".fly5x3f{width:100%;}", ".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;}"],
61
+ m: [["@media screen and (forced-colors: active){.fu42dvn{background-color:CanvasText;}}", {
62
+ m: "screen and (forced-colors: active)"
63
+ }]]
114
64
  });
115
65
  /**
116
66
  * Styles for the ProgressBar bar
117
- */ const useBarStyles = /*#__PURE__*/ (0, _react["__styles"])({
118
- base: {
119
- Bpep1pd: "f1neahkh",
120
- Bbmb7ep: [
121
- "f1d9uwra",
122
- "fzibvwi"
123
- ],
124
- Beyfa6y: [
125
- "fzibvwi",
126
- "f1d9uwra"
127
- ],
128
- B7oj6ja: [
129
- "fuoumxm",
130
- "f1vtqnvc"
131
- ],
132
- Btl43ni: [
133
- "f1vtqnvc",
134
- "fuoumxm"
135
- ],
136
- Bqenvij: "f1l02sjl"
137
- },
138
- nonZeroDeterminate: {
139
- Bmy1vo4: "fjt6zfz",
140
- B3o57yi: "f1wofebd",
141
- Bkqvd7p: "fv71qf3"
142
- },
143
- indeterminate: {
144
- B2u0y6b: "fa0wk36",
145
- qhf8xq: "f10pi13n",
146
- Bcmaq0h: [
147
- "fpo0yib",
148
- "f1u5hf6c"
149
- ],
150
- Bv12yb3: [
151
- "fwd2bol",
152
- "f14gig94"
153
- ],
154
- vin17d: "f1a27w2r",
155
- Ezkn3b: "f452v7t",
156
- w3vfg9: "f1cpbl36",
157
- Gqtpxc: "f4akx1t",
158
- B3vm3ge: "f18p5put"
159
- },
160
- brand: {
161
- De3pzq: "ftywsgz"
162
- },
163
- error: {
164
- De3pzq: "fdl5y0r"
165
- },
166
- warning: {
167
- De3pzq: "f1s438gw"
168
- },
169
- success: {
170
- De3pzq: "flxk52p"
171
- }
67
+ */
68
+ const useBarStyles = /*#__PURE__*/react_1.__styles({
69
+ base: {
70
+ Bpep1pd: "f1neahkh",
71
+ Bbmb7ep: ["f1d9uwra", "fzibvwi"],
72
+ Beyfa6y: ["fzibvwi", "f1d9uwra"],
73
+ B7oj6ja: ["fuoumxm", "f1vtqnvc"],
74
+ Btl43ni: ["f1vtqnvc", "fuoumxm"],
75
+ Bqenvij: "f1l02sjl"
76
+ },
77
+ nonZeroDeterminate: {
78
+ Bmy1vo4: "fjt6zfz",
79
+ B3o57yi: "f1wofebd",
80
+ Bkqvd7p: "fv71qf3"
81
+ },
82
+ indeterminate: {
83
+ B2u0y6b: "fa0wk36",
84
+ qhf8xq: "f10pi13n",
85
+ Bcmaq0h: ["fpo0yib", "f1u5hf6c"],
86
+ Bv12yb3: ["fwd2bol", "f14gig94"],
87
+ vin17d: "f1a27w2r",
88
+ Ezkn3b: "f452v7t",
89
+ w3vfg9: "f1cpbl36",
90
+ Gqtpxc: "f4akx1t",
91
+ B3vm3ge: "f18p5put"
92
+ },
93
+ brand: {
94
+ De3pzq: "ftywsgz"
95
+ },
96
+ error: {
97
+ De3pzq: "fdl5y0r"
98
+ },
99
+ warning: {
100
+ De3pzq: "f1s438gw"
101
+ },
102
+ success: {
103
+ De3pzq: "flxk52p"
104
+ }
172
105
  }, {
173
- m: [
174
- [
175
- "@media screen and (forced-colors: active){.f1neahkh{background-color:Highlight;}}",
176
- {
177
- m: "screen and (forced-colors: active)"
178
- }
179
- ],
180
- [
181
- "@media screen and (prefers-reduced-motion: reduce){.f4akx1t{-webkit-animation-duration:0.01ms;animation-duration:0.01ms;}}",
182
- {
183
- m: "screen and (prefers-reduced-motion: reduce)"
184
- }
185
- ],
186
- [
187
- "@media screen and (prefers-reduced-motion: reduce){.f18p5put{-webkit-animation-iteration-count:1;animation-iteration-count:1;}}",
188
- {
189
- m: "screen and (prefers-reduced-motion: reduce)"
190
- }
191
- ]
192
- ],
193
- d: [
194
- ".f1d9uwra{border-bottom-right-radius:inherit;}",
195
- ".fzibvwi{border-bottom-left-radius:inherit;}",
196
- ".fuoumxm{border-top-right-radius:inherit;}",
197
- ".f1vtqnvc{border-top-left-radius:inherit;}",
198
- ".f1l02sjl{height:100%;}",
199
- ".fjt6zfz{transition-property:width;}",
200
- ".f1wofebd{transition-duration:0.3s;}",
201
- ".fv71qf3{transition-timing-function:ease;}",
202
- ".fa0wk36{max-width:33%;}",
203
- ".f10pi13n{position:relative;}",
204
- ".fpo0yib{background-image:linear-gradient(\n to right,\n var(--colorNeutralBackground6) 0%,\n var(--colorTransparentBackground) 50%,\n var(--colorNeutralBackground6) 100%\n );}",
205
- ".f1u5hf6c{background-image:linear-gradient(\n to left,\n var(--colorNeutralBackground6) 0%,\n var(--colorTransparentBackground) 50%,\n var(--colorNeutralBackground6) 100%\n );}",
206
- ".fwd2bol{-webkit-animation-name:f1keuaan;animation-name:f1keuaan;}",
207
- ".f14gig94{-webkit-animation-name:f10x8f8u;animation-name:f10x8f8u;}",
208
- ".f1a27w2r{-webkit-animation-duration:3s;animation-duration:3s;}",
209
- ".f452v7t{-webkit-animation-timing-function:linear;animation-timing-function:linear;}",
210
- ".f1cpbl36{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;}",
211
- ".ftywsgz{background-color:var(--colorCompoundBrandBackground);}",
212
- ".fdl5y0r{background-color:var(--colorPaletteRedBackground3);}",
213
- ".f1s438gw{background-color:var(--colorPaletteDarkOrangeBackground3);}",
214
- ".flxk52p{background-color:var(--colorPaletteGreenBackground3);}"
215
- ],
216
- k: [
217
- "@-webkit-keyframes f1keuaan{0%{left:-33%;}100%{left:100%;}}",
218
- "@-webkit-keyframes f10x8f8u{0%{right:-33%;}100%{right:100%;}}",
219
- "@keyframes f1keuaan{0%{left:-33%;}100%{left:100%;}}",
220
- "@keyframes f10x8f8u{0%{right:-33%;}100%{right:100%;}}"
221
- ]
106
+ m: [["@media screen and (forced-colors: active){.f1neahkh{background-color:Highlight;}}", {
107
+ m: "screen and (forced-colors: active)"
108
+ }], ["@media screen and (prefers-reduced-motion: reduce){.f4akx1t{-webkit-animation-duration:0.01ms;animation-duration:0.01ms;}}", {
109
+ m: "screen and (prefers-reduced-motion: reduce)"
110
+ }], ["@media screen and (prefers-reduced-motion: reduce){.f18p5put{-webkit-animation-iteration-count:1;animation-iteration-count:1;}}", {
111
+ m: "screen and (prefers-reduced-motion: reduce)"
112
+ }]],
113
+ 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;}", ".f1l02sjl{height:100%;}", ".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 );}", ".fwd2bol{-webkit-animation-name:f1keuaan;animation-name:f1keuaan;}", ".f14gig94{-webkit-animation-name:f10x8f8u;animation-name:f10x8f8u;}", ".f1a27w2r{-webkit-animation-duration:3s;animation-duration:3s;}", ".f452v7t{-webkit-animation-timing-function:linear;animation-timing-function:linear;}", ".f1cpbl36{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;}", ".ftywsgz{background-color:var(--colorCompoundBrandBackground);}", ".fdl5y0r{background-color:var(--colorPaletteRedBackground3);}", ".f1s438gw{background-color:var(--colorPaletteDarkOrangeBackground3);}", ".flxk52p{background-color:var(--colorPaletteGreenBackground3);}"],
114
+ k: ["@-webkit-keyframes f1keuaan{0%{left:-33%;}100%{left:100%;}}", "@-webkit-keyframes f10x8f8u{0%{right:-33%;}100%{right:100%;}}", "@keyframes f1keuaan{0%{left:-33%;}100%{left:100%;}}", "@keyframes f10x8f8u{0%{right:-33%;}100%{right:100%;}}"]
222
115
  });
223
- const useProgressBarStyles_unstable = (state)=>{
224
- const { color , max , shape , thickness , value } = state;
225
- const rootStyles = useRootStyles();
226
- const barStyles = useBarStyles();
227
- state.root.className = (0, _react.mergeClasses)(progressBarClassNames.root, rootStyles.root, rootStyles[shape], rootStyles[thickness], state.root.className);
228
- if (state.bar) {
229
- state.bar.className = (0, _react.mergeClasses)(progressBarClassNames.bar, barStyles.base, barStyles.brand, value === undefined && barStyles.indeterminate, value !== undefined && value > ZERO_THRESHOLD && barStyles.nonZeroDeterminate, color && value !== undefined && barStyles[color], state.bar.className);
230
- }
231
- if (state.bar && value !== undefined) {
232
- state.bar.style = {
233
- width: Math.min(100, Math.max(0, value / max * 100)) + "%",
234
- ...state.bar.style
235
- };
236
- }
237
- return state;
238
- }; //# sourceMappingURL=useProgressBarStyles.js.map
239
-
116
+ /**
117
+ * Apply styling to the ProgressBar slots based on the state
118
+ */
119
+ const useProgressBarStyles_unstable = state => {
120
+ const {
121
+ color,
122
+ max,
123
+ shape,
124
+ thickness,
125
+ value
126
+ } = state;
127
+ const rootStyles = useRootStyles();
128
+ const barStyles = useBarStyles();
129
+ state.root.className = react_1.mergeClasses(exports.progressBarClassNames.root, rootStyles.root, rootStyles[shape], rootStyles[thickness], state.root.className);
130
+ if (state.bar) {
131
+ state.bar.className = react_1.mergeClasses(exports.progressBarClassNames.bar, barStyles.base, barStyles.brand, value === undefined && barStyles.indeterminate, value !== undefined && value > ZERO_THRESHOLD && barStyles.nonZeroDeterminate, color && value !== undefined && barStyles[color], state.bar.className);
132
+ }
133
+ if (state.bar && value !== undefined) {
134
+ state.bar.style = {
135
+ width: Math.min(100, Math.max(0, value / max * 100)) + '%',
136
+ ...state.bar.style
137
+ };
138
+ }
139
+ return state;
140
+ };
141
+ exports.useProgressBarStyles_unstable = useProgressBarStyles_unstable;
240
142
  //# sourceMappingURL=useProgressBarStyles.js.map