@fluentui/react-progress 9.0.0 → 9.1.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.
- package/CHANGELOG.json +75 -1
- package/CHANGELOG.md +30 -2
- package/lib/components/ProgressBar/ProgressBar.js +5 -0
- package/lib/components/ProgressBar/ProgressBar.js.map +1 -1
- package/lib/components/ProgressBar/renderProgressBar.js.map +1 -1
- package/lib/components/ProgressBar/useProgressBar.js +5 -3
- package/lib/components/ProgressBar/useProgressBar.js.map +1 -1
- package/lib/components/ProgressBar/useProgressBarStyles.js +15 -26
- package/lib/components/ProgressBar/useProgressBarStyles.js.map +1 -1
- package/lib/components/ProgressField/ProgressField.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/clampMax.js +11 -0
- package/lib/utils/clampMax.js.map +1 -0
- package/lib/utils/clampValue.js +18 -0
- package/lib/utils/clampValue.js.map +1 -0
- package/lib/utils/index.js +3 -0
- package/lib/utils/index.js.map +1 -0
- package/lib-amd/components/ProgressBar/ProgressBar.js +3 -1
- package/lib-amd/components/ProgressBar/ProgressBar.js.map +1 -1
- package/lib-amd/components/ProgressBar/useProgressBar.js +5 -2
- package/lib-amd/components/ProgressBar/useProgressBar.js.map +1 -1
- package/lib-amd/components/ProgressBar/useProgressBarStyles.js +7 -12
- package/lib-amd/components/ProgressBar/useProgressBarStyles.js.map +1 -1
- package/lib-amd/utils/clampMax.js +17 -0
- package/lib-amd/utils/clampMax.js.map +1 -0
- package/lib-amd/utils/clampValue.js +24 -0
- package/lib-amd/utils/clampValue.js.map +1 -0
- package/lib-amd/utils/index.js +7 -0
- package/lib-amd/utils/index.js.map +1 -0
- package/lib-commonjs/ProgressBar.js.map +1 -1
- package/lib-commonjs/ProgressField.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/ProgressBar.js +5 -0
- package/lib-commonjs/components/ProgressBar/ProgressBar.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/ProgressBar.types.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/index.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/renderProgressBar.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/useProgressBar.js +5 -3
- package/lib-commonjs/components/ProgressBar/useProgressBar.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/useProgressBarStyles.js +15 -26
- package/lib-commonjs/components/ProgressBar/useProgressBarStyles.js.map +1 -1
- package/lib-commonjs/components/ProgressField/ProgressField.js.map +1 -1
- package/lib-commonjs/components/ProgressField/index.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/clampMax.js +18 -0
- package/lib-commonjs/utils/clampMax.js.map +1 -0
- package/lib-commonjs/utils/clampValue.js +25 -0
- package/lib-commonjs/utils/clampValue.js.map +1 -0
- package/lib-commonjs/utils/index.js +9 -0
- package/lib-commonjs/utils/index.js.map +1 -0
- package/package.json +4 -4
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,81 @@
|
|
|
2
2
|
"name": "@fluentui/react-progress",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 10 Mar 2023 07:11:11 GMT",
|
|
6
|
+
"tag": "@fluentui/react-progress_v9.1.1",
|
|
7
|
+
"version": "9.1.1",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "beachball",
|
|
12
|
+
"package": "@fluentui/react-progress",
|
|
13
|
+
"comment": "Bump @fluentui/react-field to v9.0.0-alpha.23",
|
|
14
|
+
"commit": "3cefc38eed17e3f37cd38fca9099cc9d700cd584"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@fluentui/react-progress",
|
|
19
|
+
"comment": "Bump @fluentui/react-utilities to v9.6.2",
|
|
20
|
+
"commit": "3cefc38eed17e3f37cd38fca9099cc9d700cd584"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"date": "Wed, 08 Mar 2023 17:42:39 GMT",
|
|
27
|
+
"tag": "@fluentui/react-progress_v9.1.0",
|
|
28
|
+
"version": "9.1.0",
|
|
29
|
+
"comments": {
|
|
30
|
+
"minor": [
|
|
31
|
+
{
|
|
32
|
+
"author": "gcox@microsoft.com",
|
|
33
|
+
"package": "@fluentui/react-progress",
|
|
34
|
+
"commit": "34cb9409ea7ac1bb0d88c80312b15b09325e96b3",
|
|
35
|
+
"comment": "feat: custom styles"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"author": "beachball",
|
|
39
|
+
"package": "@fluentui/react-progress",
|
|
40
|
+
"comment": "Bump @fluentui/react-field to v9.0.0-alpha.22",
|
|
41
|
+
"commit": "e0d11faf97f6466f4cd23ed18266cf1e80094f56"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"author": "beachball",
|
|
45
|
+
"package": "@fluentui/react-progress",
|
|
46
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.3.0",
|
|
47
|
+
"commit": "e0d11faf97f6466f4cd23ed18266cf1e80094f56"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"author": "beachball",
|
|
51
|
+
"package": "@fluentui/react-progress",
|
|
52
|
+
"comment": "Bump @fluentui/react-utilities to v9.6.1",
|
|
53
|
+
"commit": "e0d11faf97f6466f4cd23ed18266cf1e80094f56"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"patch": [
|
|
57
|
+
{
|
|
58
|
+
"author": "ololubek@microsoft.com",
|
|
59
|
+
"package": "@fluentui/react-progress",
|
|
60
|
+
"commit": "72b29a2530140bdb11e097d7d7b36f06c66f10fb",
|
|
61
|
+
"comment": "fix: Align WHCM styles with figma and fix documentation typo."
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"author": "ololubek@microsoft.com",
|
|
65
|
+
"package": "@fluentui/react-progress",
|
|
66
|
+
"commit": "efb2274e37c0237f3a10a4630b2696a9880f6398",
|
|
67
|
+
"comment": "fix: Add error checking for incorrect values of max and value props"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"author": "ololubek@microsoft.com",
|
|
71
|
+
"package": "@fluentui/react-progress",
|
|
72
|
+
"commit": "f2c7257775bf2d17c3f9dc6eae0b834a988f8793",
|
|
73
|
+
"comment": "fix: Update ProgressBar styling to have width when display is set to flex"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"date": "Wed, 22 Feb 2023 23:06:06 GMT",
|
|
6
80
|
"tag": "@fluentui/react-progress_v9.0.0",
|
|
7
81
|
"version": "9.0.0",
|
|
8
82
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,40 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-progress
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 10 Mar 2023 07:11:11 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.1.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.1.1)
|
|
8
|
+
|
|
9
|
+
Fri, 10 Mar 2023 07:11:11 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.1.0..@fluentui/react-progress_v9.1.1)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-field to v9.0.0-alpha.23 ([PR #27157](https://github.com/microsoft/fluentui/pull/27157) by beachball)
|
|
15
|
+
- Bump @fluentui/react-utilities to v9.6.2 ([PR #27157](https://github.com/microsoft/fluentui/pull/27157) by beachball)
|
|
16
|
+
|
|
17
|
+
## [9.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.1.0)
|
|
18
|
+
|
|
19
|
+
Wed, 08 Mar 2023 17:42:39 GMT
|
|
20
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.0.0..@fluentui/react-progress_v9.1.0)
|
|
21
|
+
|
|
22
|
+
### Minor changes
|
|
23
|
+
|
|
24
|
+
- feat: custom styles ([PR #27082](https://github.com/microsoft/fluentui/pull/27082) by gcox@microsoft.com)
|
|
25
|
+
- Bump @fluentui/react-field to v9.0.0-alpha.22 ([PR #27127](https://github.com/microsoft/fluentui/pull/27127) by beachball)
|
|
26
|
+
- Bump @fluentui/react-shared-contexts to v9.3.0 ([PR #27127](https://github.com/microsoft/fluentui/pull/27127) by beachball)
|
|
27
|
+
- Bump @fluentui/react-utilities to v9.6.1 ([PR #27127](https://github.com/microsoft/fluentui/pull/27127) by beachball)
|
|
28
|
+
|
|
29
|
+
### Patches
|
|
30
|
+
|
|
31
|
+
- fix: Align WHCM styles with figma and fix documentation typo. ([PR #27038](https://github.com/microsoft/fluentui/pull/27038) by ololubek@microsoft.com)
|
|
32
|
+
- fix: Add error checking for incorrect values of max and value props ([PR #27029](https://github.com/microsoft/fluentui/pull/27029) by ololubek@microsoft.com)
|
|
33
|
+
- fix: Update ProgressBar styling to have width when display is set to flex ([PR #27101](https://github.com/microsoft/fluentui/pull/27101) by ololubek@microsoft.com)
|
|
34
|
+
|
|
7
35
|
## [9.0.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.0.0)
|
|
8
36
|
|
|
9
|
-
Wed, 22 Feb 2023 23:
|
|
37
|
+
Wed, 22 Feb 2023 23:06:06 GMT
|
|
10
38
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.0.0-alpha.19..@fluentui/react-progress_v9.0.0)
|
|
11
39
|
|
|
12
40
|
### Minor changes
|
|
@@ -2,12 +2,17 @@ import * as React from 'react';
|
|
|
2
2
|
import { useProgressBar_unstable } from './useProgressBar';
|
|
3
3
|
import { renderProgressBar_unstable } from './renderProgressBar';
|
|
4
4
|
import { useProgressBarStyles_unstable } from './useProgressBarStyles';
|
|
5
|
+
import { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';
|
|
5
6
|
/**
|
|
6
7
|
* A ProgressBar bar shows the progression of a task.
|
|
7
8
|
*/
|
|
8
9
|
export const ProgressBar = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
9
10
|
const state = useProgressBar_unstable(props, ref);
|
|
10
11
|
useProgressBarStyles_unstable(state);
|
|
12
|
+
const {
|
|
13
|
+
useProgressBarStyles_unstable: useCustomStyles
|
|
14
|
+
} = useCustomStyleHooks_unstable();
|
|
15
|
+
useCustomStyles(state);
|
|
11
16
|
return renderProgressBar_unstable(state);
|
|
12
17
|
});
|
|
13
18
|
ProgressBar.displayName = 'ProgressBar';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","useProgressBar_unstable","renderProgressBar_unstable","useProgressBarStyles_unstable","useCustomStyleHooks_unstable","ProgressBar","forwardRef","props","ref","state","useCustomStyles","displayName"],"sources":["../src/packages/react-components/react-progress/src/components/ProgressBar/ProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useProgressBar_unstable } from './useProgressBar';\nimport { renderProgressBar_unstable } from './renderProgressBar';\nimport { useProgressBarStyles_unstable } from './useProgressBarStyles';\nimport type { ProgressBarProps } from './ProgressBar.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A ProgressBar bar shows the progression of a task.\n */\nexport const ProgressBar: ForwardRefComponent<ProgressBarProps> = React.forwardRef((props, ref) => {\n const state = useProgressBar_unstable(props, ref);\n\n useProgressBarStyles_unstable(state);\n\n const { useProgressBarStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderProgressBar_unstable(state);\n});\n\nProgressBar.displayName = 'ProgressBar';\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,SAASC,0BAA0B,QAAQ,qBAAqB;AAChE,SAASC,6BAA6B,QAAQ,wBAAwB;AAGtE,SAASC,4BAA4B,QAAQ,iCAAiC;AAE9E;;;AAGA,OAAO,MAAMC,WAAW,gBAA0CL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAChG,MAAMC,KAAK,GAAGR,uBAAuB,CAACM,KAAK,EAAEC,GAAG,CAAC;EAEjDL,6BAA6B,CAACM,KAAK,CAAC;EAEpC,MAAM;IAAEN,6BAA6B,EAAEO;EAAe,CAAE,GAAGN,4BAA4B,EAAE;EACzFM,eAAe,CAACD,KAAK,CAAC;EAEtB,OAAOP,0BAA0B,CAACO,KAAK,CAAC;AAC1C,CAAC,CAAC;AAEFJ,WAAW,CAACM,WAAW,GAAG,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","getSlots","renderProgressBar_unstable","state","slots","slotProps","createElement","root","bar"],"sources":["../src/packages/react-components/react-progress/src/components/ProgressBar/renderProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { ProgressBarState, ProgressBarSlots } from './ProgressBar.types';\n\n/**\n * Render the final JSX of ProgressBar\n */\nexport const renderProgressBar_unstable = (state: ProgressBarState) => {\n const { slots, slotProps } = getSlots<ProgressBarSlots>(state);\n return <slots.root {...slotProps.root}>{slots.bar && <slots.bar {...slotProps.bar} />}</slots.root>;\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,0BAA0B,GAAIC,KAAuB,IAAI;EACpE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAmBE,KAAK,CAAC;EAC9D,oBAAOH,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,GAAGH,KAAK,CAACI,GAAG,iBAAIR,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACI,GAAG;IAAA,GAAKH,SAAS,CAACG;EAAG,EAAI,CAAc;AACrG,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
|
|
2
|
+
import { clampValue, clampMax } from '../../utils/index';
|
|
2
3
|
/**
|
|
3
4
|
* Create the state required to render ProgressBar.
|
|
4
5
|
*
|
|
@@ -9,14 +10,15 @@ import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utiliti
|
|
|
9
10
|
* @param ref - reference to root HTMLElement of ProgressBar
|
|
10
11
|
*/
|
|
11
12
|
export const useProgressBar_unstable = (props, ref) => {
|
|
13
|
+
var _a;
|
|
12
14
|
// Props
|
|
13
15
|
const {
|
|
14
16
|
color = 'brand',
|
|
15
|
-
max = 1.0,
|
|
16
17
|
shape = 'rounded',
|
|
17
|
-
thickness = 'medium'
|
|
18
|
-
value
|
|
18
|
+
thickness = 'medium'
|
|
19
19
|
} = props;
|
|
20
|
+
const max = clampMax((_a = props.max) !== null && _a !== void 0 ? _a : 1);
|
|
21
|
+
const value = clampValue(props.value, max);
|
|
20
22
|
const root = getNativeElementProps('div', {
|
|
21
23
|
ref,
|
|
22
24
|
role: 'progressbar',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["getNativeElementProps","resolveShorthand","clampValue","clampMax","useProgressBar_unstable","props","ref","color","shape","thickness","max","_a","value","root","role","undefined","bar","required","state","components"],"sources":["../src/packages/react-components/react-progress/src/components/ProgressBar/useProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { clampValue, clampMax } from '../../utils/index';\nimport type { ProgressBarProps, ProgressBarState } from './ProgressBar.types';\n\n/**\n * Create the state required to render ProgressBar.\n *\n * The returned state can be modified with hooks such as useProgressBarStyles_unstable,\n * before being passed to renderProgressBar_unstable.\n *\n * @param props - props from this instance of ProgressBar\n * @param ref - reference to root HTMLElement of ProgressBar\n */\nexport const useProgressBar_unstable = (props: ProgressBarProps, ref: React.Ref<HTMLElement>): ProgressBarState => {\n // Props\n const { color = 'brand', shape = 'rounded', thickness = 'medium' } = props;\n const max = clampMax(props.max ?? 1);\n const value = clampValue(props.value, max);\n\n const root = getNativeElementProps('div', {\n ref,\n role: 'progressbar',\n 'aria-valuemin': value !== undefined ? 0 : undefined,\n 'aria-valuemax': value !== undefined ? max : undefined,\n 'aria-valuenow': value,\n ...props,\n });\n\n const bar = resolveShorthand(props.bar, {\n required: true,\n });\n\n const state: ProgressBarState = {\n color,\n max,\n shape,\n thickness,\n value,\n components: {\n root: 'div',\n bar: 'div',\n },\n root,\n bar,\n };\n\n return state;\n};\n"],"mappings":"AACA,SAASA,qBAAqB,EAAEC,gBAAgB,QAAQ,2BAA2B;AACnF,SAASC,UAAU,EAAEC,QAAQ,QAAQ,mBAAmB;AAGxD;;;;;;;;;AASA,OAAO,MAAMC,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,QAAQ,CAAC,CAAAQ,EAAA,GAAAN,KAAK,CAACK,GAAG,cAAAC,EAAA,cAAAA,EAAA,GAAI,CAAC,CAAC;EACpC,MAAMC,KAAK,GAAGV,UAAU,CAACG,KAAK,CAACO,KAAK,EAAEF,GAAG,CAAC;EAE1C,MAAMG,IAAI,GAAGb,qBAAqB,CAAC,KAAK,EAAE;IACxCM,GAAG;IACHQ,IAAI,EAAE,aAAa;IACnB,eAAe,EAAEF,KAAK,KAAKG,SAAS,GAAG,CAAC,GAAGA,SAAS;IACpD,eAAe,EAAEH,KAAK,KAAKG,SAAS,GAAGL,GAAG,GAAGK,SAAS;IACtD,eAAe,EAAEH,KAAK;IACtB,GAAGP;GACJ,CAAC;EAEF,MAAMW,GAAG,GAAGf,gBAAgB,CAACI,KAAK,CAACW,GAAG,EAAE;IACtCC,QAAQ,EAAE;GACX,CAAC;EAEF,MAAMC,KAAK,GAAqB;IAC9BX,KAAK;IACLG,GAAG;IACHF,KAAK;IACLC,SAAS;IACTG,KAAK;IACLO,UAAU,EAAE;MACVN,IAAI,EAAE,KAAK;MACXG,GAAG,EAAE;KACN;IACDH,IAAI;IACJG;GACD;EAED,OAAOE,KAAK;AACd,CAAC"}
|
|
@@ -35,12 +35,10 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
35
35
|
root: {
|
|
36
36
|
mc9l5x: "ftgm304",
|
|
37
37
|
De3pzq: "f18f03hv",
|
|
38
|
-
|
|
38
|
+
a9b677: "fly5x3f",
|
|
39
39
|
B68tc82: "f1p9o1ba",
|
|
40
40
|
Bmxbyg5: "f1sil6mw",
|
|
41
|
-
|
|
42
|
-
tu2nte: "f1mcb20s",
|
|
43
|
-
y0r1ed: "fek7wd8"
|
|
41
|
+
Bpep1pd: "fu42dvn"
|
|
44
42
|
},
|
|
45
43
|
rounded: {
|
|
46
44
|
Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
|
|
@@ -61,12 +59,8 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
61
59
|
Bqenvij: "f6ywr7j"
|
|
62
60
|
}
|
|
63
61
|
}, {
|
|
64
|
-
d: [".ftgm304{display:block;}", ".f18f03hv{background-color:var(--colorNeutralBackground6);}", ".
|
|
65
|
-
m: [["@media screen and (forced-colors: active){.
|
|
66
|
-
m: "screen and (forced-colors: active)"
|
|
67
|
-
}], ["@media screen and (forced-colors: active){.f1mcb20s{border-bottom-style:solid;}}", {
|
|
68
|
-
m: "screen and (forced-colors: active)"
|
|
69
|
-
}], ["@media screen and (forced-colors: active){.fek7wd8{border-bottom-color:CanvasText;}}", {
|
|
62
|
+
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;}"],
|
|
63
|
+
m: [["@media screen and (forced-colors: active){.fu42dvn{background-color:CanvasText;}}", {
|
|
70
64
|
m: "screen and (forced-colors: active)"
|
|
71
65
|
}]]
|
|
72
66
|
});
|
|
@@ -75,16 +69,12 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
75
69
|
*/
|
|
76
70
|
const useBarStyles = /*#__PURE__*/__styles({
|
|
77
71
|
base: {
|
|
72
|
+
Bpep1pd: "f1neahkh",
|
|
78
73
|
Bbmb7ep: ["f1d9uwra", "fzibvwi"],
|
|
79
74
|
Beyfa6y: ["fzibvwi", "f1d9uwra"],
|
|
80
75
|
B7oj6ja: ["fuoumxm", "f1vtqnvc"],
|
|
81
|
-
Btl43ni: ["f1vtqnvc", "fuoumxm"]
|
|
82
|
-
|
|
83
|
-
medium: {
|
|
84
|
-
Bqenvij: "f4t8t6x"
|
|
85
|
-
},
|
|
86
|
-
large: {
|
|
87
|
-
Bqenvij: "f6ywr7j"
|
|
76
|
+
Btl43ni: ["f1vtqnvc", "fuoumxm"],
|
|
77
|
+
Bqenvij: "f1l02sjl"
|
|
88
78
|
},
|
|
89
79
|
nonZeroDeterminate: {
|
|
90
80
|
Bmy1vo4: "fjt6zfz",
|
|
@@ -105,8 +95,7 @@ const useBarStyles = /*#__PURE__*/__styles({
|
|
|
105
95
|
Bv12yb3: "fjhwsai"
|
|
106
96
|
},
|
|
107
97
|
brand: {
|
|
108
|
-
De3pzq: "ftywsgz"
|
|
109
|
-
Bpep1pd: "f1neahkh"
|
|
98
|
+
De3pzq: "ftywsgz"
|
|
110
99
|
},
|
|
111
100
|
error: {
|
|
112
101
|
De3pzq: "fdl5y0r"
|
|
@@ -118,15 +107,15 @@ const useBarStyles = /*#__PURE__*/__styles({
|
|
|
118
107
|
De3pzq: "flxk52p"
|
|
119
108
|
}
|
|
120
109
|
}, {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
110
|
+
m: [["@media screen and (forced-colors: active){.f1neahkh{background-color:Highlight;}}", {
|
|
111
|
+
m: "screen and (forced-colors: active)"
|
|
112
|
+
}], ["@media screen and (prefers-reduced-motion: reduce){.f4akx1t{-webkit-animation-duration:0.01ms;animation-duration:0.01ms;}}", {
|
|
124
113
|
m: "screen and (prefers-reduced-motion: reduce)"
|
|
125
114
|
}], ["@media screen and (prefers-reduced-motion: reduce){.f18p5put{-webkit-animation-iteration-count:1;animation-iteration-count:1;}}", {
|
|
126
115
|
m: "screen and (prefers-reduced-motion: reduce)"
|
|
127
|
-
}],
|
|
128
|
-
|
|
129
|
-
}]
|
|
116
|
+
}]],
|
|
117
|
+
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 );}", ".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);}"],
|
|
118
|
+
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%;}}"]
|
|
130
119
|
});
|
|
131
120
|
/**
|
|
132
121
|
* Apply styling to the ProgressBar slots based on the state
|
|
@@ -146,7 +135,7 @@ export const useProgressBarStyles_unstable = state => {
|
|
|
146
135
|
} = useFluent();
|
|
147
136
|
state.root.className = mergeClasses(progressBarClassNames.root, rootStyles.root, rootStyles[shape], rootStyles[thickness], state.root.className);
|
|
148
137
|
if (state.bar) {
|
|
149
|
-
state.bar.className = mergeClasses(progressBarClassNames.bar, barStyles.base, barStyles.brand, value === undefined && barStyles.indeterminate, value === undefined && dir === 'rtl' && barStyles.rtl,
|
|
138
|
+
state.bar.className = mergeClasses(progressBarClassNames.bar, barStyles.base, barStyles.brand, value === undefined && barStyles.indeterminate, value === undefined && dir === 'rtl' && barStyles.rtl, value !== undefined && value > ZERO_THRESHOLD && barStyles.nonZeroDeterminate, color && value !== undefined && barStyles[color], state.bar.className);
|
|
150
139
|
}
|
|
151
140
|
if (state.bar && value !== undefined) {
|
|
152
141
|
state.bar.style = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","useFluent_unstable","useFluent","progressBarClassNames","root","bar","ZERO_THRESHOLD","barThicknessValues","medium","large","indeterminateProgressBar","left","indeterminateProgressBarRTL","right","useRootStyles","mc9l5x","De3pzq","a9b677","B68tc82","Bmxbyg5","Bpep1pd","rounded","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","square","Bqenvij","d","m","useBarStyles","base","nonZeroDeterminate","Bmy1vo4","B3o57yi","Bkqvd7p","indeterminate","B2u0y6b","qhf8xq","Bcmaq0h","Bv12yb3","vin17d","w3vfg9","Gqtpxc","B3vm3ge","rtl","brand","error","warning","success","k","useProgressBarStyles_unstable","state","color","max","shape","thickness","value","rootStyles","barStyles","dir","className","undefined","style","width","Math","min"],"sources":["../src/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 width: '100%',\n ...shorthands.overflow('hidden'),\n\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'CanvasText',\n },\n },\n rounded: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n square: {\n ...shorthands.borderRadius(tokens.borderRadiusNone),\n },\n medium: {\n height: barThicknessValues.medium,\n },\n large: {\n height: barThicknessValues.large,\n },\n});\n\n/**\n * Styles for the ProgressBar bar\n */\nconst useBarStyles = makeStyles({\n base: {\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'Highlight',\n },\n ...shorthands.borderRadius('inherit'),\n height: '100%',\n },\n nonZeroDeterminate: {\n transitionProperty: 'width',\n transitionDuration: '0.3s',\n transitionTimingFunction: 'ease',\n },\n indeterminate: {\n maxWidth: '33%',\n position: 'relative',\n backgroundImage: `linear-gradient(\n to right,\n ${tokens.colorNeutralBackground6} 0%,\n ${tokens.colorTransparentBackground} 50%,\n ${tokens.colorNeutralBackground6} 100%\n )`,\n animationName: indeterminateProgressBar,\n animationDuration: '3s',\n animationIterationCount: 'infinite',\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationDuration: '0.01ms',\n animationIterationCount: '1',\n },\n },\n\n rtl: {\n animationName: indeterminateProgressBarRTL,\n },\n\n brand: {\n backgroundColor: tokens.colorCompoundBrandBackground,\n },\n\n error: {\n backgroundColor: tokens.colorPaletteRedBackground3,\n },\n warning: {\n backgroundColor: tokens.colorPaletteDarkOrangeBackground3,\n },\n success: {\n backgroundColor: tokens.colorPaletteGreenBackground3,\n },\n});\n\n/**\n * Apply styling to the ProgressBar slots based on the state\n */\nexport const useProgressBarStyles_unstable = (state: ProgressBarState): ProgressBarState => {\n const { color, max, shape, thickness, value } = state;\n const rootStyles = useRootStyles();\n const barStyles = useBarStyles();\n const { dir } = useFluent();\n\n state.root.className = mergeClasses(\n progressBarClassNames.root,\n rootStyles.root,\n rootStyles[shape],\n rootStyles[thickness],\n state.root.className,\n );\n\n if (state.bar) {\n state.bar.className = mergeClasses(\n progressBarClassNames.bar,\n barStyles.base,\n barStyles.brand,\n value === undefined && barStyles.indeterminate,\n value === undefined && dir === 'rtl' && barStyles.rtl,\n value !== undefined && value > ZERO_THRESHOLD && barStyles.nonZeroDeterminate,\n color && value !== undefined && barStyles[color],\n state.bar.className,\n );\n }\n\n if (state.bar && value !== undefined) {\n state.bar.style = {\n width: Math.min(100, Math.max(0, (value / max) * 100)) + '%',\n ...state.bar.style,\n };\n }\n\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,kBAAkB,IAAIC,SAAS,QAAQ,iCAAiC;AAIjF,OAAO,MAAMC,qBAAqB,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,EAAE;IACNA,IAAI,EAAE;;CAET;AACD,MAAMC,2BAA2B,GAAG;EAClC,MAAM,EAAE;IACNC,KAAK,EAAE;GACR;EACD,IAAI,EAAE;IACJA,KAAK,EAAE;;CAEV;AAED;;;AAGA,MAAMC,aAAa,gBAAGjB,QAAA;EAAAO,IAAA;IAAAW,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA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AAI,EACfsD,UAAU,CAACH,KAAK,CAAC,EACjBG,UAAU,CAACF,SAAS,CAAC,EACrBJ,KAAK,CAAChD,IAAI,CAACyD,SAAS,CACrB;EAED,IAAIT,KAAK,CAAC/C,GAAG,EAAE;IACb+C,KAAK,CAAC/C,GAAG,CAACwD,SAAS,GAAG/D,YAAY,CAChCK,qBAAqB,CAACE,GAAG,EACzBsD,SAAS,CAAC5B,IAAI,EACd4B,SAAS,CAACb,KAAK,EACfW,KAAK,KAAKK,SAAS,IAAIH,SAAS,CAACvB,aAAa,EAC9CqB,KAAK,KAAKK,SAAS,IAAIF,GAAG,KAAK,KAAK,IAAID,SAAS,CAACd,GAAG,EACrDY,KAAK,KAAKK,SAAS,IAAIL,KAAK,GAAGnD,cAAc,IAAIqD,SAAS,CAAC3B,kBAAkB,EAC7EqB,KAAK,IAAII,KAAK,KAAKK,SAAS,IAAIH,SAAS,CAACN,KAAK,CAAC,EAChDD,KAAK,CAAC/C,GAAG,CAACwD,SAAS,CACpB;;EAGH,IAAIT,KAAK,CAAC/C,GAAG,IAAIoD,KAAK,KAAKK,SAAS,EAAE;IACpCV,KAAK,CAAC/C,GAAG,CAAC0D,KAAK,GAAG;MAChBC,KAAK,EAAEC,IAAI,CAACC,GAAG,CAAC,GAAG,EAAED,IAAI,CAACX,GAAG,CAAC,CAAC,EAAGG,KAAK,GAAGH,GAAG,GAAI,GAAG,CAAC,CAAC,GAAG,GAAG;MAC5D,GAAGF,KAAK,CAAC/C,GAAG,CAAC0D;KACd;;EAGH,OAAOX,KAAK;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["getDeprecatedFieldClassNames","makeDeprecatedField","ProgressBar","progressBarClassNames","progressFieldClassNames","root","ProgressField","displayName","mapProps","props","control","validationState"],"sources":["../src/packages/react-components/react-progress/src/components/ProgressField/ProgressField.tsx"],"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"],"mappings":"AAAA;AACA,SAA+BA,4BAA4B,EAAEC,mBAAmB,QAAQ,uBAAuB;AAE/G,SAASC,WAAW,EAAEC,qBAAqB,QAA0B,mBAAmB;AAIxF;AACA,OAAO,MAAMC,uBAAuB,gBAAGJ,4BAA4B,CAACG,qBAAqB,CAACE,IAAI,CAAC;AAC/F;AACA,OAAO,MAAMC,aAAa,gBAA4CL,mBAAmB,CAACC,WAAW,EAAE;EACrGK,WAAW,EAAE,eAAe;EAC5BC,QAAQ,EAAGC,KAAyB,KAAM;IACxC,GAAGA,KAAK;IACRC,OAAO,EAAE;MAAE,GAAGD,KAAK,CAACC,OAAO;MAAEC,eAAe,EAAEF,KAAK,CAACE;IAAe;GACpE;CACF,CAAC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["ProgressBar","progressBarClassNames","renderProgressBar_unstable","useProgressBar_unstable","useProgressBarStyles_unstable","ProgressField","ProgressField_unstable","progressFieldClassNames"],"sources":["../src/packages/react-components/react-progress/src/index.ts"],"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"],"mappings":"AAAA,SACEA,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,uBAAuB,EACvBC,6BAA6B,QACxB,eAAe;AAGtB;AACA,SAASC,aAAa,IAAIC,sBAAsB,EAAEC,uBAAuB,QAAQ,iBAAiB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const clampMax = max => {
|
|
2
|
+
const internalMax = max <= 0 ? 1 : max;
|
|
3
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4
|
+
if (max <= 0) {
|
|
5
|
+
// eslint-disable-next-line no-console
|
|
6
|
+
console.error(`The prop 'max' must be greater than 0. Received max: ${max}`);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return internalMax;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=clampMax.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["clampMax","max","internalMax","process","env","NODE_ENV","console","error"],"sources":["../src/packages/react-components/react-progress/src/utils/clampMax.ts"],"sourcesContent":["export const clampMax = (max: number): number => {\n const internalMax = max <= 0 ? 1 : max;\n\n if (process.env.NODE_ENV !== 'production') {\n if (max <= 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'max' must be greater than 0. Received max: ${max}`);\n }\n }\n return internalMax;\n};\n"],"mappings":"AAAA,OAAO,MAAMA,QAAQ,GAAIC,GAAW,IAAY;EAC9C,MAAMC,WAAW,GAAGD,GAAG,IAAI,CAAC,GAAG,CAAC,GAAGA,GAAG;EAEtC,IAAIE,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC,IAAIJ,GAAG,IAAI,CAAC,EAAE;MACZ;MACAK,OAAO,CAACC,KAAK,CAAC,wDAAwDN,GAAG,EAAE,CAAC;;;EAGhF,OAAOC,WAAW;AACpB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const clampValue = (value, max) => {
|
|
2
|
+
if (value === undefined) {
|
|
3
|
+
return value;
|
|
4
|
+
}
|
|
5
|
+
const internalValue = value < 0 ? 0 : value > max ? max : value;
|
|
6
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
7
|
+
if (value < 0) {
|
|
8
|
+
// eslint-disable-next-line no-console
|
|
9
|
+
console.error(`The prop 'value' must be greater than or equal to zero. Received value: ${value}`);
|
|
10
|
+
}
|
|
11
|
+
if (value > max) {
|
|
12
|
+
// eslint-disable-next-line no-console
|
|
13
|
+
console.error(`The prop 'value' must be less than or equal to 'max'. Received value: ${value}, max: ${max}`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return internalValue;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=clampValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["clampValue","value","max","undefined","internalValue","process","env","NODE_ENV","console","error"],"sources":["../src/packages/react-components/react-progress/src/utils/clampValue.ts"],"sourcesContent":["export const clampValue = (value: number | undefined, max: number): number | undefined => {\n if (value === undefined) {\n return value;\n }\n const internalValue = value < 0 ? 0 : value > max ? max : value;\n\n if (process.env.NODE_ENV !== 'production') {\n if (value < 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be greater than or equal to zero. Received value: ${value}`);\n }\n if (value > max) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be less than or equal to 'max'. Received value: ${value}, max: ${max}`);\n }\n }\n return internalValue;\n};\n"],"mappings":"AAAA,OAAO,MAAMA,UAAU,GAAGA,CAACC,KAAyB,EAAEC,GAAW,KAAwB;EACvF,IAAID,KAAK,KAAKE,SAAS,EAAE;IACvB,OAAOF,KAAK;;EAEd,MAAMG,aAAa,GAAGH,KAAK,GAAG,CAAC,GAAG,CAAC,GAAGA,KAAK,GAAGC,GAAG,GAAGA,GAAG,GAAGD,KAAK;EAE/D,IAAII,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC,IAAIN,KAAK,GAAG,CAAC,EAAE;MACb;MACAO,OAAO,CAACC,KAAK,CAAC,2EAA2ER,KAAK,EAAE,CAAC;;IAEnG,IAAIA,KAAK,GAAGC,GAAG,EAAE;MACf;MACAM,OAAO,CAACC,KAAK,CAAC,yEAAyER,KAAK,UAAUC,GAAG,EAAE,CAAC;;;EAGhH,OAAOE,aAAa;AACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-progress/src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC","sourcesContent":["export * from './clampMax';\nexport * from './clampValue';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define(["require", "exports", "react", "./useProgressBar", "./renderProgressBar", "./useProgressBarStyles"], function (require, exports, React, useProgressBar_1, renderProgressBar_1, useProgressBarStyles_1) {
|
|
1
|
+
define(["require", "exports", "react", "./useProgressBar", "./renderProgressBar", "./useProgressBarStyles", "@fluentui/react-shared-contexts"], function (require, exports, React, useProgressBar_1, renderProgressBar_1, useProgressBarStyles_1, react_shared_contexts_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.ProgressBar = void 0;
|
|
@@ -8,6 +8,8 @@ define(["require", "exports", "react", "./useProgressBar", "./renderProgressBar"
|
|
|
8
8
|
exports.ProgressBar = React.forwardRef(function (props, ref) {
|
|
9
9
|
var state = useProgressBar_1.useProgressBar_unstable(props, ref);
|
|
10
10
|
useProgressBarStyles_1.useProgressBarStyles_unstable(state);
|
|
11
|
+
var useCustomStyles = react_shared_contexts_1.useCustomStyleHooks_unstable().useProgressBarStyles_unstable;
|
|
12
|
+
useCustomStyles(state);
|
|
11
13
|
return renderProgressBar_1.renderProgressBar_unstable(state);
|
|
12
14
|
});
|
|
13
15
|
exports.ProgressBar.displayName = 'ProgressBar';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-progress/src/components/ProgressBar/ProgressBar.tsx"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-progress/src/components/ProgressBar/ProgressBar.tsx"],"names":[],"mappings":";;;;IAQA;;OAEG;IACU,QAAA,WAAW,GAA0C,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAC5F,IAAM,KAAK,GAAG,wCAAuB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAElD,oDAA6B,CAAC,KAAK,CAAC,CAAC;QAE7B,IAA+B,eAAe,GAAK,oDAA4B,EAAE,8BAAnC,CAAoC;QAC1F,eAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,8CAA0B,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","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"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-utilities", "../../utils/index"], function (require, exports, tslib_1, react_utilities_1, index_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.useProgressBar_unstable = void 0;
|
|
@@ -12,8 +12,11 @@ define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (r
|
|
|
12
12
|
* @param ref - reference to root HTMLElement of ProgressBar
|
|
13
13
|
*/
|
|
14
14
|
var useProgressBar_unstable = function (props, ref) {
|
|
15
|
+
var _a;
|
|
15
16
|
// Props
|
|
16
|
-
var
|
|
17
|
+
var _b = props.color, color = _b === void 0 ? 'brand' : _b, _c = props.shape, shape = _c === void 0 ? 'rounded' : _c, _d = props.thickness, thickness = _d === void 0 ? 'medium' : _d;
|
|
18
|
+
var max = index_1.clampMax((_a = props.max) !== null && _a !== void 0 ? _a : 1);
|
|
19
|
+
var value = index_1.clampValue(props.value, max);
|
|
17
20
|
var root = react_utilities_1.getNativeElementProps('div', tslib_1.__assign({ ref: ref, role: 'progressbar', 'aria-valuemin': value !== undefined ? 0 : undefined, 'aria-valuemax': value !== undefined ? max : undefined, 'aria-valuenow': value }, props));
|
|
18
21
|
var bar = react_utilities_1.resolveShorthand(props.bar, {
|
|
19
22
|
required: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProgressBar.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-progress/src/components/ProgressBar/useProgressBar.tsx"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"useProgressBar.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-progress/src/components/ProgressBar/useProgressBar.tsx"],"names":[],"mappings":";;;;IAKA;;;;;;;;OAQG;IACI,IAAM,uBAAuB,GAAG,UAAC,KAAuB,EAAE,GAA2B;;QAC1F,QAAQ;QACA,IAAA,KAA6D,KAAK,MAAnD,EAAf,KAAK,mBAAG,OAAO,KAAA,EAAE,KAA4C,KAAK,MAAhC,EAAjB,KAAK,mBAAG,SAAS,KAAA,EAAE,KAAyB,KAAK,UAAV,EAApB,SAAS,mBAAG,QAAQ,KAAA,CAAW;QAC3E,IAAM,GAAG,GAAG,gBAAQ,CAAC,MAAA,KAAK,CAAC,GAAG,mCAAI,CAAC,CAAC,CAAC;QACrC,IAAM,KAAK,GAAG,kBAAU,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAE3C,IAAM,IAAI,GAAG,uCAAqB,CAAC,KAAK,qBACtC,GAAG,KAAA,EACH,IAAI,EAAE,aAAa,EACnB,eAAe,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EACpD,eAAe,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EACtD,eAAe,EAAE,KAAK,IACnB,KAAK,EACR,CAAC;QAEH,IAAM,GAAG,GAAG,kCAAgB,CAAC,KAAK,CAAC,GAAG,EAAE;YACtC,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QAEH,IAAM,KAAK,GAAqB;YAC9B,KAAK,OAAA;YACL,GAAG,KAAA;YACH,KAAK,OAAA;YACL,SAAS,WAAA;YACT,KAAK,OAAA;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,KAAK;gBACX,GAAG,EAAE,KAAK;aACX;YACD,IAAI,MAAA;YACJ,GAAG,KAAA;SACJ,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAlCW,QAAA,uBAAuB,2BAkClC","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"]}
|
|
@@ -33,7 +33,9 @@ define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-theme"
|
|
|
33
33
|
* Styles for the root slot
|
|
34
34
|
*/
|
|
35
35
|
var useRootStyles = react_1.makeStyles({
|
|
36
|
-
root: tslib_1.__assign(tslib_1.__assign({ display: 'block', backgroundColor: react_theme_1.tokens.colorNeutralBackground6,
|
|
36
|
+
root: tslib_1.__assign(tslib_1.__assign({ display: 'block', backgroundColor: react_theme_1.tokens.colorNeutralBackground6, width: '100%' }, react_1.shorthands.overflow('hidden')), { '@media screen and (forced-colors: active)': {
|
|
37
|
+
backgroundColor: 'CanvasText',
|
|
38
|
+
} }),
|
|
37
39
|
rounded: tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusMedium)),
|
|
38
40
|
square: tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusNone)),
|
|
39
41
|
medium: {
|
|
@@ -47,13 +49,9 @@ define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-theme"
|
|
|
47
49
|
* Styles for the ProgressBar bar
|
|
48
50
|
*/
|
|
49
51
|
var useBarStyles = react_1.makeStyles({
|
|
50
|
-
base: tslib_1.__assign({
|
|
51
|
-
|
|
52
|
-
height:
|
|
53
|
-
},
|
|
54
|
-
large: {
|
|
55
|
-
height: barThicknessValues.large,
|
|
56
|
-
},
|
|
52
|
+
base: tslib_1.__assign(tslib_1.__assign({ '@media screen and (forced-colors: active)': {
|
|
53
|
+
backgroundColor: 'Highlight',
|
|
54
|
+
} }, react_1.shorthands.borderRadius('inherit')), { height: '100%' }),
|
|
57
55
|
nonZeroDeterminate: {
|
|
58
56
|
transitionProperty: 'width',
|
|
59
57
|
transitionDuration: '0.3s',
|
|
@@ -76,9 +74,6 @@ define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-theme"
|
|
|
76
74
|
},
|
|
77
75
|
brand: {
|
|
78
76
|
backgroundColor: react_theme_1.tokens.colorCompoundBrandBackground,
|
|
79
|
-
'@media screen and (forced-colors: active)': {
|
|
80
|
-
backgroundColor: 'Highlight',
|
|
81
|
-
},
|
|
82
77
|
},
|
|
83
78
|
error: {
|
|
84
79
|
backgroundColor: react_theme_1.tokens.colorPaletteRedBackground3,
|
|
@@ -100,7 +95,7 @@ define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-theme"
|
|
|
100
95
|
var dir = react_shared_contexts_1.useFluent_unstable().dir;
|
|
101
96
|
state.root.className = react_1.mergeClasses(exports.progressBarClassNames.root, rootStyles.root, rootStyles[shape], rootStyles[thickness], state.root.className);
|
|
102
97
|
if (state.bar) {
|
|
103
|
-
state.bar.className = react_1.mergeClasses(exports.progressBarClassNames.bar, barStyles.base, barStyles.brand, value === undefined && barStyles.indeterminate, value === undefined && dir === 'rtl' && barStyles.rtl,
|
|
98
|
+
state.bar.className = react_1.mergeClasses(exports.progressBarClassNames.bar, barStyles.base, barStyles.brand, value === undefined && barStyles.indeterminate, value === undefined && dir === 'rtl' && barStyles.rtl, value !== undefined && value > ZERO_THRESHOLD && barStyles.nonZeroDeterminate, color && value !== undefined && barStyles[color], state.bar.className);
|
|
104
99
|
}
|
|
105
100
|
if (state.bar && value !== undefined) {
|
|
106
101
|
state.bar.style = tslib_1.__assign({ width: Math.min(100, Math.max(0, (value / max) * 100)) + '%' }, state.bar.style);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProgressBarStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-progress/src/components/ProgressBar/useProgressBarStyles.ts"],"names":[],"mappings":";;;;IAMa,QAAA,qBAAqB,GAAqC;QACrE,IAAI,EAAE,iBAAiB;QACvB,GAAG,EAAE,sBAAsB;KAC5B,CAAC;IAEF,sDAAsD;IACtD,oDAAoD;IACpD,IAAM,cAAc,GAAG,IAAI,CAAC;IAE5B,IAAM,kBAAkB,GAAG;QACzB,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,KAAK;KACb,CAAC;IAEF,IAAM,wBAAwB,GAAG;QAC/B,IAAI,EAAE;YACJ,IAAI,EAAE,qBAAqB;SAC5B;QACD,MAAM,EAAE;YACN,IAAI,EAAE,oBAAoB;SAC3B;KACF,CAAC;IACF,IAAM,2BAA2B,GAAG;QAClC,MAAM,EAAE;YACN,KAAK,EAAE,qBAAqB;SAC7B;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,oBAAoB;SAC5B;KACF,CAAC;IAEF;;OAEG;IACH,IAAM,aAAa,GAAG,kBAAU,CAAC;QAC/B,IAAI,sCACF,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,oBAAM,CAAC,uBAAuB,EAC/C,
|
|
1
|
+
{"version":3,"file":"useProgressBarStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-progress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,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,KAAK,KAAK,SAAS,IAAI,KAAK,GAAG,cAAc,IAAI,SAAS,CAAC,kBAAkB,EAC7E,KAAK,IAAI,KAAK,KAAK,SAAS,IAAI,SAAS,CAAC,KAAK,CAAC,EAChD,KAAK,CAAC,GAAG,CAAC,SAAS,CACpB,CAAC;SACH;QAED,IAAI,KAAK,CAAC,GAAG,IAAI,KAAK,KAAK,SAAS,EAAE;YACpC,KAAK,CAAC,GAAG,CAAC,KAAK,sBACb,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,IACzD,KAAK,CAAC,GAAG,CAAC,KAAK,CACnB,CAAC;SACH;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAnCW,QAAA,6BAA6B,iCAmCxC","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport type { ProgressBarState, ProgressBarSlots } from './ProgressBar.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const progressBarClassNames: SlotClassNames<ProgressBarSlots> = {\n root: 'fui-ProgressBar',\n bar: 'fui-ProgressBar__bar',\n};\n\n// If the percentComplete is near 0, don't animate it.\n// This prevents animations on reset to 0 scenarios.\nconst ZERO_THRESHOLD = 0.01;\n\nconst barThicknessValues = {\n medium: '2px',\n large: '4px',\n};\n\nconst indeterminateProgressBar = {\n '0%': {\n left: '-100% /* @noflip */',\n },\n '100%': {\n left: '100% /* @noflip */',\n },\n};\nconst indeterminateProgressBarRTL = {\n '100%': {\n right: '-100% /* @noflip */',\n },\n '0%': {\n right: '100% /* @noflip */',\n },\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n root: {\n display: 'block',\n backgroundColor: tokens.colorNeutralBackground6,\n width: '100%',\n ...shorthands.overflow('hidden'),\n\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'CanvasText',\n },\n },\n rounded: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n square: {\n ...shorthands.borderRadius(tokens.borderRadiusNone),\n },\n medium: {\n height: barThicknessValues.medium,\n },\n large: {\n height: barThicknessValues.large,\n },\n});\n\n/**\n * Styles for the ProgressBar bar\n */\nconst useBarStyles = makeStyles({\n base: {\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'Highlight',\n },\n ...shorthands.borderRadius('inherit'),\n height: '100%',\n },\n nonZeroDeterminate: {\n transitionProperty: 'width',\n transitionDuration: '0.3s',\n transitionTimingFunction: 'ease',\n },\n indeterminate: {\n maxWidth: '33%',\n position: 'relative',\n backgroundImage: `linear-gradient(\n to right,\n ${tokens.colorNeutralBackground6} 0%,\n ${tokens.colorTransparentBackground} 50%,\n ${tokens.colorNeutralBackground6} 100%\n )`,\n animationName: indeterminateProgressBar,\n animationDuration: '3s',\n animationIterationCount: 'infinite',\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationDuration: '0.01ms',\n animationIterationCount: '1',\n },\n },\n\n rtl: {\n animationName: indeterminateProgressBarRTL,\n },\n\n brand: {\n backgroundColor: tokens.colorCompoundBrandBackground,\n },\n\n error: {\n backgroundColor: tokens.colorPaletteRedBackground3,\n },\n warning: {\n backgroundColor: tokens.colorPaletteDarkOrangeBackground3,\n },\n success: {\n backgroundColor: tokens.colorPaletteGreenBackground3,\n },\n});\n\n/**\n * Apply styling to the ProgressBar slots based on the state\n */\nexport const useProgressBarStyles_unstable = (state: ProgressBarState): ProgressBarState => {\n const { color, max, shape, thickness, value } = state;\n const rootStyles = useRootStyles();\n const barStyles = useBarStyles();\n const { dir } = useFluent();\n\n state.root.className = mergeClasses(\n progressBarClassNames.root,\n rootStyles.root,\n rootStyles[shape],\n rootStyles[thickness],\n state.root.className,\n );\n\n if (state.bar) {\n state.bar.className = mergeClasses(\n progressBarClassNames.bar,\n barStyles.base,\n barStyles.brand,\n value === undefined && barStyles.indeterminate,\n value === undefined && dir === 'rtl' && barStyles.rtl,\n value !== undefined && value > ZERO_THRESHOLD && barStyles.nonZeroDeterminate,\n color && value !== undefined && barStyles[color],\n state.bar.className,\n );\n }\n\n if (state.bar && value !== undefined) {\n state.bar.style = {\n width: Math.min(100, Math.max(0, (value / max) * 100)) + '%',\n ...state.bar.style,\n };\n }\n\n return state;\n};\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
define(["require", "exports"], function (require, exports) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clampMax = void 0;
|
|
5
|
+
var clampMax = function (max) {
|
|
6
|
+
var internalMax = max <= 0 ? 1 : max;
|
|
7
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
8
|
+
if (max <= 0) {
|
|
9
|
+
// eslint-disable-next-line no-console
|
|
10
|
+
console.error("The prop 'max' must be greater than 0. Received max: " + max);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return internalMax;
|
|
14
|
+
};
|
|
15
|
+
exports.clampMax = clampMax;
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=clampMax.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clampMax.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-progress/src/utils/clampMax.ts"],"names":[],"mappings":";;;;IAAO,IAAM,QAAQ,GAAG,UAAC,GAAW;QAClC,IAAM,WAAW,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QAEvC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;YACzC,IAAI,GAAG,IAAI,CAAC,EAAE;gBACZ,sCAAsC;gBACtC,OAAO,CAAC,KAAK,CAAC,0DAAwD,GAAK,CAAC,CAAC;aAC9E;SACF;QACD,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC;IAVW,QAAA,QAAQ,YAUnB","sourcesContent":["export const clampMax = (max: number): number => {\n const internalMax = max <= 0 ? 1 : max;\n\n if (process.env.NODE_ENV !== 'production') {\n if (max <= 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'max' must be greater than 0. Received max: ${max}`);\n }\n }\n return internalMax;\n};\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
define(["require", "exports"], function (require, exports) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clampValue = void 0;
|
|
5
|
+
var clampValue = function (value, max) {
|
|
6
|
+
if (value === undefined) {
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
var internalValue = value < 0 ? 0 : value > max ? max : value;
|
|
10
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
11
|
+
if (value < 0) {
|
|
12
|
+
// eslint-disable-next-line no-console
|
|
13
|
+
console.error("The prop 'value' must be greater than or equal to zero. Received value: " + value);
|
|
14
|
+
}
|
|
15
|
+
if (value > max) {
|
|
16
|
+
// eslint-disable-next-line no-console
|
|
17
|
+
console.error("The prop 'value' must be less than or equal to 'max'. Received value: " + value + ", max: " + max);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return internalValue;
|
|
21
|
+
};
|
|
22
|
+
exports.clampValue = clampValue;
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=clampValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clampValue.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-progress/src/utils/clampValue.ts"],"names":[],"mappings":";;;;IAAO,IAAM,UAAU,GAAG,UAAC,KAAyB,EAAE,GAAW;QAC/D,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;QACD,IAAM,aAAa,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;QAEhE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;YACzC,IAAI,KAAK,GAAG,CAAC,EAAE;gBACb,sCAAsC;gBACtC,OAAO,CAAC,KAAK,CAAC,6EAA2E,KAAO,CAAC,CAAC;aACnG;YACD,IAAI,KAAK,GAAG,GAAG,EAAE;gBACf,sCAAsC;gBACtC,OAAO,CAAC,KAAK,CAAC,2EAAyE,KAAK,eAAU,GAAK,CAAC,CAAC;aAC9G;SACF;QACD,OAAO,aAAa,CAAC;IACvB,CAAC,CAAC;IAjBW,QAAA,UAAU,cAiBrB","sourcesContent":["export const clampValue = (value: number | undefined, max: number): number | undefined => {\n if (value === undefined) {\n return value;\n }\n const internalValue = value < 0 ? 0 : value > max ? max : value;\n\n if (process.env.NODE_ENV !== 'production') {\n if (value < 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be greater than or equal to zero. Received value: ${value}`);\n }\n if (value > max) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be less than or equal to 'max'. Received value: ${value}, max: ${max}`);\n }\n }\n return internalValue;\n};\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "./clampMax", "./clampValue"], function (require, exports, tslib_1, clampMax_1, clampValue_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
tslib_1.__exportStar(clampMax_1, exports);
|
|
5
|
+
tslib_1.__exportStar(clampValue_1, exports);
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-progress/src/utils/index.ts"],"names":[],"mappings":";;;IAAA,0CAA2B;IAC3B,4CAA6B","sourcesContent":["export * from './clampMax';\nexport * from './clampValue';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-progress/src/ProgressBar.ts"],"sourcesContent":["export * from './components/ProgressBar/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,oCAAAC,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-progress/src/ProgressField.ts"],"sourcesContent":["export * from './components/ProgressField/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,sCAAAC,OAAA"}
|
|
@@ -8,12 +8,17 @@ const React = /*#__PURE__*/require("react");
|
|
|
8
8
|
const useProgressBar_1 = /*#__PURE__*/require("./useProgressBar");
|
|
9
9
|
const renderProgressBar_1 = /*#__PURE__*/require("./renderProgressBar");
|
|
10
10
|
const useProgressBarStyles_1 = /*#__PURE__*/require("./useProgressBarStyles");
|
|
11
|
+
const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
|
|
11
12
|
/**
|
|
12
13
|
* A ProgressBar bar shows the progression of a task.
|
|
13
14
|
*/
|
|
14
15
|
exports.ProgressBar = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
15
16
|
const state = useProgressBar_1.useProgressBar_unstable(props, ref);
|
|
16
17
|
useProgressBarStyles_1.useProgressBarStyles_unstable(state);
|
|
18
|
+
const {
|
|
19
|
+
useProgressBarStyles_unstable: useCustomStyles
|
|
20
|
+
} = react_shared_contexts_1.useCustomStyleHooks_unstable();
|
|
21
|
+
useCustomStyles(state);
|
|
17
22
|
return renderProgressBar_1.renderProgressBar_unstable(state);
|
|
18
23
|
});
|
|
19
24
|
exports.ProgressBar.displayName = 'ProgressBar';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","require","useProgressBar_1","renderProgressBar_1","useProgressBarStyles_1","react_shared_contexts_1","exports","ProgressBar","forwardRef","props","ref","state","useProgressBar_unstable","useProgressBarStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderProgressBar_unstable","displayName"],"sources":["../src/packages/react-components/react-progress/src/components/ProgressBar/ProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useProgressBar_unstable } from './useProgressBar';\nimport { renderProgressBar_unstable } from './renderProgressBar';\nimport { useProgressBarStyles_unstable } from './useProgressBarStyles';\nimport type { ProgressBarProps } from './ProgressBar.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A ProgressBar bar shows the progression of a task.\n */\nexport const ProgressBar: ForwardRefComponent<ProgressBarProps> = React.forwardRef((props, ref) => {\n const state = useProgressBar_unstable(props, ref);\n\n useProgressBarStyles_unstable(state);\n\n const { useProgressBarStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderProgressBar_unstable(state);\n});\n\nProgressBar.displayName = 'ProgressBar';\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,gBAAA,gBAAAD,OAAA;AACA,MAAAE,mBAAA,gBAAAF,OAAA;AACA,MAAAG,sBAAA,gBAAAH,OAAA;AAGA,MAAAI,uBAAA,gBAAAJ,OAAA;AAEA;;;AAGaK,OAAA,CAAAC,WAAW,gBAA0CP,KAAK,CAACQ,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAChG,MAAMC,KAAK,GAAGT,gBAAA,CAAAU,uBAAuB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAEjDN,sBAAA,CAAAS,6BAA6B,CAACF,KAAK,CAAC;EAEpC,MAAM;IAAEE,6BAA6B,EAAEC;EAAe,CAAE,GAAGT,uBAAA,CAAAU,4BAA4B,EAAE;EACzFD,eAAe,CAACH,KAAK,CAAC;EAEtB,OAAOR,mBAAA,CAAAa,0BAA0B,CAACL,KAAK,CAAC;AAC1C,CAAC,CAAC;AAEFL,OAAA,CAAAC,WAAW,CAACU,WAAW,GAAG,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../src/packages/react-components/react-progress/src/components/ProgressBar/ProgressBar.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ProgressBarSlots = {\n /**\n * The track behind the ProgressBar bar\n */\n root: NonNullable<Slot<'div'>>;\n /**\n * The filled portion of the ProgressBar bar. Animated in the indeterminate state, when no value is provided.\n */\n bar?: NonNullable<Slot<'div'>>;\n};\n\n/**\n * ProgressBar Props\n */\nexport type ProgressBarProps = Omit<ComponentProps<ProgressBarSlots>, 'size'> & {\n /**\n * The shape of the bar and track.\n * @default rounded\n */\n shape?: 'rounded' | 'square';\n /**\n * A decimal number between `0` and `1` (or between `0` and `max` if given),\n * which specifies how much of the task has been completed.\n *\n * If `undefined` (default), the ProgressBar will display an **indeterminate** state.\n */\n value?: number;\n /**\n * The maximum value, which indicates the task is complete.\n * The ProgressBar bar will be full when `value` equals `max`.\n * @default 1\n */\n max?: number;\n /**\n * The thickness of the ProgressBar bar\n * @default medium\n */\n thickness?: 'medium' | 'large';\n\n /**\n * The status of the ProgressBar bar. Changes the color of the bar.\n * @default brand\n */\n color?: 'brand' | 'success' | 'warning' | 'error';\n};\n\n/**\n * State used in rendering ProgressBar\n */\nexport type ProgressBarState = ComponentState<ProgressBarSlots> &\n Required<Pick<ProgressBarProps, 'max' | 'shape' | 'thickness'>> &\n Pick<ProgressBarProps, 'value' | 'color'>;\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-progress/src/components/ProgressBar/index.ts"],"sourcesContent":["export * from './ProgressBar';\nexport * from './ProgressBar.types';\nexport * from './renderProgressBar';\nexport * from './useProgressBar';\nexport * from './useProgressBarStyles';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,mBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,yBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,yBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,sBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,4BAAAC,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","require","react_utilities_1","renderProgressBar_unstable","state","slots","slotProps","getSlots","createElement","root","bar","exports"],"sources":["../src/packages/react-components/react-progress/src/components/ProgressBar/renderProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { ProgressBarState, ProgressBarSlots } from './ProgressBar.types';\n\n/**\n * Render the final JSX of ProgressBar\n */\nexport const renderProgressBar_unstable = (state: ProgressBarState) => {\n const { slots, slotProps } = getSlots<ProgressBarSlots>(state);\n return <slots.root {...slotProps.root}>{slots.bar && <slots.bar {...slotProps.bar} />}</slots.root>;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,0BAA0B,GAAIC,KAAuB,IAAI;EACpE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,iBAAA,CAAAK,QAAQ,CAAmBH,KAAK,CAAC;EAC9D,OAAOJ,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAAGJ,KAAK,CAACK,GAAG,IAAIV,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACK,GAAG;IAAA,GAAKJ,SAAS,CAACI;EAAG,EAAI,CAAc;AACrG,CAAC;AAHYC,OAAA,CAAAR,0BAA0B,GAAAA,0BAAA"}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useProgressBar_unstable = void 0;
|
|
7
7
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
8
|
+
const index_1 = /*#__PURE__*/require("../../utils/index");
|
|
8
9
|
/**
|
|
9
10
|
* Create the state required to render ProgressBar.
|
|
10
11
|
*
|
|
@@ -15,14 +16,15 @@ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
|
15
16
|
* @param ref - reference to root HTMLElement of ProgressBar
|
|
16
17
|
*/
|
|
17
18
|
const useProgressBar_unstable = (props, ref) => {
|
|
19
|
+
var _a;
|
|
18
20
|
// Props
|
|
19
21
|
const {
|
|
20
22
|
color = 'brand',
|
|
21
|
-
max = 1.0,
|
|
22
23
|
shape = 'rounded',
|
|
23
|
-
thickness = 'medium'
|
|
24
|
-
value
|
|
24
|
+
thickness = 'medium'
|
|
25
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);
|
|
26
28
|
const root = react_utilities_1.getNativeElementProps('div', {
|
|
27
29
|
ref,
|
|
28
30
|
role: 'progressbar',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["react_utilities_1","require","index_1","useProgressBar_unstable","props","ref","color","shape","thickness","max","clampMax","_a","value","clampValue","root","getNativeElementProps","role","undefined","bar","resolveShorthand","required","state","components","exports"],"sources":["../src/packages/react-components/react-progress/src/components/ProgressBar/useProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { clampValue, clampMax } from '../../utils/index';\nimport type { ProgressBarProps, ProgressBarState } from './ProgressBar.types';\n\n/**\n * Create the state required to render ProgressBar.\n *\n * The returned state can be modified with hooks such as useProgressBarStyles_unstable,\n * before being passed to renderProgressBar_unstable.\n *\n * @param props - props from this instance of ProgressBar\n * @param ref - reference to root HTMLElement of ProgressBar\n */\nexport const useProgressBar_unstable = (props: ProgressBarProps, ref: React.Ref<HTMLElement>): ProgressBarState => {\n // Props\n const { color = 'brand', shape = 'rounded', thickness = 'medium' } = props;\n const max = clampMax(props.max ?? 1);\n const value = clampValue(props.value, max);\n\n const root = getNativeElementProps('div', {\n ref,\n role: 'progressbar',\n 'aria-valuemin': value !== undefined ? 0 : undefined,\n 'aria-valuemax': value !== undefined ? max : undefined,\n 'aria-valuenow': value,\n ...props,\n });\n\n const bar = resolveShorthand(props.bar, {\n required: true,\n });\n\n const state: ProgressBarState = {\n color,\n max,\n shape,\n thickness,\n value,\n components: {\n root: 'div',\n bar: 'div',\n },\n root,\n bar,\n };\n\n return state;\n};\n"],"mappings":";;;;;;AACA,MAAAA,iBAAA,gBAAAC,OAAA;AACA,MAAAC,OAAA,gBAAAD,OAAA;AAGA;;;;;;;;;AASO,M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|
|
45
45
|
B68tc82: "f1p9o1ba",
|
|
46
46
|
Bmxbyg5: "f1sil6mw",
|
|
47
|
-
|
|
48
|
-
tu2nte: "f1mcb20s",
|
|
49
|
-
y0r1ed: "fek7wd8"
|
|
47
|
+
Bpep1pd: "fu42dvn"
|
|
50
48
|
},
|
|
51
49
|
rounded: {
|
|
52
50
|
Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
|
|
@@ -67,12 +65,8 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
|
67
65
|
Bqenvij: "f6ywr7j"
|
|
68
66
|
}
|
|
69
67
|
}, {
|
|
70
|
-
d: [".ftgm304{display:block;}", ".f18f03hv{background-color:var(--colorNeutralBackground6);}", ".
|
|
71
|
-
m: [["@media screen and (forced-colors: active){.
|
|
72
|
-
m: "screen and (forced-colors: active)"
|
|
73
|
-
}], ["@media screen and (forced-colors: active){.f1mcb20s{border-bottom-style:solid;}}", {
|
|
74
|
-
m: "screen and (forced-colors: active)"
|
|
75
|
-
}], ["@media screen and (forced-colors: active){.fek7wd8{border-bottom-color:CanvasText;}}", {
|
|
68
|
+
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;}"],
|
|
69
|
+
m: [["@media screen and (forced-colors: active){.fu42dvn{background-color:CanvasText;}}", {
|
|
76
70
|
m: "screen and (forced-colors: active)"
|
|
77
71
|
}]]
|
|
78
72
|
});
|
|
@@ -81,16 +75,12 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
|
81
75
|
*/
|
|
82
76
|
const useBarStyles = /*#__PURE__*/react_1.__styles({
|
|
83
77
|
base: {
|
|
78
|
+
Bpep1pd: "f1neahkh",
|
|
84
79
|
Bbmb7ep: ["f1d9uwra", "fzibvwi"],
|
|
85
80
|
Beyfa6y: ["fzibvwi", "f1d9uwra"],
|
|
86
81
|
B7oj6ja: ["fuoumxm", "f1vtqnvc"],
|
|
87
|
-
Btl43ni: ["f1vtqnvc", "fuoumxm"]
|
|
88
|
-
|
|
89
|
-
medium: {
|
|
90
|
-
Bqenvij: "f4t8t6x"
|
|
91
|
-
},
|
|
92
|
-
large: {
|
|
93
|
-
Bqenvij: "f6ywr7j"
|
|
82
|
+
Btl43ni: ["f1vtqnvc", "fuoumxm"],
|
|
83
|
+
Bqenvij: "f1l02sjl"
|
|
94
84
|
},
|
|
95
85
|
nonZeroDeterminate: {
|
|
96
86
|
Bmy1vo4: "fjt6zfz",
|
|
@@ -111,8 +101,7 @@ const useBarStyles = /*#__PURE__*/react_1.__styles({
|
|
|
111
101
|
Bv12yb3: "fjhwsai"
|
|
112
102
|
},
|
|
113
103
|
brand: {
|
|
114
|
-
De3pzq: "ftywsgz"
|
|
115
|
-
Bpep1pd: "f1neahkh"
|
|
104
|
+
De3pzq: "ftywsgz"
|
|
116
105
|
},
|
|
117
106
|
error: {
|
|
118
107
|
De3pzq: "fdl5y0r"
|
|
@@ -124,15 +113,15 @@ const useBarStyles = /*#__PURE__*/react_1.__styles({
|
|
|
124
113
|
De3pzq: "flxk52p"
|
|
125
114
|
}
|
|
126
115
|
}, {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
116
|
+
m: [["@media screen and (forced-colors: active){.f1neahkh{background-color:Highlight;}}", {
|
|
117
|
+
m: "screen and (forced-colors: active)"
|
|
118
|
+
}], ["@media screen and (prefers-reduced-motion: reduce){.f4akx1t{-webkit-animation-duration:0.01ms;animation-duration:0.01ms;}}", {
|
|
130
119
|
m: "screen and (prefers-reduced-motion: reduce)"
|
|
131
120
|
}], ["@media screen and (prefers-reduced-motion: reduce){.f18p5put{-webkit-animation-iteration-count:1;animation-iteration-count:1;}}", {
|
|
132
121
|
m: "screen and (prefers-reduced-motion: reduce)"
|
|
133
|
-
}],
|
|
134
|
-
|
|
135
|
-
}]
|
|
122
|
+
}]],
|
|
123
|
+
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 );}", ".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);}"],
|
|
124
|
+
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%;}}"]
|
|
136
125
|
});
|
|
137
126
|
/**
|
|
138
127
|
* Apply styling to the ProgressBar slots based on the state
|
|
@@ -152,7 +141,7 @@ const useProgressBarStyles_unstable = state => {
|
|
|
152
141
|
} = react_shared_contexts_1.useFluent_unstable();
|
|
153
142
|
state.root.className = react_1.mergeClasses(exports.progressBarClassNames.root, rootStyles.root, rootStyles[shape], rootStyles[thickness], state.root.className);
|
|
154
143
|
if (state.bar) {
|
|
155
|
-
state.bar.className = react_1.mergeClasses(exports.progressBarClassNames.bar, barStyles.base, barStyles.brand, value === undefined && barStyles.indeterminate, value === undefined && dir === 'rtl' && barStyles.rtl,
|
|
144
|
+
state.bar.className = react_1.mergeClasses(exports.progressBarClassNames.bar, barStyles.base, barStyles.brand, value === undefined && barStyles.indeterminate, value === undefined && dir === 'rtl' && barStyles.rtl, value !== undefined && value > ZERO_THRESHOLD && barStyles.nonZeroDeterminate, color && value !== undefined && barStyles[color], state.bar.className);
|
|
156
145
|
}
|
|
157
146
|
if (state.bar && value !== undefined) {
|
|
158
147
|
state.bar.style = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["react_1","require","react_theme_1","react_shared_contexts_1","exports","progressBarClassNames","root","bar","ZERO_THRESHOLD","barThicknessValues","medium","large","indeterminateProgressBar","left","indeterminateProgressBarRTL","right","useRootStyles","__styles","mc9l5x","De3pzq","a9b677","B68tc82","Bmxbyg5","Bpep1pd","rounded","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","square","Bqenvij","d","m","useBarStyles","base","nonZeroDeterminate","Bmy1vo4","B3o57yi","Bkqvd7p","indeterminate","B2u0y6b","qhf8xq","Bcmaq0h","Bv12yb3","vin17d","w3vfg9","Gqtpxc","B3vm3ge","rtl","brand","error","warning","success","k","useProgressBarStyles_unstable","state","color","max","shape","thickness","value","rootStyles","barStyles","dir","useFluent_unstable","className","mergeClasses","undefined","style","width","Math","min"],"sources":["../src/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 width: '100%',\n ...shorthands.overflow('hidden'),\n\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'CanvasText',\n },\n },\n rounded: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n square: {\n ...shorthands.borderRadius(tokens.borderRadiusNone),\n },\n medium: {\n height: barThicknessValues.medium,\n },\n large: {\n height: barThicknessValues.large,\n },\n});\n\n/**\n * Styles for the ProgressBar bar\n */\nconst useBarStyles = makeStyles({\n base: {\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'Highlight',\n },\n ...shorthands.borderRadius('inherit'),\n height: '100%',\n },\n nonZeroDeterminate: {\n transitionProperty: 'width',\n transitionDuration: '0.3s',\n transitionTimingFunction: 'ease',\n },\n indeterminate: {\n maxWidth: '33%',\n position: 'relative',\n backgroundImage: `linear-gradient(\n to right,\n ${tokens.colorNeutralBackground6} 0%,\n ${tokens.colorTransparentBackground} 50%,\n ${tokens.colorNeutralBackground6} 100%\n )`,\n animationName: indeterminateProgressBar,\n animationDuration: '3s',\n animationIterationCount: 'infinite',\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationDuration: '0.01ms',\n animationIterationCount: '1',\n },\n },\n\n rtl: {\n animationName: indeterminateProgressBarRTL,\n },\n\n brand: {\n backgroundColor: tokens.colorCompoundBrandBackground,\n },\n\n error: {\n backgroundColor: tokens.colorPaletteRedBackground3,\n },\n warning: {\n backgroundColor: tokens.colorPaletteDarkOrangeBackground3,\n },\n success: {\n backgroundColor: tokens.colorPaletteGreenBackground3,\n },\n});\n\n/**\n * Apply styling to the ProgressBar slots based on the state\n */\nexport const useProgressBarStyles_unstable = (state: ProgressBarState): ProgressBarState => {\n const { color, max, shape, thickness, value } = state;\n const rootStyles = useRootStyles();\n const barStyles = useBarStyles();\n const { dir } = useFluent();\n\n state.root.className = mergeClasses(\n progressBarClassNames.root,\n rootStyles.root,\n rootStyles[shape],\n rootStyles[thickness],\n state.root.className,\n );\n\n if (state.bar) {\n state.bar.className = mergeClasses(\n progressBarClassNames.bar,\n barStyles.base,\n barStyles.brand,\n value === undefined && barStyles.indeterminate,\n value === undefined && dir === 'rtl' && barStyles.rtl,\n value !== undefined && value > ZERO_THRESHOLD && barStyles.nonZeroDeterminate,\n color && value !== undefined && barStyles[color],\n state.bar.className,\n );\n }\n\n if (state.bar && value !== undefined) {\n state.bar.style = {\n width: Math.min(100, Math.max(0, (value / max) * 100)) + '%',\n ...state.bar.style,\n };\n }\n\n return state;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,OAAA,gBAAAC,OAAA;AACA,MAAAC,aAAA,gBAAAD,OAAA;AACA,MAAAE,uBAAA,gBAAAF,O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AAkB,EAC7EqB,KAAK,IAAII,KAAK,KAAKO,SAAS,IAAIL,SAAS,CAACN,KAAK,CAAC,EAChDD,KAAK,CAAChD,GAAG,CAAC0D,SAAS,CACpB;;EAGH,IAAIV,KAAK,CAAChD,GAAG,IAAIqD,KAAK,KAAKO,SAAS,EAAE;IACpCZ,KAAK,CAAChD,GAAG,CAAC6D,KAAK,GAAG;MAChBC,KAAK,EAAEC,IAAI,CAACC,GAAG,CAAC,GAAG,EAAED,IAAI,CAACb,GAAG,CAAC,CAAC,EAAGG,KAAK,GAAGH,GAAG,GAAI,GAAG,CAAC,CAAC,GAAG,GAAG;MAC5D,GAAGF,KAAK,CAAChD,GAAG,CAAC6D;KACd;;EAGH,OAAOb,KAAK;AACd,CAAC;AAnCYnD,OAAA,CAAAkD,6BAA6B,GAAAA,6BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["react_field_1","require","ProgressBar_1","exports","progressFieldClassNames","getDeprecatedFieldClassNames","progressBarClassNames","root","ProgressField","makeDeprecatedField","ProgressBar","displayName","mapProps","props","control","validationState"],"sources":["../src/packages/react-components/react-progress/src/components/ProgressField/ProgressField.tsx"],"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"],"mappings":";;;;;;AAAA;AACA,MAAAA,aAAA,gBAAAC,OAAA;AAEA,MAAAC,aAAA,gBAAAD,OAAA;AAIA;AACaE,OAAA,CAAAC,uBAAuB,gBAAGJ,aAAA,CAAAK,4BAA4B,CAACH,aAAA,CAAAI,qBAAqB,CAACC,IAAI,CAAC;AAC/F;AACaJ,OAAA,CAAAK,aAAa,gBAA4CR,aAAA,CAAAS,mBAAmB,CAACP,aAAA,CAAAQ,WAAW,EAAE;EACrGC,WAAW,EAAE,eAAe;EAC5BC,QAAQ,EAAGC,KAAyB,KAAM;IACxC,GAAGA,KAAK;IACRC,OAAO,EAAE;MAAE,GAAGD,KAAK,CAACC,OAAO;MAAEC,eAAe,EAAEF,KAAK,CAACE;IAAe;GACpE;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-progress/src/components/ProgressField/index.ts"],"sourcesContent":["export * from './ProgressField';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,qBAAAC,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["ProgressBar_1","require","Object","defineProperty","exports","enumerable","get","ProgressBar","progressBarClassNames","renderProgressBar_unstable","useProgressBar_unstable","useProgressBarStyles_unstable","ProgressField_1","ProgressField","progressFieldClassNames"],"sources":["../src/packages/react-components/react-progress/src/index.ts"],"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"],"mappings":";;;;;;AAAA,IAAAA,aAAA,gBAAAC,OAAA;AACEC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,aAAA,CAAAO,WAAW;EAAA;AAAA;AACXL,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,aAAA,CAAAQ,qBAAqB;EAAA;AAAA;AACrBN,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,aAAA,CAAAS,0BAA0B;EAAA;AAAA;AAC1BP,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,aAAA,CAAAU,uBAAuB;EAAA;AAAA;AACvBR,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,aAAA,CAAAW,6BAA6B;EAAA;AAAA;AAI/B;AACA,IAAAC,eAAA,gBAAAX,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAM,eAAA,CAAAC,aAAa;EAAA;AAAA;AAA4BX,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAM,eAAA,CAAAE,uBAAuB;EAAA;AAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clampMax = void 0;
|
|
7
|
+
const clampMax = max => {
|
|
8
|
+
const internalMax = max <= 0 ? 1 : max;
|
|
9
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
10
|
+
if (max <= 0) {
|
|
11
|
+
// eslint-disable-next-line no-console
|
|
12
|
+
console.error(`The prop 'max' must be greater than 0. Received max: ${max}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return internalMax;
|
|
16
|
+
};
|
|
17
|
+
exports.clampMax = clampMax;
|
|
18
|
+
//# sourceMappingURL=clampMax.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["clampMax","max","internalMax","process","env","NODE_ENV","console","error","exports"],"sources":["../src/packages/react-components/react-progress/src/utils/clampMax.ts"],"sourcesContent":["export const clampMax = (max: number): number => {\n const internalMax = max <= 0 ? 1 : max;\n\n if (process.env.NODE_ENV !== 'production') {\n if (max <= 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'max' must be greater than 0. Received max: ${max}`);\n }\n }\n return internalMax;\n};\n"],"mappings":";;;;;;AAAO,MAAMA,QAAQ,GAAIC,GAAW,IAAY;EAC9C,MAAMC,WAAW,GAAGD,GAAG,IAAI,CAAC,GAAG,CAAC,GAAGA,GAAG;EAEtC,IAAIE,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC,IAAIJ,GAAG,IAAI,CAAC,EAAE;MACZ;MACAK,OAAO,CAACC,KAAK,CAAC,wDAAwDN,GAAG,EAAE,CAAC;;;EAGhF,OAAOC,WAAW;AACpB,CAAC;AAVYM,OAAA,CAAAR,QAAQ,GAAAA,QAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clampValue = void 0;
|
|
7
|
+
const clampValue = (value, max) => {
|
|
8
|
+
if (value === undefined) {
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
const internalValue = value < 0 ? 0 : value > max ? max : value;
|
|
12
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
13
|
+
if (value < 0) {
|
|
14
|
+
// eslint-disable-next-line no-console
|
|
15
|
+
console.error(`The prop 'value' must be greater than or equal to zero. Received value: ${value}`);
|
|
16
|
+
}
|
|
17
|
+
if (value > max) {
|
|
18
|
+
// eslint-disable-next-line no-console
|
|
19
|
+
console.error(`The prop 'value' must be less than or equal to 'max'. Received value: ${value}, max: ${max}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return internalValue;
|
|
23
|
+
};
|
|
24
|
+
exports.clampValue = clampValue;
|
|
25
|
+
//# sourceMappingURL=clampValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["clampValue","value","max","undefined","internalValue","process","env","NODE_ENV","console","error","exports"],"sources":["../src/packages/react-components/react-progress/src/utils/clampValue.ts"],"sourcesContent":["export const clampValue = (value: number | undefined, max: number): number | undefined => {\n if (value === undefined) {\n return value;\n }\n const internalValue = value < 0 ? 0 : value > max ? max : value;\n\n if (process.env.NODE_ENV !== 'production') {\n if (value < 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be greater than or equal to zero. Received value: ${value}`);\n }\n if (value > max) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be less than or equal to 'max'. Received value: ${value}, max: ${max}`);\n }\n }\n return internalValue;\n};\n"],"mappings":";;;;;;AAAO,MAAMA,UAAU,GAAGA,CAACC,KAAyB,EAAEC,GAAW,KAAwB;EACvF,IAAID,KAAK,KAAKE,SAAS,EAAE;IACvB,OAAOF,KAAK;;EAEd,MAAMG,aAAa,GAAGH,KAAK,GAAG,CAAC,GAAG,CAAC,GAAGA,KAAK,GAAGC,GAAG,GAAGA,GAAG,GAAGD,KAAK;EAE/D,IAAII,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC,IAAIN,KAAK,GAAG,CAAC,EAAE;MACb;MACAO,OAAO,CAACC,KAAK,CAAC,2EAA2ER,KAAK,EAAE,CAAC;;IAEnG,IAAIA,KAAK,GAAGC,GAAG,EAAE;MACf;MACAM,OAAO,CAACC,KAAK,CAAC,yEAAyER,KAAK,UAAUC,GAAG,EAAE,CAAC;;;EAGhH,OAAOE,aAAa;AACtB,CAAC;AAjBYM,OAAA,CAAAV,UAAU,GAAAA,UAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
7
|
+
tslib_1.__exportStar(require("./clampMax"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./clampValue"), exports);
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-progress/src/utils/index.ts"],"sourcesContent":["export * from './clampMax';\nexport * from './clampValue';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,gBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,kBAAAC,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-progress",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.1.1",
|
|
4
4
|
"description": "Progress component for FluentUI v9",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"@fluentui/scripts-tasks": "*"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@fluentui/react-field": "9.0.0-alpha.
|
|
36
|
-
"@fluentui/react-shared-contexts": "^9.
|
|
35
|
+
"@fluentui/react-field": "9.0.0-alpha.23",
|
|
36
|
+
"@fluentui/react-shared-contexts": "^9.3.0",
|
|
37
37
|
"@fluentui/react-theme": "^9.1.5",
|
|
38
|
-
"@fluentui/react-utilities": "^9.6.
|
|
38
|
+
"@fluentui/react-utilities": "^9.6.2",
|
|
39
39
|
"@griffel/react": "^1.5.2",
|
|
40
40
|
"tslib": "^2.1.0"
|
|
41
41
|
},
|