Skip to content

Commit

Permalink
chore(react-accordion): adopt custom JSX pragma
Browse files Browse the repository at this point in the history
  • Loading branch information
bsunderhus committed Apr 18, 2023
1 parent 391878b commit 7500393
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "feat: adopt custom JSX pragma",
"packageName": "@fluentui/react-accordion",
"email": "bernardo.sunderhus@gmail.com",
"dependentChangeType": "patch"
}
1 change: 1 addition & 0 deletions packages/react-components/react-accordion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@fluentui/react-tabster": "^9.6.5",
"@fluentui/react-theme": "^9.1.7",
"@fluentui/react-utilities": "^9.8.0",
"@fluentui/react-jsx-runtime": "9.0.0-alpha.1",
"@griffel/react": "^1.5.2",
"@swc/helpers": "^0.4.14"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
/** @jsxRuntime classic */
/** @jsx createElement */

import { createElement } from '@fluentui/react-jsx-runtime';

import { getSlotsNext } from '@fluentui/react-utilities';

import { AccordionContext } from './AccordionContext';
import type { AccordionState, AccordionSlots, AccordionContextValues } from './Accordion.types';
Expand All @@ -8,7 +12,7 @@ import type { AccordionState, AccordionSlots, AccordionContextValues } from './A
* Function that renders the final JSX of the component
*/
export const renderAccordion_unstable = (state: AccordionState, contextValues: AccordionContextValues) => {
const { slots, slotProps } = getSlots<AccordionSlots>(state);
const { slots, slotProps } = getSlotsNext<AccordionSlots>(state);

return (
<slots.root {...slotProps.root}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
/** @jsxRuntime classic */
/** @jsx createElement */

import { createElement } from '@fluentui/react-jsx-runtime';

import { getSlotsNext } from '@fluentui/react-utilities';
import { AccordionHeaderContext } from './AccordionHeaderContext';
import type { AccordionHeaderState, AccordionHeaderSlots, AccordionHeaderContextValues } from './AccordionHeader.types';

Expand All @@ -10,7 +14,7 @@ export const renderAccordionHeader_unstable = (
state: AccordionHeaderState,
contextValues: AccordionHeaderContextValues,
) => {
const { slots, slotProps } = getSlots<AccordionHeaderSlots>(state);
const { slots, slotProps } = getSlotsNext<AccordionHeaderSlots>(state);

return (
<AccordionHeaderContext.Provider value={contextValues.accordionHeader}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
/** @jsxRuntime classic */
/** @jsx createElement */

import { createElement } from '@fluentui/react-jsx-runtime';

import { getSlotsNext } from '@fluentui/react-utilities';
import { AccordionItemContext } from './AccordionItemContext';
import type { AccordionItemState, AccordionItemSlots, AccordionItemContextValues } from './AccordionItem.types';

/**
* Function that renders the final JSX of the component
*/
export const renderAccordionItem_unstable = (state: AccordionItemState, contextValues: AccordionItemContextValues) => {
const { slots, slotProps } = getSlots<AccordionItemSlots>(state);
const { slots, slotProps } = getSlotsNext<AccordionItemSlots>(state);

return (
<slots.root {...slotProps.root}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
/** @jsxRuntime classic */
/** @jsx createElement */

import { createElement } from '@fluentui/react-jsx-runtime';

import { getSlotsNext } from '@fluentui/react-utilities';
import type { AccordionPanelState, AccordionPanelSlots } from './AccordionPanel.types';

/**
* Function that renders the final JSX of the component
*/
export const renderAccordionPanel_unstable = (state: AccordionPanelState) => {
const { slots, slotProps } = getSlots<AccordionPanelSlots>(state);
const { slots, slotProps } = getSlotsNext<AccordionPanelSlots>(state);
return state.open ? <slots.root {...slotProps.root}>{slotProps.root.children}</slots.root> : null;
};

0 comments on commit 7500393

Please sign in to comment.