@equinor/eds-core-react 0.20.0 → 0.20.1-dev.20220609

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.
@@ -5897,17 +5897,11 @@ const Slider = /*#__PURE__*/react.forwardRef(function Slider(_ref10, ref) {
5897
5897
  inputId = "".concat(overrideId, "-thumb");
5898
5898
  }
5899
5899
 
5900
- const getAriaLabelledby = () => {
5900
+ const getAriaLabelledby = react.useCallback(() => {
5901
5901
  if (ariaLabelledbyNative) return ariaLabelledbyNative;
5902
-
5903
- if (ariaLabelledby) {
5904
- console.warn('Slider: The "ariaLabelledby" prop is deprecated and will be removed in a future version of EDS, please use the native "aria-labelledby" instead');
5905
- return ariaLabelledby;
5906
- }
5907
-
5902
+ if (ariaLabelledby) return ariaLabelledby;
5908
5903
  return null;
5909
- };
5910
-
5904
+ }, [ariaLabelledbyNative, ariaLabelledby]);
5911
5905
  return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
5912
5906
  children: isRangeSlider ? /*#__PURE__*/jsxRuntime.jsxs(RangeWrapper, { ...rest,
5913
5907
  ref: ref,
@@ -1,4 +1,4 @@
1
- import { forwardRef, useState, useEffect, useRef } from 'react';
1
+ import { forwardRef, useState, useEffect, useRef, useCallback } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
3
  import { slider } from './Slider.tokens.js';
4
4
  import { MinMax } from './MinMax.js';
@@ -198,17 +198,11 @@ const Slider = /*#__PURE__*/forwardRef(function Slider(_ref10, ref) {
198
198
  inputId = "".concat(overrideId, "-thumb");
199
199
  }
200
200
 
201
- const getAriaLabelledby = () => {
201
+ const getAriaLabelledby = useCallback(() => {
202
202
  if (ariaLabelledbyNative) return ariaLabelledbyNative;
203
-
204
- if (ariaLabelledby) {
205
- console.warn('Slider: The "ariaLabelledby" prop is deprecated and will be removed in a future version of EDS, please use the native "aria-labelledby" instead');
206
- return ariaLabelledby;
207
- }
208
-
203
+ if (ariaLabelledby) return ariaLabelledby;
209
204
  return null;
210
- };
211
-
205
+ }, [ariaLabelledbyNative, ariaLabelledby]);
212
206
  return /*#__PURE__*/jsx(Fragment, {
213
207
  children: isRangeSlider ? /*#__PURE__*/jsxs(RangeWrapper, { ...rest,
214
208
  ref: ref,
@@ -1,6 +1,9 @@
1
1
  import { HTMLAttributes, MouseEvent, KeyboardEvent, ChangeEvent } from 'react';
2
2
  export declare type SliderProps = {
3
- /** Id for the elements that labels this slider (NOTE: will be deprecated and removed in a future version of EDS, please use the native aria-labelledby instead) */
3
+ /**
4
+ * Id for the elements that labels this slider
5
+ * @deprecated Use the `aria-labelledby` instead
6
+ * */
4
7
  ariaLabelledby?: string;
5
8
  /** Components value, range of numbers */
6
9
  value: number[] | number;
@@ -24,7 +27,10 @@ export declare type SliderProps = {
24
27
  disabled?: boolean;
25
28
  } & Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>;
26
29
  export declare const Slider: import("react").ForwardRefExoticComponent<{
27
- /** Id for the elements that labels this slider (NOTE: will be deprecated and removed in a future version of EDS, please use the native aria-labelledby instead) */
30
+ /**
31
+ * Id for the elements that labels this slider
32
+ * @deprecated Use the `aria-labelledby` instead
33
+ * */
28
34
  ariaLabelledby?: string;
29
35
  /** Components value, range of numbers */
30
36
  value: number[] | number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/eds-core-react",
3
- "version": "0.20.0",
3
+ "version": "0.20.1-dev.20220609",
4
4
  "description": "The React implementation of the Equinor Design System",
5
5
  "sideEffects": [
6
6
  "**/*.css"