+
(
/>
{showValueLabel && (
{({ state }) => {
const values = state.values;
@@ -169,9 +168,7 @@ export const RangeSlider = forwardRef(
)}
)}
-
+
{({ state }) => {
const start = state.getThumbPercent(0);
const end = state.getThumbPercent(1);
@@ -189,19 +186,16 @@ export const RangeSlider = forwardRef(
return (
<>
>
);
diff --git a/packages/ui/src/components/RangeSlider/definition.ts b/packages/ui/src/components/RangeSlider/definition.ts
index 29f605978a..b23e607ede 100644
--- a/packages/ui/src/components/RangeSlider/definition.ts
+++ b/packages/ui/src/components/RangeSlider/definition.ts
@@ -14,13 +14,16 @@
* limitations under the License.
*/
-import type { ComponentDefinition } from '../../types';
+import { defineComponent } from '../../hooks/useDefinition';
+import type { RangeSliderOwnProps } from './types';
+import styles from './RangeSlider.module.css';
/**
* Component definition for RangeSlider
* @public
*/
-export const RangeSliderDefinition = {
+export const RangeSliderDefinition = defineComponent()({
+ styles,
classNames: {
root: 'bui-RangeSlider',
header: 'bui-RangeSliderHeader',
@@ -29,8 +32,7 @@ export const RangeSliderDefinition = {
thumb: 'bui-RangeSliderThumb',
output: 'bui-RangeSliderOutput',
},
- dataAttributes: {
- disabled: [true, false] as const,
- orientation: ['horizontal', 'vertical'] as const,
+ propDefs: {
+ className: {},
},
-} as const satisfies ComponentDefinition;
+});
diff --git a/packages/ui/src/components/RangeSlider/types.ts b/packages/ui/src/components/RangeSlider/types.ts
index 1f09cfc713..2ee4105240 100644
--- a/packages/ui/src/components/RangeSlider/types.ts
+++ b/packages/ui/src/components/RangeSlider/types.ts
@@ -17,10 +17,24 @@
import type { SliderProps as AriaSliderProps } from 'react-aria-components';
import type { FieldLabelProps } from '../FieldLabel/types';
+/** @public */
+export interface RangeSliderOwnProps {
+ className?: string;
+}
+
/** @public */
export interface RangeSliderProps
extends Omit, 'children'>,
- Omit {
+ Omit<
+ FieldLabelProps,
+ | 'htmlFor'
+ | 'id'
+ | 'className'
+ | 'defaultValue'
+ | 'onChange'
+ | 'slot'
+ | 'style'
+ > {
/**
* Whether to show a value label in the header next to the field label
* @defaultValue false