Skip to content

Commit

Permalink
chore(react-accordion): adopt custom JSX pragma (microsoft#27601)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsunderhus authored and marcosmoura committed Apr 25, 2023
1 parent 0c7ab84 commit f671af5
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 @@ -35,6 +35,7 @@
"@fluentui/react-aria": "^9.3.18",
"@fluentui/react-context-selector": "^9.1.18",
"@fluentui/react-icons": "^2.0.196",
"@fluentui/react-jsx-runtime": "9.0.0-alpha.1",
"@fluentui/react-shared-contexts": "^9.3.3",
"@fluentui/react-tabster": "^9.6.5",
"@fluentui/react-theme": "^9.1.7",
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 f671af5

Please sign in to comment.