@fluentui/react-progress 9.74.7-experimental.cli-api.20261006-ccaa611d58.0 → 9.75.0-experimental.css-modules.20261031-810ab07afb.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -11
- package/README.md +6 -0
- package/lib/components/ProgressBar/ProgressBar.js.map +1 -1
- package/lib/components/ProgressBar/ProgressBar.module.css +89 -0
- package/lib/components/ProgressBar/ProgressBar.types.js.map +1 -1
- package/lib/components/ProgressBar/index.js.map +1 -1
- package/lib/components/ProgressBar/progressBarMotions.js.map +1 -1
- package/lib/components/ProgressBar/renderProgressBar.js +2 -2
- package/lib/components/ProgressBar/renderProgressBar.js.map +1 -1
- package/lib/components/ProgressBar/useProgressBar.js +1 -1
- package/lib/components/ProgressBar/useProgressBar.js.map +1 -1
- package/lib/components/ProgressBar/useProgressBarStyles.styles.css.js +20 -0
- package/lib/components/ProgressBar/useProgressBarStyles.styles.css.js.map +1 -0
- package/lib/components/ProgressBar/useProgressBarStyles.styles.raw.css.js +20 -0
- package/lib/components/ProgressBar/useProgressBarStyles.styles.raw.css.js.map +1 -0
- package/lib/components/ProgressBar/useProgressBarStyles.styles.raw.js.map +1 -1
- package/lib/utils/clampMax.js.map +1 -1
- package/lib/utils/clampValue.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib-commonjs/ProgressBar.cjs +7 -7
- package/lib-commonjs/components/ProgressBar/ProgressBar.cjs.map +1 -1
- package/lib-commonjs/components/ProgressBar/ProgressBar.module.css +89 -0
- package/lib-commonjs/components/ProgressBar/ProgressBar.types.cjs.map +1 -1
- package/lib-commonjs/components/ProgressBar/index.cjs +7 -7
- package/lib-commonjs/components/ProgressBar/index.cjs.map +1 -1
- package/lib-commonjs/components/ProgressBar/progressBarMotions.cjs.map +1 -1
- package/lib-commonjs/components/ProgressBar/renderProgressBar.cjs.map +1 -1
- package/lib-commonjs/components/ProgressBar/useProgressBar.cjs +4 -4
- package/lib-commonjs/components/ProgressBar/useProgressBar.cjs.map +1 -1
- package/lib-commonjs/components/ProgressBar/useProgressBarStyles.styles.cjs +3 -3
- package/lib-commonjs/components/ProgressBar/useProgressBarStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/ProgressBar/useProgressBarStyles.styles.css.cjs +39 -0
- package/lib-commonjs/components/ProgressBar/useProgressBarStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/ProgressBar/useProgressBarStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/ProgressBar/useProgressBarStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ProgressBar/useProgressBarStyles.styles.raw.css.cjs +39 -0
- package/lib-commonjs/components/ProgressBar/useProgressBarStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/index.cjs +7 -7
- package/lib-commonjs/utils/clampMax.cjs.map +1 -1
- package/lib-commonjs/utils/clampValue.cjs.map +1 -1
- package/lib-commonjs/utils/index.cjs +3 -3
- package/lib-commonjs/utils/index.cjs.map +1 -1
- package/package.json +14 -14
- package/dist/metadata/api/api-root.json +0 -1
- package/dist/metadata/index.json +0 -1
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
function _export(target, all) {
|
|
7
7
|
for(var name in all)Object.defineProperty(target, name, {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: all
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
useProgressBarBase_unstable
|
|
13
|
+
get useProgressBarBase_unstable () {
|
|
14
14
|
return useProgressBarBase_unstable;
|
|
15
15
|
},
|
|
16
|
-
useProgressBar_unstable
|
|
16
|
+
get useProgressBar_unstable () {
|
|
17
17
|
return useProgressBar_unstable;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
@@ -44,8 +44,8 @@ const useProgressBar_unstable = (props, ref)=>{
|
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
const useProgressBarBase_unstable = (props, ref)=>{
|
|
47
|
-
const field = (0, _reactfield.useFieldContext_unstable)();
|
|
48
47
|
var _props_max;
|
|
48
|
+
const field = (0, _reactfield.useFieldContext_unstable)();
|
|
49
49
|
const max = (0, _index.clampMax)((_props_max = props.max) !== null && _props_max !== void 0 ? _props_max : 1);
|
|
50
50
|
const value = (0, _index.clampValue)(props.value, max);
|
|
51
51
|
const root = _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ProgressBar/useProgressBar.tsx"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useFieldContext_unstable } from '@fluentui/react-field';\nimport { motionSlot } from '@fluentui/react-motion';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { clampValue, clampMax } from '../../utils/index';\nimport type {\n ProgressBarProps,\n ProgressBarState,\n ProgressBarBaseProps,\n ProgressBarBaseState,\n} from './ProgressBar.types';\nimport { ProgressBarIndeterminateMotion } from './progressBarMotions';\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 const field = useFieldContext_unstable();\n const fieldState = field?.validationState;\n\n const {\n color = fieldState === 'error' || fieldState === 'warning' || fieldState === 'success' ? fieldState : 'brand',\n shape = 'rounded',\n thickness = 'medium',\n indeterminateMotion,\n ...baseProps\n } = props;\n\n const state = useProgressBarBase_unstable(baseProps, ref);\n\n return {\n ...state,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...state.components,\n indeterminateMotion: ProgressBarIndeterminateMotion,\n },\n color,\n shape,\n thickness,\n indeterminateMotion:\n state.value === undefined\n ? motionSlot(indeterminateMotion, {\n elementType: ProgressBarIndeterminateMotion,\n defaultProps: {},\n })\n : undefined,\n };\n};\n\n/**\n * Base hook for ProgressBar component. Manages state related to ARIA progressbar attributes\n * (role, aria-valuemin, aria-valuemax, aria-valuenow) and field context integration —\n * without design props (shape, thickness, color).\n *\n * @param props - props from this instance of ProgressBar (without shape, thickness, color)\n * @param ref - reference to root HTMLElement of ProgressBar\n */\nexport const useProgressBarBase_unstable = (\n props: ProgressBarBaseProps,\n ref: React.Ref<HTMLElement>,\n): ProgressBarBaseState => {\n const field = useFieldContext_unstable();\n\n const max = clampMax(props.max ?? 1);\n const value = clampValue(props.value, max);\n\n const root = slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n role: 'progressbar',\n 'aria-valuemin': value !== undefined ? 0 : undefined,\n 'aria-valuemax': value !== undefined ? max : undefined,\n 'aria-valuenow': value,\n 'aria-labelledby': field?.labelId,\n ...props,\n }),\n { elementType: 'div' },\n );\n if (field && (field.validationMessageId || field.hintId)) {\n // Prepend the field's validation message and/or hint to the user's aria-describedby\n root['aria-describedby'] = [field?.validationMessageId, field?.hintId, root['aria-describedby']]\n .filter(Boolean)\n .join(' ');\n }\n const bar = slot.always(props.bar, { elementType: 'div' });\n\n return {\n max,\n value,\n components: { root: 'div', bar: 'div', indeterminateMotion: 'div' },\n root,\n bar,\n };\n};\n"],"names":["useFieldContext_unstable","motionSlot","getIntrinsicElementProps","slot","clampValue","clampMax","ProgressBarIndeterminateMotion","useProgressBar_unstable","props","ref","field","fieldState","validationState","color","shape","thickness","indeterminateMotion","baseProps","state","useProgressBarBase_unstable","components","value","undefined","elementType","defaultProps","max","root","always","role","labelId","validationMessageId","hintId","filter","Boolean","join","bar"],"mappings":"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AA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOmB,OAAO;QACjC,GAAGrB,KAAK;IACV,IACA;QAAEe,aAAa;IAAM;IAEvB,IAAIb,SAAUA,CAAAA,MAAMoB,mBAAmB,IAAIpB,MAAMqB,MAAAA,AAAK,GAAI;QACxD,oFAAoF;QACpFL,IAAI,CAAC,mBAAmB,GAAG;YAAChB,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOoB,mBAAmB;YAAEpB,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOqB,MAAM;YAAEL,IAAI,CAAC,mBAAmB;SAAC,CAC7FM,MAAM,CAACC,SACPC,IAAI,CAAC;IACV;IACA,MAAMC,MAAMhC,oBAAAA,CAAKwB,MAAM,CAACnB,MAAM2B,GAAG,EAAE;QAAEZ,aAAa;IAAM;IAExD,OAAO;QACLE;QACAJ;QACAD,YAAY;YAAEM,MAAM;YAAOS,KAAK;YAAOnB,qBAAqB;QAAM;QAClEU;QACAS;IACF;AACF,EAAE"}
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
function _export(target, all) {
|
|
7
7
|
for(var name in all)Object.defineProperty(target, name, {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: all
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
progressBarClassNames
|
|
13
|
+
get progressBarClassNames () {
|
|
14
14
|
return progressBarClassNames;
|
|
15
15
|
},
|
|
16
|
-
useProgressBarStyles_unstable
|
|
16
|
+
get useProgressBarStyles_unstable () {
|
|
17
17
|
return useProgressBarStyles_unstable;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useProgressBarStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from \"@griffel/react\";\nimport { tokens } from \"@fluentui/react-theme\";\nexport const progressBarClassNames = {\n root: 'fui-ProgressBar',\n bar: 'fui-ProgressBar__bar'\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;\nconst barThicknessValues = {\n medium: '2px',\n large: '4px'\n};\n/**\n * Styles for the root slot\n */ const useRootStyles = makeStyles({\n root: {\n display: 'block',\n backgroundColor: tokens.colorNeutralBackground6,\n width: '100%',\n overflow: 'hidden',\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'CanvasText'\n }\n },\n rounded: {\n borderRadius: tokens.borderRadiusMedium\n },\n square: {\n borderRadius: tokens.borderRadiusNone\n },\n medium: {\n height: barThicknessValues.medium\n },\n large: {\n height: barThicknessValues.large\n }\n});\n/**\n * Styles for the ProgressBar bar\n */ const useBarStyles = makeStyles({\n base: {\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'Highlight'\n },\n 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 '@media screen and (prefers-reduced-motion: reduce)': {\n // Reduced motion: bar is sized here, and the opacity is pulsed by ProgressBarIndeterminateMotion\n maxWidth: '100%'\n }\n },\n brand: {\n backgroundColor: tokens.colorCompoundBrandBackground\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 * Apply styling to the ProgressBar slots based on the state\n */ export const useProgressBarStyles_unstable = (state)=>{\n const { color, max, shape, thickness, value } = state;\n const rootStyles = useRootStyles();\n const barStyles = useBarStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(progressBarClassNames.root, rootStyles.root, rootStyles[shape], rootStyles[thickness], state.root.className);\n if (state.bar) {\n // eslint-disable-next-line react-hooks/immutability\n state.bar.className = 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);\n }\n if (state.bar && value !== undefined) {\n // eslint-disable-next-line react-hooks/immutability\n state.bar.style = {\n width: Math.min(100, Math.max(0, value / max * 100)) + '%',\n ...state.bar.style\n };\n }\n return state;\n};\n"],"names":["__styles","mergeClasses","tokens","progressBarClassNames","root","bar","ZERO_THRESHOLD","barThicknessValues","medium","large","useRootStyles","mc9l5x","De3pzq","a9b677","B68tc82","Bmxbyg5","Bpg54ce","Bomf52o","rounded","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","square","Bqenvij","d","p","m","useBarStyles","base","nonZeroDeterminate","Bmy1vo4","B3o57yi","Bkqvd7p","indeterminate","B2u0y6b","qhf8xq","Bcmaq0h","jpy9cc","brand","error","warning","success","useProgressBarStyles_unstable","state","color","max","shape","thickness","value","rootStyles","barStyles","className","undefined","style","width","Math","min"],"mappings":"AAAA,YAAY;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["useProgressBarStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from \"@griffel/react\";\nimport { tokens } from \"@fluentui/react-theme\";\nexport const progressBarClassNames = {\n root: 'fui-ProgressBar',\n bar: 'fui-ProgressBar__bar'\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;\nconst barThicknessValues = {\n medium: '2px',\n large: '4px'\n};\n/**\n * Styles for the root slot\n */ const useRootStyles = makeStyles({\n root: {\n display: 'block',\n backgroundColor: tokens.colorNeutralBackground6,\n width: '100%',\n overflow: 'hidden',\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'CanvasText'\n }\n },\n rounded: {\n borderRadius: tokens.borderRadiusMedium\n },\n square: {\n borderRadius: tokens.borderRadiusNone\n },\n medium: {\n height: barThicknessValues.medium\n },\n large: {\n height: barThicknessValues.large\n }\n});\n/**\n * Styles for the ProgressBar bar\n */ const useBarStyles = makeStyles({\n base: {\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'Highlight'\n },\n 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 '@media screen and (prefers-reduced-motion: reduce)': {\n // Reduced motion: bar is sized here, and the opacity is pulsed by ProgressBarIndeterminateMotion\n maxWidth: '100%'\n }\n },\n brand: {\n backgroundColor: tokens.colorCompoundBrandBackground\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 * Apply styling to the ProgressBar slots based on the state\n */ export const useProgressBarStyles_unstable = (state)=>{\n const { color, max, shape, thickness, value } = state;\n const rootStyles = useRootStyles();\n const barStyles = useBarStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(progressBarClassNames.root, rootStyles.root, rootStyles[shape], rootStyles[thickness], state.root.className);\n if (state.bar) {\n // eslint-disable-next-line react-hooks/immutability\n state.bar.className = 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);\n }\n if (state.bar && value !== undefined) {\n // eslint-disable-next-line react-hooks/immutability\n state.bar.style = {\n width: Math.min(100, Math.max(0, value / max * 100)) + '%',\n ...state.bar.style\n };\n }\n return state;\n};\n"],"names":["__styles","mergeClasses","tokens","progressBarClassNames","root","bar","ZERO_THRESHOLD","barThicknessValues","medium","large","useRootStyles","mc9l5x","De3pzq","a9b677","B68tc82","Bmxbyg5","Bpg54ce","Bomf52o","rounded","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","square","Bqenvij","d","p","m","useBarStyles","base","nonZeroDeterminate","Bmy1vo4","B3o57yi","Bkqvd7p","indeterminate","B2u0y6b","qhf8xq","Bcmaq0h","jpy9cc","brand","error","warning","success","useProgressBarStyles_unstable","state","color","max","shape","thickness","value","rootStyles","barStyles","className","undefined","style","width","Math","min"],"mappings":"AAAA,YAAY;;;;;;;;;;;;QAGCG,qBAAqB;;;QAgFjByC,6BAA6B;;;;uBAlFL,gBAAgB;AAElD,8BAA8B;IACjCxC,IAAI,EAAE,iBAAiB;IACvBC,GAAG,EAAE;AACT,CAAC;AACD,sDAAA;AACA,oDAAA;AACA,MAAMC,cAAc,GAAG,IAAI;AAC3B,MAAMC,kBAAkB,GAAG;IACvBC,MAAM,EAAE,KAAK;IACbC,KAAK,EAAE;AACX,CAAC;AACD;;CAEA,GAAI,MAAMC,aAAa,GAAA,WAAA,OAAGV,eAAA,EAAA;IAAAI,IAAA,EAAA;QAAAO,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;IAAAC,MAAA,EAAA;QAAAL,OAAA,EAAA;QAAAC,OAAA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EAAEC,IAAI,CAACC,GAAG,CAAC,GAAG,EAAED,IAAI,CAACV,GAAG,CAAC,CAAC,EAAEG,KAAK,GAAGH,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG;YAC1D,GAAGF,KAAK,CAACxC,GAAG,CAACkD,KAAAA;QACjB,CAAC;IACL;IACA,OAAOV,KAAK;AAChB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
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: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get progressBarClassNames () {
|
|
13
|
+
return progressBarClassNames;
|
|
14
|
+
},
|
|
15
|
+
get useProgressBarStyles_unstable () {
|
|
16
|
+
return useProgressBarStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _clsx = require("clsx");
|
|
21
|
+
const _ProgressBarmodulecss = /*#__PURE__*/ _interop_require_default._(require("./ProgressBar.module.css"));
|
|
22
|
+
const progressBarClassNames = {
|
|
23
|
+
root: 'fui-ProgressBar',
|
|
24
|
+
bar: 'fui-ProgressBar__bar'
|
|
25
|
+
};
|
|
26
|
+
const useProgressBarStyles_unstable = (state)=>{
|
|
27
|
+
const { color, max, shape, thickness, value } = state;
|
|
28
|
+
state.root.className = (0, _clsx.clsx)(progressBarClassNames.root, _ProgressBarmodulecss.default.root, _ProgressBarmodulecss.default[shape], _ProgressBarmodulecss.default[thickness], state.root.className);
|
|
29
|
+
if (state.bar) {
|
|
30
|
+
state.bar.className = (0, _clsx.clsx)(progressBarClassNames.bar, _ProgressBarmodulecss.default.bar, value === undefined && _ProgressBarmodulecss.default.indeterminate, value !== undefined && value > 0.01 && _ProgressBarmodulecss.default.nonZeroDeterminate, value !== undefined && color && _ProgressBarmodulecss.default[color], state.bar.className);
|
|
31
|
+
if (value !== undefined) {
|
|
32
|
+
state.bar.style = {
|
|
33
|
+
width: Math.min(100, Math.max(0, value / max * 100)) + '%',
|
|
34
|
+
...state.bar.style
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return state;
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ProgressBar/useProgressBarStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ProgressBarState, ProgressBarSlots } from './ProgressBar.types';\nimport styles from './ProgressBar.module.css';\n\nexport const progressBarClassNames: SlotClassNames<Omit<ProgressBarSlots, 'indeterminateMotion'>> = {\n root: 'fui-ProgressBar',\n bar: 'fui-ProgressBar__bar',\n};\n\nexport const useProgressBarStyles_unstable = (state: ProgressBarState): ProgressBarState => {\n const { color, max, shape, thickness, value } = state;\n state.root.className = clsx(\n progressBarClassNames.root,\n styles.root,\n styles[shape],\n styles[thickness],\n state.root.className,\n );\n if (state.bar) {\n state.bar.className = clsx(\n progressBarClassNames.bar,\n styles.bar,\n value === undefined && styles.indeterminate,\n value !== undefined && value > 0.01 && styles.nonZeroDeterminate,\n value !== undefined && color && styles[color],\n state.bar.className,\n );\n if (value !== undefined) {\n state.bar.style = { width: Math.min(100, Math.max(0, (value / max) * 100)) + '%', ...state.bar.style };\n }\n }\n return state;\n};\n"],"names":["clsx","styles","progressBarClassNames","root","bar","useProgressBarStyles_unstable","state","color","max","shape","thickness","value","className","undefined","indeterminate","nonZeroDeterminate","style","width","Math","min"],"mappings":";;;;;;;;;;;QAKaE;;;QAKAG;;;;;sBAVQ,OAAO;+EAGT,2BAA2B;AAEvC,8BAA6F;IAClGF,MAAM;IACNC,KAAK;AACP,EAAE;AAEK,sCAAsC,CAACE;IAC5C,MAAM,EAAEC,KAAK,EAAEC,GAAG,EAAEC,KAAK,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGL;IAChDA,MAAMH,IAAI,CAACS,SAAS,OAAGZ,UAAAA,EACrBE,sBAAsBC,IAAI,EAC1BF,6BAAAA,CAAOE,IAAI,EACXF,6BAAM,CAACQ,MAAM,EACbR,6BAAM,CAACS,UAAU,EACjBJ,MAAMH,IAAI,CAACS,SAAS;IAEtB,IAAIN,MAAMF,GAAG,EAAE;QACbE,MAAMF,GAAG,CAACQ,SAAS,OAAGZ,UAAAA,EACpBE,sBAAsBE,GAAG,EACzBH,6BAAAA,CAAOG,GAAG,EACVO,UAAUE,aAAaZ,6BAAAA,CAAOa,aAAa,EAC3CH,UAAUE,aAAaF,QAAQ,QAAQV,6BAAAA,CAAOc,kBAAkB,EAChEJ,UAAUE,aAAaN,SAASN,6BAAM,CAACM,MAAM,EAC7CD,MAAMF,GAAG,CAACQ,SAAS;QAErB,IAAID,UAAUE,WAAW;YACvBP,MAAMF,GAAG,CAACY,KAAK,GAAG;gBAAEC,OAAOC,KAAKC,GAAG,CAAC,KAAKD,KAAKV,GAAG,CAAC,GAAIG,QAAQH,MAAO,QAAQ;gBAAK,GAAGF,MAAMF,GAAG,CAACY,KAAK;YAAC;QACvG;IACF;IACA,OAAOV;AACT,EAAE"}
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
function _export(target, all) {
|
|
7
7
|
for(var name in all)Object.defineProperty(target, name, {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: all
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
progressBarClassNames
|
|
13
|
+
get progressBarClassNames () {
|
|
14
14
|
return progressBarClassNames;
|
|
15
15
|
},
|
|
16
|
-
useProgressBarStyles_unstable
|
|
16
|
+
get useProgressBarStyles_unstable () {
|
|
17
17
|
return useProgressBarStyles_unstable;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ProgressBar/useProgressBarStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { ProgressBarState, ProgressBarSlots } from './ProgressBar.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const progressBarClassNames: SlotClassNames<Omit<ProgressBarSlots, 'indeterminateMotion'>> = {\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\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n root: {\n display: 'block',\n backgroundColor: tokens.colorNeutralBackground6,\n width: '100%',\n overflow: 'hidden',\n\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'CanvasText',\n },\n },\n rounded: {\n borderRadius: tokens.borderRadiusMedium,\n },\n square: {\n 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 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 '@media screen and (prefers-reduced-motion: reduce)': {\n // Reduced motion: bar is sized here, and the opacity is pulsed by ProgressBarIndeterminateMotion\n maxWidth: '100%',\n },\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\n // eslint-disable-next-line react-hooks/immutability\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 // eslint-disable-next-line react-hooks/immutability\n state.bar.className = mergeClasses(\n progressBarClassNames.bar,\n barStyles.base,\n barStyles.brand,\n value === undefined && barStyles.indeterminate,\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 // eslint-disable-next-line react-hooks/immutability\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"],"names":["makeStyles","mergeClasses","tokens","progressBarClassNames","root","bar","ZERO_THRESHOLD","barThicknessValues","medium","large","useRootStyles","display","backgroundColor","colorNeutralBackground6","width","overflow","rounded","borderRadius","borderRadiusMedium","square","borderRadiusNone","height","useBarStyles","base","nonZeroDeterminate","transitionProperty","transitionDuration","transitionTimingFunction","indeterminate","maxWidth","position","backgroundImage","colorTransparentBackground","brand","colorCompoundBrandBackground","error","colorPaletteRedBackground3","warning","colorPaletteDarkOrangeBackground3","success","colorPaletteGreenBackground3","useProgressBarStyles_unstable","state","color","max","shape","thickness","value","rootStyles","barStyles","className","undefined","style","Math","min"],"mappings":"AAAA;;;;;;;;;;;;QAOaG;;;QA2FAsC;;;;uBAhG4B,iBAAiB;4BACnC,wBAAwB;AAIxC,8BAA6F;IAClGrC,MAAM;IACNC,KAAK;AACP,EAAE;AAEF,sDAAsD;AACtD,oDAAoD;AACpD,MAAMC,iBAAiB;AAEvB,MAAMC,qBAAqB;IACzBC,QAAQ;IACRC,OAAO;AACT;AAEA;;CAEC,GACD,MAAMC,oBAAgBV,iBAAAA,EAAW;IAC/BI,MAAM;QACJO,SAAS;QACTC,iBAAiBV,kBAAAA,CAAOW,uBAAuB;QAC/CC,OAAO;QACPC,UAAU;QAEV,6CAA6C;YAC3CH,iBAAiB;QACnB;IACF;IACAI,SAAS;QACPC,cAAcf,kBAAAA,CAAOgB,kBAAkB;IACzC;IACAC,QAAQ;QACNF,cAAcf,kBAAAA,CAAOkB,gBAAgB;IACvC;IACAZ,QAAQ;QACNa,QAAQd,mBAAmBC,MAAM;IACnC;IACAC,OAAO;QACLY,QAAQd,mBAAmBE,KAAK;IAClC;AACF;AAEA;;CAEC,GACD,MAAMa,mBAAetB,iBAAAA,EAAW;IAC9BuB,MAAM;QACJ,6CAA6C;YAC3CX,iBAAiB;QACnB;QACAK,cAAc;QACdI,QAAQ;IACV;IACAG,oBAAoB;QAClBC,oBAAoB;QACpBC,oBAAoB;QACpBC,0BAA0B;IAC5B;IACAC,eAAe;QACbC,UAAU;QACVC,UAAU;QACVC,iBAAiB,CAAC;;MAEhB,EAAE7B,kBAAAA,CAAOW,uBAAuB,CAAC;MACjC,EAAEX,kBAAAA,CAAO8B,0BAA0B,CAAC;MACpC,EAAE9B,kBAAAA,CAAOW,uBAAuB,CAAC;KAClC,CAAC;QACF,sDAAsD;YACpD,iGAAiG;YACjGgB,UAAU;QACZ;IACF;IAEAI,OAAO;QACLrB,iBAAiBV,kBAAAA,CAAOgC,4BAA4B;IACtD;IAEAC,OA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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: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get progressBarClassNames () {
|
|
13
|
+
return progressBarClassNames;
|
|
14
|
+
},
|
|
15
|
+
get useProgressBarStyles_unstable () {
|
|
16
|
+
return useProgressBarStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _clsx = require("clsx");
|
|
21
|
+
const _ProgressBarmodulecss = /*#__PURE__*/ _interop_require_default._(require("./ProgressBar.module.css"));
|
|
22
|
+
const progressBarClassNames = {
|
|
23
|
+
root: 'fui-ProgressBar',
|
|
24
|
+
bar: 'fui-ProgressBar__bar'
|
|
25
|
+
};
|
|
26
|
+
const useProgressBarStyles_unstable = (state)=>{
|
|
27
|
+
const { color, max, shape, thickness, value } = state;
|
|
28
|
+
state.root.className = (0, _clsx.clsx)(progressBarClassNames.root, _ProgressBarmodulecss.default.root, _ProgressBarmodulecss.default[shape], _ProgressBarmodulecss.default[thickness], state.root.className);
|
|
29
|
+
if (state.bar) {
|
|
30
|
+
state.bar.className = (0, _clsx.clsx)(progressBarClassNames.bar, _ProgressBarmodulecss.default.bar, value === undefined && _ProgressBarmodulecss.default.indeterminate, value !== undefined && value > 0.01 && _ProgressBarmodulecss.default.nonZeroDeterminate, value !== undefined && color && _ProgressBarmodulecss.default[color], state.bar.className);
|
|
31
|
+
if (value !== undefined) {
|
|
32
|
+
state.bar.style = {
|
|
33
|
+
width: Math.min(100, Math.max(0, value / max * 100)) + '%',
|
|
34
|
+
...state.bar.style
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return state;
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ProgressBar/useProgressBarStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ProgressBarState, ProgressBarSlots } from './ProgressBar.types';\nimport styles from './ProgressBar.module.css';\n\nexport const progressBarClassNames: SlotClassNames<Omit<ProgressBarSlots, 'indeterminateMotion'>> = {\n root: 'fui-ProgressBar',\n bar: 'fui-ProgressBar__bar',\n};\n\nexport const useProgressBarStyles_unstable = (state: ProgressBarState): ProgressBarState => {\n const { color, max, shape, thickness, value } = state;\n state.root.className = clsx(\n progressBarClassNames.root,\n styles.root,\n styles[shape],\n styles[thickness],\n state.root.className,\n );\n if (state.bar) {\n state.bar.className = clsx(\n progressBarClassNames.bar,\n styles.bar,\n value === undefined && styles.indeterminate,\n value !== undefined && value > 0.01 && styles.nonZeroDeterminate,\n value !== undefined && color && styles[color],\n state.bar.className,\n );\n if (value !== undefined) {\n state.bar.style = { width: Math.min(100, Math.max(0, (value / max) * 100)) + '%', ...state.bar.style };\n }\n }\n return state;\n};\n"],"names":["clsx","styles","progressBarClassNames","root","bar","useProgressBarStyles_unstable","state","color","max","shape","thickness","value","className","undefined","indeterminate","nonZeroDeterminate","style","width","Math","min"],"mappings":";;;;;;;;;;;QAKaE;;;QAKAG;;;;;sBAVQ,OAAO;+EAGT,2BAA2B;AAEvC,8BAA6F;IAClGF,MAAM;IACNC,KAAK;AACP,EAAE;AAEK,sCAAsC,CAACE;IAC5C,MAAM,EAAEC,KAAK,EAAEC,GAAG,EAAEC,KAAK,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGL;IAChDA,MAAMH,IAAI,CAACS,SAAS,OAAGZ,UAAAA,EACrBE,sBAAsBC,IAAI,EAC1BF,6BAAAA,CAAOE,IAAI,EACXF,6BAAM,CAACQ,MAAM,EACbR,6BAAM,CAACS,UAAU,EACjBJ,MAAMH,IAAI,CAACS,SAAS;IAEtB,IAAIN,MAAMF,GAAG,EAAE;QACbE,MAAMF,GAAG,CAACQ,SAAS,OAAGZ,UAAAA,EACpBE,sBAAsBE,GAAG,EACzBH,6BAAAA,CAAOG,GAAG,EACVO,UAAUE,aAAaZ,6BAAAA,CAAOa,aAAa,EAC3CH,UAAUE,aAAaF,QAAQ,QAAQV,6BAAAA,CAAOc,kBAAkB,EAChEJ,UAAUE,aAAaN,SAASN,6BAAM,CAACM,MAAM,EAC7CD,MAAMF,GAAG,CAACQ,SAAS;QAErB,IAAID,UAAUE,WAAW;YACvBP,MAAMF,GAAG,CAACY,KAAK,GAAG;gBAAEC,OAAOC,KAAKC,GAAG,CAAC,KAAKD,KAAKV,GAAG,CAAC,GAAIG,QAAQH,MAAO,QAAQ;gBAAK,GAAGF,MAAMF,GAAG,CAACY,KAAK;YAAC;QACvG;IACF;IACA,OAAOV;AACT,EAAE"}
|
package/lib-commonjs/index.cjs
CHANGED
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
ProgressBar
|
|
12
|
+
get ProgressBar () {
|
|
13
13
|
return _ProgressBar.ProgressBar;
|
|
14
14
|
},
|
|
15
|
-
progressBarClassNames
|
|
15
|
+
get progressBarClassNames () {
|
|
16
16
|
return _ProgressBar.progressBarClassNames;
|
|
17
17
|
},
|
|
18
|
-
renderProgressBar_unstable
|
|
18
|
+
get renderProgressBar_unstable () {
|
|
19
19
|
return _ProgressBar.renderProgressBar_unstable;
|
|
20
20
|
},
|
|
21
|
-
useProgressBarBase_unstable
|
|
21
|
+
get useProgressBarBase_unstable () {
|
|
22
22
|
return _ProgressBar.useProgressBarBase_unstable;
|
|
23
23
|
},
|
|
24
|
-
useProgressBarStyles_unstable
|
|
24
|
+
get useProgressBarStyles_unstable () {
|
|
25
25
|
return _ProgressBar.useProgressBarStyles_unstable;
|
|
26
26
|
},
|
|
27
|
-
useProgressBar_unstable
|
|
27
|
+
get useProgressBar_unstable () {
|
|
28
28
|
return _ProgressBar.useProgressBar_unstable;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../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"],"names":["clampMax","max","internalMax","process","env","NODE_ENV","console","error"],"mappings":";;;;+BAAaA;;;;;;AAAN,iBAAiB,CAACC;IACvB,MAAMC,cAAcD,OAAO,IAAI,IAAIA;IAEnC,IAAIE,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIJ,OAAO,GAAG;YACZ,sCAAsC;YACtCK,QAAQC,KAAK,CAAC,CAAC,qDAAqD,EAAEN,KAAK;QAC7E;IACF;IACA,OAAOC;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../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"],"names":["clampValue","value","max","undefined","internalValue","process","env","NODE_ENV","console","error"],"mappings":";;;;+BAAaA;;;;;;AAAN,mBAAmB,CAACC,OAA2BC;IACpD,IAAID,UAAUE,WAAW;QACvB,OAAOF;IACT;IACA,MAAMG,gBAAgBH,QAAQ,IAAI,IAAIA,QAAQC,MAAMA,MAAMD;IAE1D,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIN,QAAQ,GAAG;YACb,sCAAsC;YACtCO,QAAQC,KAAK,CAAC,CAAC,wEAAwE,EAAER,OAAO;QAClG;QACA,IAAIA,QAAQC,KAAK;YACf,sCAAsC;YACtCM,QAAQC,KAAK,CAAC,CAAC,sEAAsE,EAAER,MAAM,OAAO,EAAEC,KAAK;QAC7G;IACF;IACA,OAAOE;AACT,EAAE"}
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
clampMax
|
|
12
|
+
get clampMax () {
|
|
13
13
|
return _clampMax.clampMax;
|
|
14
14
|
},
|
|
15
|
-
clampValue
|
|
15
|
+
get clampValue () {
|
|
16
16
|
return _clampValue.clampValue;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export { clampMax } from './clampMax';\nexport { clampValue } from './clampValue';\n"],"names":["clampMax","clampValue"],"mappings":";;;;;;;;;;;;eAASA,kBAAQ;;;eACRC,sBAAU;;;0BADM,gBAAa;4BACX,kBAAe"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-progress",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
|
|
4
4
|
"description": "Progress component for FluentUI v9",
|
|
5
5
|
"main": "lib-commonjs/index.cjs",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
7
|
"typings": "./dist/index.d.ts",
|
|
8
|
-
"sideEffects":
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"**/*.css"
|
|
10
|
+
],
|
|
9
11
|
"repository": {
|
|
10
12
|
"type": "git",
|
|
11
13
|
"url": "https://github.com/microsoft/fluentui"
|
|
12
14
|
},
|
|
13
15
|
"license": "MIT",
|
|
14
16
|
"dependencies": {
|
|
15
|
-
"@fluentui/react-field": "9.
|
|
16
|
-
"@fluentui/react-jsx-runtime": "9.
|
|
17
|
-
"@fluentui/react-motion": "9.
|
|
18
|
-
"@fluentui/react-shared-contexts": "9.
|
|
19
|
-
"@fluentui/react-theme": "9.
|
|
20
|
-
"@fluentui/react-utilities": "9.
|
|
17
|
+
"@fluentui/react-field": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
|
|
18
|
+
"@fluentui/react-jsx-runtime": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
|
|
19
|
+
"@fluentui/react-motion": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
|
|
20
|
+
"@fluentui/react-shared-contexts": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
|
|
21
|
+
"@fluentui/react-theme": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
|
|
22
|
+
"@fluentui/react-utilities": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
|
|
21
23
|
"@griffel/react": "^1.5.32",
|
|
22
|
-
"@swc/helpers": "^0.5.1"
|
|
24
|
+
"@swc/helpers": "^0.5.1",
|
|
25
|
+
"clsx": "^2.1.1"
|
|
23
26
|
},
|
|
24
27
|
"peerDependencies": {
|
|
25
28
|
"@types/react": ">=16.14.0 <20.0.0",
|
|
@@ -42,7 +45,6 @@
|
|
|
42
45
|
"default": "./lib-commonjs/index.cjs"
|
|
43
46
|
}
|
|
44
47
|
},
|
|
45
|
-
"./metadata.json": "./dist/metadata/index.json",
|
|
46
48
|
"./package.json": "./package.json"
|
|
47
49
|
},
|
|
48
50
|
"files": [
|
|
@@ -50,9 +52,7 @@
|
|
|
50
52
|
"dist/*.d.ts",
|
|
51
53
|
"dist/*.d.cts",
|
|
52
54
|
"lib",
|
|
53
|
-
"lib-commonjs"
|
|
54
|
-
"dist/metadata"
|
|
55
|
+
"lib-commonjs"
|
|
55
56
|
],
|
|
56
|
-
"type": "module"
|
|
57
|
-
"fluentuiCatalog": "./metadata.json"
|
|
57
|
+
"type": "module"
|
|
58
58
|
}
|