Private
Public Access
1
0

feat: Fluent UI Outlook Lite + connections mockup

This commit is contained in:
2026-04-14 18:52:25 +00:00
parent 1199eff6c3
commit dfa4010406
34820 changed files with 1003813 additions and 205 deletions

View File

@@ -0,0 +1,16 @@
import * as React from 'react';
import { isSlot } from '@fluentui/react-utilities';
import { createElementFromSlotComponent } from './jsx/createElementFromSlotComponent';
import { createCompatSlotComponent } from './utils/createCompatSlotComponent';
export function createElement(type, props, ...children) {
// TODO:
// this is for backwards compatibility with getSlotsNext
// it should be removed once getSlotsNext is obsolete
if (isSlot(props)) {
return createElementFromSlotComponent(createCompatSlotComponent(type, props), children);
}
if (isSlot(type)) {
return createElementFromSlotComponent(type, children);
}
return React.createElement(type, props, ...children);
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/createElement.ts"],"sourcesContent":["import * as React from 'react';\nimport { isSlot } from '@fluentui/react-utilities';\nimport { createElementFromSlotComponent } from './jsx/createElementFromSlotComponent';\nimport { createCompatSlotComponent } from './utils/createCompatSlotComponent';\n\nexport function createElement<P extends {}>(\n type: React.ElementType<P>,\n props?: P | null,\n ...children: React.ReactNode[]\n): React.ReactElement<P> {\n // TODO:\n // this is for backwards compatibility with getSlotsNext\n // it should be removed once getSlotsNext is obsolete\n if (isSlot<P>(props)) {\n return createElementFromSlotComponent(createCompatSlotComponent(type, props), children);\n }\n if (isSlot<P>(type)) {\n return createElementFromSlotComponent(type, children);\n }\n return React.createElement(type, props, ...children);\n}\n"],"names":["React","isSlot","createElementFromSlotComponent","createCompatSlotComponent","createElement","type","props","children"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,8BAA8B,QAAQ,uCAAuC;AACtF,SAASC,yBAAyB,QAAQ,oCAAoC;AAE9E,OAAO,SAASC,cACdC,IAA0B,EAC1BC,KAAgB,EAChB,GAAGC,QAA2B;IAE9B,QAAQ;IACR,wDAAwD;IACxD,qDAAqD;IACrD,IAAIN,OAAUK,QAAQ;QACpB,OAAOJ,+BAA+BC,0BAA0BE,MAAMC,QAAQC;IAChF;IACA,IAAIN,OAAUI,OAAO;QACnB,OAAOH,+BAA+BG,MAAME;IAC9C;IACA,OAAOP,MAAMI,aAAa,CAACC,MAAMC,UAAUC;AAC7C"}

View File

@@ -0,0 +1,2 @@
export { createElement } from './createElement';
export { Fragment } from 'react';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { createElement } from './createElement';\nexport { Fragment } from 'react';\n"],"names":["createElement","Fragment"],"mappings":"AAAA,SAASA,aAAa,QAAQ,kBAAkB;AAChD,SAASC,QAAQ,QAAQ,QAAQ"}

View File

@@ -0,0 +1,5 @@
import { createJSX } from './jsx/createJSX';
import { jsxDEVSlot } from './jsx/jsxDEVSlot';
import { DevRuntime } from './utils/DevRuntime';
export { Fragment } from 'react';
export const jsxDEV = createJSX(DevRuntime.jsxDEV, jsxDEVSlot);

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/jsx-dev-runtime.ts"],"sourcesContent":["import { createJSX } from './jsx/createJSX';\nimport { jsxDEVSlot } from './jsx/jsxDEVSlot';\nimport { DevRuntime } from './utils/DevRuntime';\n\nexport { Fragment } from 'react';\n\nexport const jsxDEV = createJSX(DevRuntime.jsxDEV, jsxDEVSlot);\n"],"names":["createJSX","jsxDEVSlot","DevRuntime","Fragment","jsxDEV"],"mappings":"AAAA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,UAAU,QAAQ,mBAAmB;AAC9C,SAASC,UAAU,QAAQ,qBAAqB;AAEhD,SAASC,QAAQ,QAAQ,QAAQ;AAEjC,OAAO,MAAMC,SAASJ,UAAUE,WAAWE,MAAM,EAAEH,YAAY"}

View File

@@ -0,0 +1,3 @@
// needed to augment the JSX namespace for test where directly `createElement` from './createElement' is used, as we are not importing from @fluentui/react-jsx-runtime
// NOTE: this will augment all test files !
export { };

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/jsx-namespace.test.d.ts"],"sourcesContent":["// needed to augment the JSX namespace for test where directly `createElement` from './createElement' is used, as we are not importing from @fluentui/react-jsx-runtime\n// NOTE: this will augment all test files !\nimport type * as React from 'react';\n\n/**\n * Cross React Major Version compatible Intrinsic Element Keys\n */\ntype JSXIntrinsicElementKeys = Exclude<React.ElementType, React.ComponentType>;\n/**\n * Cross React Major Version compatible IntrinsicElement Dictionary\n */\ntype JSXIntrinsicElements = { [K in JSXIntrinsicElementKeys]: React.ComponentProps<K> };\n\ndeclare global {\n namespace JSX {\n interface IntrinsicElements extends JSXIntrinsicElements {}\n }\n}\n"],"names":[],"mappings":"AAAA,uKAAuK;AACvK,2CAA2C;AAC3C,WAAoC"}

View File

@@ -0,0 +1,7 @@
import { createJSX } from './jsx/createJSX';
import { jsxSlot } from './jsx/jsxSlot';
import { jsxsSlot } from './jsx/jsxsSlot';
import { Runtime } from './utils/Runtime';
export { Fragment } from 'react';
export const jsx = createJSX(Runtime.jsx, jsxSlot);
export const jsxs = createJSX(Runtime.jsxs, jsxsSlot);

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/jsx-runtime.ts"],"sourcesContent":["import { createJSX } from './jsx/createJSX';\nimport { jsxSlot } from './jsx/jsxSlot';\nimport { jsxsSlot } from './jsx/jsxsSlot';\nimport { Runtime } from './utils/Runtime';\n\nexport { Fragment } from 'react';\n\nexport const jsx = createJSX(Runtime.jsx, jsxSlot);\nexport const jsxs = createJSX(Runtime.jsxs, jsxsSlot);\n"],"names":["createJSX","jsxSlot","jsxsSlot","Runtime","Fragment","jsx","jsxs"],"mappings":"AAAA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,OAAO,QAAQ,kBAAkB;AAE1C,SAASC,QAAQ,QAAQ,QAAQ;AAEjC,OAAO,MAAMC,MAAML,UAAUG,QAAQE,GAAG,EAAEJ,SAAS;AACnD,OAAO,MAAMK,OAAON,UAAUG,QAAQG,IAAI,EAAEJ,UAAU"}

View File

@@ -0,0 +1,15 @@
import * as React from 'react';
import { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';
/**
* @internal
* creates a ReactElement from a slot declaration
*/ export function createElementFromSlotComponent(type, overrideChildren) {
const { elementType, renderFunction, props } = getMetadataFromSlotComponent(type);
if (renderFunction) {
if (overrideChildren.length > 0) {
props.children = React.createElement(React.Fragment, {}, ...overrideChildren);
}
return React.createElement(React.Fragment, {}, renderFunction(elementType, props));
}
return React.createElement(elementType, props, ...overrideChildren);
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/jsx/createElementFromSlotComponent.ts"],"sourcesContent":["import * as React from 'react';\nimport type { SlotComponentType, UnknownSlotProps } from '@fluentui/react-utilities';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\n\n/**\n * @internal\n * creates a ReactElement from a slot declaration\n */\nexport function createElementFromSlotComponent<Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n overrideChildren: React.ReactNode[],\n): React.ReactElement<Props> {\n const { elementType, renderFunction, props } = getMetadataFromSlotComponent(type);\n\n if (renderFunction) {\n if (overrideChildren.length > 0) {\n props.children = React.createElement(React.Fragment, {}, ...overrideChildren);\n }\n\n return React.createElement(\n React.Fragment,\n {},\n renderFunction(elementType as React.ElementType<Props>, props),\n ) as React.ReactElement<Props>;\n }\n\n return React.createElement(elementType, props, ...overrideChildren);\n}\n"],"names":["React","getMetadataFromSlotComponent","createElementFromSlotComponent","type","overrideChildren","elementType","renderFunction","props","length","children","createElement","Fragment"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,4BAA4B,QAAQ,wCAAwC;AAErF;;;CAGC,GACD,OAAO,SAASC,+BACdC,IAA8B,EAC9BC,gBAAmC;IAEnC,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAEC,KAAK,EAAE,GAAGN,6BAA6BE;IAE5E,IAAIG,gBAAgB;QAClB,IAAIF,iBAAiBI,MAAM,GAAG,GAAG;YAC/BD,MAAME,QAAQ,GAAGT,MAAMU,aAAa,CAACV,MAAMW,QAAQ,EAAE,CAAC,MAAMP;QAC9D;QAEA,OAAOJ,MAAMU,aAAa,CACxBV,MAAMW,QAAQ,EACd,CAAC,GACDL,eAAeD,aAAyCE;IAE5D;IAEA,OAAOP,MAAMU,aAAa,CAACL,aAAaE,UAAUH;AACpD"}

View File

@@ -0,0 +1,19 @@
import { isSlot } from '@fluentui/react-utilities';
import * as React from 'react';
import { createCompatSlotComponent } from '../utils/createCompatSlotComponent';
import { warnIfElementTypeIsInvalid } from '../utils/warnIfElementTypeIsInvalid';
export function createJSX(runtime, slotRuntime) {
return function jsx(type, overrideProps, key, source, self) {
// TODO:
// this is for backwards compatibility with getSlotsNext
// it should be removed once getSlotsNext is obsolete
if (isSlot(overrideProps)) {
return slotRuntime(createCompatSlotComponent(type, overrideProps), null, key, source, self);
}
if (isSlot(type)) {
return slotRuntime(type, overrideProps, key, source, self);
}
warnIfElementTypeIsInvalid(type);
return runtime(type, overrideProps, key, source, self);
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/jsx/createJSX.ts"],"sourcesContent":["import { isSlot } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { createCompatSlotComponent } from '../utils/createCompatSlotComponent';\nimport { JSXRuntime, JSXSlotRuntime } from '../utils/types';\nimport { warnIfElementTypeIsInvalid } from '../utils/warnIfElementTypeIsInvalid';\n\nexport function createJSX(runtime: JSXRuntime, slotRuntime: JSXSlotRuntime) {\n return function jsx<Props extends {}>(\n type: React.ElementType<Props>,\n overrideProps: Props | null,\n key?: React.Key,\n source?: unknown,\n self?: unknown,\n ): React.ReactElement<Props> {\n // TODO:\n // this is for backwards compatibility with getSlotsNext\n // it should be removed once getSlotsNext is obsolete\n if (isSlot<Props>(overrideProps)) {\n return slotRuntime<Props>(createCompatSlotComponent(type, overrideProps), null, key, source, self);\n }\n if (isSlot<Props>(type)) {\n return slotRuntime(type, overrideProps, key, source, self);\n }\n warnIfElementTypeIsInvalid(type);\n return runtime(type, overrideProps, key, source, self);\n };\n}\n"],"names":["isSlot","React","createCompatSlotComponent","warnIfElementTypeIsInvalid","createJSX","runtime","slotRuntime","jsx","type","overrideProps","key","source","self"],"mappings":"AAAA,SAASA,MAAM,QAAQ,4BAA4B;AACnD,YAAYC,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,qCAAqC;AAE/E,SAASC,0BAA0B,QAAQ,sCAAsC;AAEjF,OAAO,SAASC,UAAUC,OAAmB,EAAEC,WAA2B;IACxE,OAAO,SAASC,IACdC,IAA8B,EAC9BC,aAA2B,EAC3BC,GAAe,EACfC,MAAgB,EAChBC,IAAc;QAEd,QAAQ;QACR,wDAAwD;QACxD,qDAAqD;QACrD,IAAIZ,OAAcS,gBAAgB;YAChC,OAAOH,YAAmBJ,0BAA0BM,MAAMC,gBAAgB,MAAMC,KAAKC,QAAQC;QAC/F;QACA,IAAIZ,OAAcQ,OAAO;YACvB,OAAOF,YAAYE,MAAMC,eAAeC,KAAKC,QAAQC;QACvD;QACAT,2BAA2BK;QAC3B,OAAOH,QAAQG,MAAMC,eAAeC,KAAKC,QAAQC;IACnD;AACF"}

View File

@@ -0,0 +1,32 @@
import * as React from 'react';
import { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';
import { DevRuntime } from '../utils/DevRuntime';
export const jsxDEVSlot = (type, overrideProps, key, source, self)=>{
const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);
const props = {
...slotProps,
...overrideProps
};
if (renderFunction) {
// if runtime is static
if (source === true) {
return DevRuntime.jsxDEV(React.Fragment, {
children: renderFunction(elementType, {
...props,
/**
* If the runtime is static then children is an array and this array won't be keyed.
* Then we should wrap children by a static fragment
* as there's no way to know if renderFunction will render statically or dynamically
*/ children: DevRuntime.jsxDEV(React.Fragment, {
children: props.children
}, undefined, true, self)
})
}, key, false, self);
}
// if runtime is dynamic (source = false) things are simpler
return DevRuntime.jsxDEV(React.Fragment, {
children: renderFunction(elementType, props)
}, key, source, self);
}
return DevRuntime.jsxDEV(elementType, props, key, source, self);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/jsx/jsxDEVSlot.ts"],"sourcesContent":["import * as React from 'react';\nimport { SlotComponentType, UnknownSlotProps } from '@fluentui/react-utilities';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\nimport { DevRuntime } from '../utils/DevRuntime';\n\nexport const jsxDEVSlot = <Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n overrideProps: Props | null,\n key?: React.Key,\n source?: unknown,\n self?: unknown,\n): React.ReactElement<Props> => {\n const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);\n\n const props: Props = { ...slotProps, ...overrideProps };\n\n if (renderFunction) {\n // if runtime is static\n if (source === true) {\n return DevRuntime.jsxDEV(\n React.Fragment,\n {\n children: renderFunction(elementType, {\n ...props,\n /**\n * If the runtime is static then children is an array and this array won't be keyed.\n * Then we should wrap children by a static fragment\n * as there's no way to know if renderFunction will render statically or dynamically\n */\n children: DevRuntime.jsxDEV(React.Fragment, { children: props.children }, undefined, true, self),\n }),\n },\n key,\n false, // by marking source as false we're declaring that this render is dynamic\n self,\n ) as React.ReactElement<Props>;\n }\n // if runtime is dynamic (source = false) things are simpler\n return DevRuntime.jsxDEV(\n React.Fragment,\n { children: renderFunction(elementType, props) },\n key,\n source,\n self,\n ) as React.ReactElement<Props>;\n }\n return DevRuntime.jsxDEV(elementType, props, key, source, self);\n};\n"],"names":["React","getMetadataFromSlotComponent","DevRuntime","jsxDEVSlot","type","overrideProps","key","source","self","elementType","renderFunction","props","slotProps","jsxDEV","Fragment","children","undefined"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,4BAA4B,QAAQ,wCAAwC;AACrF,SAASC,UAAU,QAAQ,sBAAsB;AAEjD,OAAO,MAAMC,aAAa,CACxBC,MACAC,eACAC,KACAC,QACAC;IAEA,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAEC,OAAOC,SAAS,EAAE,GAAGX,6BAA6BG;IAEvF,MAAMO,QAAe;QAAE,GAAGC,SAAS;QAAE,GAAGP,aAAa;IAAC;IAEtD,IAAIK,gBAAgB;QAClB,uBAAuB;QACvB,IAAIH,WAAW,MAAM;YACnB,OAAOL,WAAWW,MAAM,CACtBb,MAAMc,QAAQ,EACd;gBACEC,UAAUL,eAAeD,aAAa;oBACpC,GAAGE,KAAK;oBACR;;;;aAIC,GACDI,UAAUb,WAAWW,MAAM,CAACb,MAAMc,QAAQ,EAAE;wBAAEC,UAAUJ,MAAMI,QAAQ;oBAAC,GAAGC,WAAW,MAAMR;gBAC7F;YACF,GACAF,KACA,OACAE;QAEJ;QACA,4DAA4D;QAC5D,OAAON,WAAWW,MAAM,CACtBb,MAAMc,QAAQ,EACd;YAAEC,UAAUL,eAAeD,aAAaE;QAAO,GAC/CL,KACAC,QACAC;IAEJ;IACA,OAAON,WAAWW,MAAM,CAACJ,aAAaE,OAAOL,KAAKC,QAAQC;AAC5D,EAAE"}

View File

@@ -0,0 +1,16 @@
import * as React from 'react';
import { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';
import { Runtime } from '../utils/Runtime';
export const jsxSlot = (type, overrideProps, key)=>{
const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);
const props = {
...slotProps,
...overrideProps
};
if (renderFunction) {
return Runtime.jsx(React.Fragment, {
children: renderFunction(elementType, props)
}, key);
}
return Runtime.jsx(elementType, props, key);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/jsx/jsxSlot.ts"],"sourcesContent":["import * as React from 'react';\nimport { SlotComponentType, UnknownSlotProps } from '@fluentui/react-utilities';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\nimport { Runtime } from '../utils/Runtime';\n\nexport const jsxSlot = <Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n overrideProps: Props | null,\n key?: React.Key,\n): React.ReactElement<Props> => {\n const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);\n\n const props: Props = { ...slotProps, ...overrideProps };\n\n if (renderFunction) {\n return Runtime.jsx(\n React.Fragment,\n { children: renderFunction(elementType, props) },\n key,\n ) as React.ReactElement<Props>;\n }\n return Runtime.jsx(elementType, props, key);\n};\n"],"names":["React","getMetadataFromSlotComponent","Runtime","jsxSlot","type","overrideProps","key","elementType","renderFunction","props","slotProps","jsx","Fragment","children"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,4BAA4B,QAAQ,wCAAwC;AACrF,SAASC,OAAO,QAAQ,mBAAmB;AAE3C,OAAO,MAAMC,UAAU,CACrBC,MACAC,eACAC;IAEA,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAEC,OAAOC,SAAS,EAAE,GAAGT,6BAA6BG;IAEvF,MAAMK,QAAe;QAAE,GAAGC,SAAS;QAAE,GAAGL,aAAa;IAAC;IAEtD,IAAIG,gBAAgB;QAClB,OAAON,QAAQS,GAAG,CAChBX,MAAMY,QAAQ,EACd;YAAEC,UAAUL,eAAeD,aAAaE;QAAO,GAC/CH;IAEJ;IACA,OAAOJ,QAAQS,GAAG,CAACJ,aAAaE,OAAOH;AACzC,EAAE"}

View File

@@ -0,0 +1,25 @@
import * as React from 'react';
import { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';
import { Runtime } from '../utils/Runtime';
export const jsxsSlot = (type, overrideProps, key)=>{
const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);
const props = {
...slotProps,
...overrideProps
};
if (renderFunction) {
/**
* In static runtime then children is an array and this array won't be keyed.
* We should wrap children by a static fragment
* as there's no way to know if renderFunction will render statically or dynamically
*/ return Runtime.jsx(React.Fragment, {
children: renderFunction(elementType, {
...props,
children: Runtime.jsxs(React.Fragment, {
children: props.children
}, undefined)
})
}, key);
}
return Runtime.jsxs(elementType, props, key);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/jsx/jsxsSlot.ts"],"sourcesContent":["import * as React from 'react';\nimport { SlotComponentType, UnknownSlotProps } from '@fluentui/react-utilities';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\nimport { Runtime } from '../utils/Runtime';\n\nexport const jsxsSlot = <Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n overrideProps: Props | null,\n key?: React.Key,\n): React.ReactElement<Props> => {\n const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);\n\n const props: Props = { ...slotProps, ...overrideProps };\n\n if (renderFunction) {\n /**\n * In static runtime then children is an array and this array won't be keyed.\n * We should wrap children by a static fragment\n * as there's no way to know if renderFunction will render statically or dynamically\n */\n return Runtime.jsx(\n React.Fragment,\n {\n children: renderFunction(elementType, {\n ...props,\n children: Runtime.jsxs(React.Fragment, { children: props.children }, undefined),\n }),\n },\n key,\n ) as React.ReactElement<Props>;\n }\n return Runtime.jsxs(elementType, props, key);\n};\n"],"names":["React","getMetadataFromSlotComponent","Runtime","jsxsSlot","type","overrideProps","key","elementType","renderFunction","props","slotProps","jsx","Fragment","children","jsxs","undefined"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,4BAA4B,QAAQ,wCAAwC;AACrF,SAASC,OAAO,QAAQ,mBAAmB;AAE3C,OAAO,MAAMC,WAAW,CACtBC,MACAC,eACAC;IAEA,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAEC,OAAOC,SAAS,EAAE,GAAGT,6BAA6BG;IAEvF,MAAMK,QAAe;QAAE,GAAGC,SAAS;QAAE,GAAGL,aAAa;IAAC;IAEtD,IAAIG,gBAAgB;QAClB;;;;KAIC,GACD,OAAON,QAAQS,GAAG,CAChBX,MAAMY,QAAQ,EACd;YACEC,UAAUL,eAAeD,aAAa;gBACpC,GAAGE,KAAK;gBACRI,UAAUX,QAAQY,IAAI,CAACd,MAAMY,QAAQ,EAAE;oBAAEC,UAAUJ,MAAMI,QAAQ;gBAAC,GAAGE;YACvE;QACF,GACAT;IAEJ;IACA,OAAOJ,QAAQY,IAAI,CAACP,aAAaE,OAAOH;AAC1C,EAAE"}

View File

@@ -0,0 +1,2 @@
import * as ReactDevRuntime from 'react/jsx-dev-runtime';
export const DevRuntime = ReactDevRuntime;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/utils/DevRuntime.ts"],"sourcesContent":["import * as ReactDevRuntime from 'react/jsx-dev-runtime';\nimport type { JSXRuntime } from './types';\n\nexport const DevRuntime = ReactDevRuntime as {\n jsxDEV: JSXRuntime;\n};\n"],"names":["ReactDevRuntime","DevRuntime"],"mappings":"AAAA,YAAYA,qBAAqB,wBAAwB;AAGzD,OAAO,MAAMC,aAAaD,gBAExB"}

View File

@@ -0,0 +1,2 @@
import * as ReactRuntime from 'react/jsx-runtime';
export const Runtime = ReactRuntime;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/utils/Runtime.ts"],"sourcesContent":["import * as ReactRuntime from 'react/jsx-runtime';\nimport type { JSXRuntime } from './types';\n\nexport const Runtime = ReactRuntime as {\n jsx: JSXRuntime;\n jsxs: JSXRuntime;\n};\n"],"names":["ReactRuntime","Runtime"],"mappings":"AAAA,YAAYA,kBAAkB,oBAAoB;AAGlD,OAAO,MAAMC,UAAUD,aAGrB"}

View File

@@ -0,0 +1,11 @@
import * as React from 'react';
import { SLOT_ELEMENT_TYPE_SYMBOL } from '@fluentui/react-utilities';
// TODO:
// this is for backwards compatibility with getSlotsNext
// it should be removed once getSlotsNext is obsolete
export function createCompatSlotComponent(type, props) {
return {
...props,
[SLOT_ELEMENT_TYPE_SYMBOL]: type
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/utils/createCompatSlotComponent.ts"],"sourcesContent":["import * as React from 'react';\nimport { SLOT_ELEMENT_TYPE_SYMBOL } from '@fluentui/react-utilities';\nimport type { SlotComponentType } from '@fluentui/react-utilities';\n\n// TODO:\n// this is for backwards compatibility with getSlotsNext\n// it should be removed once getSlotsNext is obsolete\nexport function createCompatSlotComponent<P extends {}>(type: React.ElementType<P>, props: P): SlotComponentType<P> {\n return {\n ...props,\n [SLOT_ELEMENT_TYPE_SYMBOL]: type,\n } as SlotComponentType<P>;\n}\n"],"names":["React","SLOT_ELEMENT_TYPE_SYMBOL","createCompatSlotComponent","type","props"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,QAAQ,4BAA4B;AAGrE,QAAQ;AACR,wDAAwD;AACxD,qDAAqD;AACrD,OAAO,SAASC,0BAAwCC,IAA0B,EAAEC,KAAQ;IAC1F,OAAO;QACL,GAAGA,KAAK;QACR,CAACH,yBAAyB,EAAEE;IAC9B;AACF"}

View File

@@ -0,0 +1,16 @@
import { SLOT_CLASS_NAME_PROP_SYMBOL, SLOT_ELEMENT_TYPE_SYMBOL, SLOT_RENDER_FUNCTION_SYMBOL } from '@fluentui/react-utilities';
/**
* @internal
*/ export function getMetadataFromSlotComponent(type) {
const { as, [SLOT_CLASS_NAME_PROP_SYMBOL]: _classNameProp, [SLOT_ELEMENT_TYPE_SYMBOL]: baseElementType, [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction, ...propsWithoutMetadata } = type;
const props = propsWithoutMetadata;
const elementType = typeof baseElementType === 'string' ? as !== null && as !== void 0 ? as : baseElementType : baseElementType;
if (typeof elementType !== 'string' && as) {
props.as = as;
}
return {
elementType,
props,
renderFunction
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/utils/getMetadataFromSlotComponent.ts"],"sourcesContent":["import type * as React from 'react';\nimport {\n SLOT_CLASS_NAME_PROP_SYMBOL,\n SLOT_ELEMENT_TYPE_SYMBOL,\n SLOT_RENDER_FUNCTION_SYMBOL,\n} from '@fluentui/react-utilities';\nimport type { SlotComponentType, SlotRenderFunction, UnknownSlotProps } from '@fluentui/react-utilities';\n\n/**\n * @internal\n */\nexport function getMetadataFromSlotComponent<Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n): {\n elementType: React.ElementType<Props>;\n props: Props;\n renderFunction: SlotRenderFunction<Props> | undefined;\n} {\n const {\n as,\n [SLOT_CLASS_NAME_PROP_SYMBOL]: _classNameProp,\n [SLOT_ELEMENT_TYPE_SYMBOL]: baseElementType,\n [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction,\n ...propsWithoutMetadata\n } = type;\n const props = propsWithoutMetadata as UnknownSlotProps as Props;\n\n const elementType = (\n typeof baseElementType === 'string' ? as ?? baseElementType : baseElementType\n ) as React.ElementType<Props>;\n\n if (typeof elementType !== 'string' && as) {\n props.as = as;\n }\n return { elementType, props, renderFunction };\n}\n"],"names":["SLOT_CLASS_NAME_PROP_SYMBOL","SLOT_ELEMENT_TYPE_SYMBOL","SLOT_RENDER_FUNCTION_SYMBOL","getMetadataFromSlotComponent","type","as","_classNameProp","baseElementType","renderFunction","propsWithoutMetadata","props","elementType"],"mappings":"AACA,SACEA,2BAA2B,EAC3BC,wBAAwB,EACxBC,2BAA2B,QACtB,4BAA4B;AAGnC;;CAEC,GACD,OAAO,SAASC,6BACdC,IAA8B;IAM9B,MAAM,EACJC,EAAE,EACF,CAACL,4BAA4B,EAAEM,cAAc,EAC7C,CAACL,yBAAyB,EAAEM,eAAe,EAC3C,CAACL,4BAA4B,EAAEM,cAAc,EAC7C,GAAGC,sBACJ,GAAGL;IACJ,MAAMM,QAAQD;IAEd,MAAME,cACJ,OAAOJ,oBAAoB,WAAWF,eAAAA,gBAAAA,KAAME,kBAAkBA;IAGhE,IAAI,OAAOI,gBAAgB,YAAYN,IAAI;QACzCK,MAAML,EAAE,GAAGA;IACb;IACA,OAAO;QAAEM;QAAaD;QAAOF;IAAe;AAC9C"}

View File

@@ -0,0 +1 @@
export { };

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/utils/types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { SlotComponentType, UnknownSlotProps } from '@fluentui/react-utilities';\n\nexport type JSXRuntime = <P extends {}>(\n type: React.ElementType<P>,\n props: P | null,\n key?: React.Key,\n source?: unknown,\n self?: unknown,\n) => React.ReactElement<P>;\n\nexport type JSXSlotRuntime = <Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n overrideProps: Props | null,\n key?: React.Key,\n source?: unknown,\n self?: unknown,\n) => React.ReactElement<Props>;\n"],"names":[],"mappings":"AAWA,WAM+B"}

View File

@@ -0,0 +1,13 @@
import * as React from 'react';
export function warnIfElementTypeIsInvalid(type) {
if (process.env.NODE_ENV === 'development' && typeof type === 'object' && type !== null && // eslint-disable-next-line dot-notation
type['$$typeof'] === undefined) {
// eslint-disable-next-line no-console
console.error(`@fluentui/react-jsx-runtime:
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: ${type}.
If this happened in a slot of Fluent UI component, you might be facing package resolution issues.
Please make sure you don't have multiple versions of "@fluentui/react-utilities" installed in your dependencies or sub-dependencies.
You can check this by searching up for matching entries in a lockfile produced by your package manager (yarn.lock, pnpm-lock.yaml or package-lock.json).`);
}
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/utils/warnIfElementTypeIsInvalid.ts"],"sourcesContent":["import * as React from 'react';\n\nexport function warnIfElementTypeIsInvalid(type: React.ElementType): void {\n if (\n process.env.NODE_ENV === 'development' &&\n typeof type === 'object' &&\n type !== null &&\n // eslint-disable-next-line dot-notation\n type['$$typeof'] === undefined\n ) {\n // eslint-disable-next-line no-console\n console.error(/** #__DE-INDENT__ */ `\n @fluentui/react-jsx-runtime:\n Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: ${type}.\n\n If this happened in a slot of Fluent UI component, you might be facing package resolution issues.\n Please make sure you don't have multiple versions of \"@fluentui/react-utilities\" installed in your dependencies or sub-dependencies.\n You can check this by searching up for matching entries in a lockfile produced by your package manager (yarn.lock, pnpm-lock.yaml or package-lock.json).\n `);\n }\n}\n"],"names":["React","warnIfElementTypeIsInvalid","type","process","env","NODE_ENV","undefined","console","error"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,OAAO,SAASC,2BAA2BC,IAAuB;IAChE,IACEC,QAAQC,GAAG,CAACC,QAAQ,KAAK,iBACzB,OAAOH,SAAS,YAChBA,SAAS,QACT,wCAAwC;IACxCA,IAAI,CAAC,WAAW,KAAKI,WACrB;QACA,sCAAsC;QACtCC,QAAQC,KAAK,CAAuB,CAAC;6HAE4F,EAAEN,KAAK;;;;wJAKtI,CAAC;IACL;AACF"}