Skip to content

Commit 69901b5

Browse files
authored
fix(Loader): deprecate component (#5844)
This component is a remnant of temporary design guidelines and is not recommended to be used anymore. The `BusyIndicator` should be the only loading indicator available. Therefore, we will remove this component in favor of the `BusyIndicator` with our next release. For further information see [Fiori for Web Design Guidelines](https://experience.sap.com/fiori-design-web/busy-handling/)
1 parent 7dc1806 commit 69901b5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/main/src/components/Loader/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import { useI18nBundle, useStylesheet } from '@ui5/webcomponents-react-base';
3+
import { deprecationNotice, useI18nBundle, useStylesheet } from '@ui5/webcomponents-react-base';
44
import { clsx } from 'clsx';
55
import type { CSSProperties } from 'react';
66
import React, { forwardRef, useEffect, useState } from 'react';
@@ -29,6 +29,10 @@ export interface LoaderPropTypes extends CommonProps {
2929
/**
3030
* The `Loader` signals that an operation is currently being executed. It uses as little space as possible to allow the user to interact with the UI.<br />
3131
* It can be used to signal a data update on an already existing dataset, or where an expansion will happen.
32+
*
33+
* __Note:__ This component is __deprecated__ and will be removed with our next major release (v2.0.0)! Please use the [BusyIndicator](https://sap.github.io/ui5-webcomponents-react/?path=/docs/user-feedback-busyindicator--docs) instead.
34+
*
35+
* @deprecated This component is deprecated and will be removed with our next major release (v2.0.0)! Please use the [BusyIndicator](https://sap.github.io/ui5-webcomponents-react/?path=/docs/user-feedback-busyindicator--docs) instead.
3236
*/
3337
const Loader = forwardRef<HTMLDivElement, LoaderPropTypes>((props, ref) => {
3438
const { className, type, progress, slot, style, delay, ...rest } = props;
@@ -39,6 +43,10 @@ const Loader = forwardRef<HTMLDivElement, LoaderPropTypes>((props, ref) => {
3943
const loaderClasses = clsx(classNames.loader, className, classNames[`loader${type}`]);
4044
const backgroundSize = type !== LoaderType.Determinate ? '40%' : progress;
4145

46+
useEffect(() => {
47+
deprecationNotice('Loader', 'The `Loader` component is deprecated. Please use the `BusyIndicator` instead.');
48+
}, []);
49+
4250
useEffect(() => {
4351
let timeout;
4452
if (delay > 0) {

0 commit comments

Comments
 (0)