Skip to content

Commit

Permalink
Fix primefaces#5379: Accordion tab header passthrough errors
Browse files Browse the repository at this point in the history
Fix primefaces#5546: AccordionTab Tailwind issues
  • Loading branch information
melloware committed Jan 9, 2024
1 parent ea64b8d commit f6e4ab0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion components/doc/accordion/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const TRANSITIONS = {
const Tailwind = {
accordion: {
root: 'mb-1',
accordiontab: {
tab: {
root: 'mb-1',
header: ({ props }) => ({
className: classNames(
Expand Down
16 changes: 8 additions & 8 deletions components/lib/accordion/Accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const Accordion = React.forwardRef((inProps, ref) => {
}
};

return mergeProps(ptm(`accordion.${key}`, { tab: tabMetaData }), ptm(`accordiontab.${key}`, { accordiontab: tabMetaData }), ptm(`accordiontab.${key}`, tabMetaData), ptmo(getTabProp(tab, 'pt'), key, tabMetaData));
return mergeProps(ptm(`accordion.${key}`, { tab: tabMetaData }), ptm(`tab.${key}`, { accordiontab: tabMetaData }), ptm(`tab.${key}`, tabMetaData), ptmo(getTabProp(tab, 'pt'), key, tabMetaData));
};

const getTabProp = (tab, name) => AccordionTabBase.getCProp(tab, name);
Expand Down Expand Up @@ -201,7 +201,7 @@ export const Accordion = React.forwardRef((inProps, ref) => {
const tabIndex = getTabProp(tab, 'disabled') ? -1 : getTabProp(tab, 'tabIndex');
const headerTitleProps = mergeProps(
{
className: cx('accordiontab.headertitle')
className: cx('tab.headertitle')
},
getTabPT(tab, 'headertitle', index)
);
Expand All @@ -210,7 +210,7 @@ export const Accordion = React.forwardRef((inProps, ref) => {
const headerIconProps = mergeProps(
{
'aria-hidden': 'true',
className: cx('accordiontab.headericon')
className: cx('tab.headericon')
},
getTabPT(tab, 'headericon', index)
);
Expand All @@ -230,7 +230,7 @@ export const Accordion = React.forwardRef((inProps, ref) => {
{
id: headerId,
href: '#' + ariaControls,
className: cx('accordiontab.headeraction'),
className: cx('tab.headeraction'),
role: 'button',
tabIndex,
onClick: (e) => onTabHeaderClick(e, tab, index),
Expand Down Expand Up @@ -261,7 +261,7 @@ export const Accordion = React.forwardRef((inProps, ref) => {
{
id: contentId,
ref: contentRef,
className: classNames(getTabProp(tab, 'contentClassName'), getTabProp(tab, 'className'), cx('accordiontab.toggleablecontent')),
className: classNames(getTabProp(tab, 'contentClassName'), getTabProp(tab, 'className'), cx('tab.toggleablecontent')),
style,
role: 'region',
'aria-labelledby': ariaLabelledby
Expand All @@ -271,14 +271,14 @@ export const Accordion = React.forwardRef((inProps, ref) => {

const contentProps = mergeProps(
{
className: cx('accordiontab.content')
className: cx('tab.content')
},
getTabPT(tab, 'content', index)
);

const transitionProps = mergeProps(
{
classNames: cx('accordiontab.transition'),
classNames: cx('tab.transition'),
timeout: { enter: 1000, exit: 450 },
in: selected,
unmountOnExit: true,
Expand Down Expand Up @@ -306,7 +306,7 @@ export const Accordion = React.forwardRef((inProps, ref) => {
const rootProps = mergeProps(
{
key,
className: cx('accordiontab.root', { selected })
className: cx('tab.root', { selected })
},
AccordionTabBase.getCOtherProps(tab),
getTabPT(tab, 'root', index)
Expand Down
2 changes: 1 addition & 1 deletion components/lib/accordion/AccordionBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ObjectUtils, classNames } from '../utils/Utils';

const classes = {
root: 'p-accordion p-component',
accordiontab: {
tab: {
root: ({ selected }) =>
classNames('p-accordion-tab', {
'p-accordion-tab-active': selected
Expand Down
2 changes: 1 addition & 1 deletion components/lib/passthrough/tailwind/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const Tailwind = {
},
accordion: {
root: 'mb-1',
accordiontab: {
tab: {
root: 'mb-1',
header: ({ context }) => {
return {
Expand Down

0 comments on commit f6e4ab0

Please sign in to comment.