Skip to content

Commit

Permalink
Use divs for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Jan 24, 2025
1 parent 66d6fa1 commit 3e71a35
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ describe('<Progress.Indicator />', () => {
<ProgressRootContext.Provider value={contextValue}>{node}</ProgressRootContext.Provider>,
);
},
refInstanceof: window.HTMLSpanElement,
refInstanceof: window.HTMLDivElement,
}));

describe.skipIf(isJSDOM)('internal styles', () => {
it('determinate', async () => {
const { getByTestId } = await render(
<Progress.Root value={33}>
<Progress.Track>
<Progress.Indicator data-testid="indicator" />
<Progress.Indicator data-testid="indicator" render={<span />} />
</Progress.Track>
</Progress.Root>,
);
Expand All @@ -60,7 +60,7 @@ describe('<Progress.Indicator />', () => {

expect(indicator).toHaveComputedStyle({
insetInlineStart: '0px',
width: '0%',
width: '0px',
});
});

Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/progress/indicator/ProgressIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BaseUIComponentProps } from '../../utils/types';

/**
* Visualizes the completion status of the task.
* Renders a `<span>` element.
* Renders a `<div>` element.
*
* Documentation: [Base UI Progress](https://base-ui.com/react/components/progress)
*/
Expand All @@ -30,7 +30,7 @@ const ProgressIndicator = React.forwardRef(function ProgressIndicator(

const { renderElement } = useComponentRenderer({
propGetter: getRootProps,
render: render ?? 'span',
render: render ?? 'div',
state,
className,
ref: forwardedRef,
Expand All @@ -44,7 +44,7 @@ const ProgressIndicator = React.forwardRef(function ProgressIndicator(
namespace ProgressIndicator {
export interface State extends ProgressRoot.State {}

export interface Props extends BaseUIComponentProps<'span', State> {}
export interface Props extends BaseUIComponentProps<'div', State> {}
}

ProgressIndicator.propTypes /* remove-proptypes */ = {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/progress/track/ProgressTrack.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ describe('<Progress.Track />', () => {
<ProgressRootContext.Provider value={contextValue}>{node}</ProgressRootContext.Provider>,
);
},
refInstanceof: window.HTMLSpanElement,
refInstanceof: window.HTMLDivElement,
}));
});
6 changes: 3 additions & 3 deletions packages/react/src/progress/track/ProgressTrack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { BaseUIComponentProps } from '../../utils/types';

/**
* Contains the progress bar indicator.
* Renders a `<span>` element.
* Renders a `<div>` element.
*
* Documentation: [Base UI Progress](https://base-ui.com/react/components/progress)
*/
Expand All @@ -22,7 +22,7 @@ const ProgressTrack = React.forwardRef(function ProgressTrack(
const { state } = useProgressRootContext();

const { renderElement } = useComponentRenderer({
render: render ?? 'span',
render: render ?? 'div',
state,
className,
ref: forwardedRef,
Expand All @@ -36,7 +36,7 @@ const ProgressTrack = React.forwardRef(function ProgressTrack(
namespace ProgressTrack {
export interface State extends ProgressRoot.State {}

export interface Props extends BaseUIComponentProps<'span', State> {}
export interface Props extends BaseUIComponentProps<'div', State> {}
}

ProgressTrack.propTypes /* remove-proptypes */ = {
Expand Down

0 comments on commit 3e71a35

Please sign in to comment.